Skip to content

Can I use direct call as IOFactory in StyleArray? #2630

Answered by oleibman
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

You did 2 things wrong. You need to remove array( from your assignment to $styleArray, and the font color needs to be an array. The following should work:

$styleArray = [
	'font'	=>	[
		'size'	=>	12,
		'color'	=>	['rgb' =>'FFFFFF'],
	],
	'alignment'	=>	[
		'horizontal'	=>	Alignment::HORIZONTAL_CENTER,
		'vertical'	=>	Alignment::VERTICAL_CENTER,
		'wrapText'	=>	true,
	],
	'borders'	=>	[
		'allBorders'	=>	[
			'borderStyle'	=>	Border::BORDER_MEDIUM,
		],
	],
	'fill'	=>	[
		'fillType'	=>	Fill::FILL_SOLID,
		'startColor'	=>	[
			'argb'	=>	'FF000000',
		],
		'endColor'	=>	[
			'argb'	=>	'FF000000',
		],
	],
];

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant