\PHPExcel_Style_Alignment

PHPExcel_Style_Alignment

Copyright (c) 2006 - 2015 PHPExcel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Summary

Methods
Properties
Constants
__construct()
bindParent()
getIsSupervisor()
getActiveSheet()
getSelectedCells()
getActiveCell()
__clone()
getSharedComponent()
getStyleArray()
applyFromArray()
getHorizontal()
setHorizontal()
getVertical()
setVertical()
getTextRotation()
setTextRotation()
getWrapText()
setWrapText()
getShrinkToFit()
setShrinkToFit()
getIndent()
setIndent()
getReadorder()
setReadorder()
getHashCode()
No public properties found
HORIZONTAL_GENERAL
HORIZONTAL_LEFT
HORIZONTAL_RIGHT
HORIZONTAL_CENTER
HORIZONTAL_CENTER_CONTINUOUS
HORIZONTAL_JUSTIFY
HORIZONTAL_FILL
HORIZONTAL_DISTRIBUTED
VERTICAL_BOTTOM
VERTICAL_TOP
VERTICAL_CENTER
VERTICAL_JUSTIFY
VERTICAL_DISTRIBUTED
READORDER_CONTEXT
READORDER_LTR
READORDER_RTL
No protected methods found
$isSupervisor
$parent
$horizontal
$vertical
$textRotation
$wrapText
$shrinkToFit
$indent
$readorder
N/A
No private methods found
No private properties found
N/A

Constants

HORIZONTAL_GENERAL

HORIZONTAL_GENERAL = 'general'

HORIZONTAL_LEFT

HORIZONTAL_LEFT = 'left'

HORIZONTAL_RIGHT

HORIZONTAL_RIGHT = 'right'

HORIZONTAL_CENTER

HORIZONTAL_CENTER = 'center'

HORIZONTAL_CENTER_CONTINUOUS

HORIZONTAL_CENTER_CONTINUOUS = 'centerContinuous'

HORIZONTAL_JUSTIFY

HORIZONTAL_JUSTIFY = 'justify'

HORIZONTAL_FILL

HORIZONTAL_FILL = 'fill'

HORIZONTAL_DISTRIBUTED

HORIZONTAL_DISTRIBUTED = 'distributed'

VERTICAL_BOTTOM

VERTICAL_BOTTOM = 'bottom'

VERTICAL_TOP

VERTICAL_TOP = 'top'

VERTICAL_CENTER

VERTICAL_CENTER = 'center'

VERTICAL_JUSTIFY

VERTICAL_JUSTIFY = 'justify'

VERTICAL_DISTRIBUTED

VERTICAL_DISTRIBUTED = 'distributed'

READORDER_CONTEXT

READORDER_CONTEXT = 0

READORDER_LTR

READORDER_LTR = 1

READORDER_RTL

READORDER_RTL = 2

Properties

$isSupervisor

$isSupervisor : bool

Supervisor?

Type

bool —

$parent

$parent : \PHPExcel_Style

Parent. Only used for supervisor

Type

PHPExcel_Style —

$horizontal

$horizontal : string

Horizontal alignment

Type

string —

$vertical

$vertical : string

Vertical alignment

Type

string —

$textRotation

$textRotation : int

Text rotation

Type

int —

$wrapText

$wrapText : bool

Wrap text

Type

bool —

$shrinkToFit

$shrinkToFit : bool

Shrink to fit

Type

bool —

$indent

$indent : int

Indent - only possible with horizontal alignment left and right

Type

int —

$readorder

$readorder : int

Read order

Type

int —

Methods

__construct()

__construct(bool  $isSupervisor = false, bool  $isConditional = false) : mixed

Create a new PHPExcel_Style_Alignment

Parameters

bool $isSupervisor

Flag indicating if this is a supervisor or not Leave this value at default unless you understand exactly what its ramifications are

bool $isConditional

Flag indicating if this is a conditional style or not Leave this value at default unless you understand exactly what its ramifications are

Returns

mixed —

bindParent()

bindParent(\PHPExcel  $parent, mixed  $parentPropertyName = null) : \PHPExcel_Style_Supervisor

Bind parent. Only used for supervisor

Parameters

\PHPExcel $parent
mixed $parentPropertyName

Returns

\PHPExcel_Style_Supervisor —

getIsSupervisor()

getIsSupervisor() : bool

Is this a supervisor or a cell style component?

Returns

bool —

getActiveSheet()

getActiveSheet() : \PHPExcel_Worksheet

Get the currently active sheet. Only used for supervisor

Returns

\PHPExcel_Worksheet —

getSelectedCells()

getSelectedCells() : string

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns

string —

E.g. 'A1'

getActiveCell()

getActiveCell() : string

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Returns

string —

E.g. 'A1'

__clone()

__clone() : mixed

Implement PHP __clone to create a deep clone, not just a shallow copy.

Returns

mixed —

getSharedComponent()

getSharedComponent() : \PHPExcel_Style_Alignment

Get the shared style component for the currently active cell in currently active sheet.

Only used for style supervisor

Returns

\PHPExcel_Style_Alignment —

getStyleArray()

getStyleArray(array  $array) : array

Build style array from subcomponents

Parameters

array $array

Returns

array —

applyFromArray()

applyFromArray(array  $pStyles = null) : \PHPExcel_Style_Alignment

Apply styles from array

$objPHPExcel->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray( array( 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER, 'rotation' => 0, 'wrap' => TRUE ) );

Parameters

array $pStyles

Array containing style information

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Style_Alignment —

getHorizontal()

getHorizontal() : string

Get Horizontal

Returns

string —

setHorizontal()

setHorizontal(string  $pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL) : \PHPExcel_Style_Alignment

Set Horizontal

Parameters

string $pValue

Returns

\PHPExcel_Style_Alignment —

getVertical()

getVertical() : string

Get Vertical

Returns

string —

setVertical()

setVertical(string  $pValue = PHPExcel_Style_Alignment::VERTICAL_BOTTOM) : \PHPExcel_Style_Alignment

Set Vertical

Parameters

string $pValue

Returns

\PHPExcel_Style_Alignment —

getTextRotation()

getTextRotation() : int

Get TextRotation

Returns

int —

setTextRotation()

setTextRotation(int  $pValue) : \PHPExcel_Style_Alignment

Set TextRotation

Parameters

int $pValue

Throws

\PHPExcel_Exception

Returns

\PHPExcel_Style_Alignment —

getWrapText()

getWrapText() : bool

Get Wrap Text

Returns

bool —

setWrapText()

setWrapText(bool  $pValue = false) : \PHPExcel_Style_Alignment

Set Wrap Text

Parameters

bool $pValue

Returns

\PHPExcel_Style_Alignment —

getShrinkToFit()

getShrinkToFit() : bool

Get Shrink to fit

Returns

bool —

setShrinkToFit()

setShrinkToFit(bool  $pValue = false) : \PHPExcel_Style_Alignment

Set Shrink to fit

Parameters

bool $pValue

Returns

\PHPExcel_Style_Alignment —

getIndent()

getIndent() : int

Get indent

Returns

int —

setIndent()

setIndent(int  $pValue) : \PHPExcel_Style_Alignment

Set indent

Parameters

int $pValue

Returns

\PHPExcel_Style_Alignment —

getReadorder()

getReadorder() : int

Get read order

Returns

int —

setReadorder()

setReadorder(int  $pValue) : \PHPExcel_Style_Alignment

Set read order

Parameters

int $pValue

Returns

\PHPExcel_Style_Alignment —

getHashCode()

getHashCode() : string

Get hash code

Returns

string —

Hash code