26 $this->_implicitRows=$implicitRows;
27 $this->_createCols=$createCols;
28 if (isset($numCols)) {
29 $this->_colSizing=
false;
71 public function addRow($colsCount=NULL) {
74 return $this->content[$rowCount - 1];
82 public function addCol($width=NULL) {
86 return $this->content[$colCount - 1];
96 foreach ( $sizes as $size ) {
108 public function setRowsCount($rowsCount, $colsCount=NULL, $force=
false) {
109 $count=$this->
count();
110 if ($rowsCount < 2 && $force ===
false) {
111 for($i=$count; $i < $colsCount; $i++) {
117 $item=$this->
addItem($colsCount);
118 $item->setContent($tmpContent);
119 $this->content=array ();
122 for($i=$count; $i < $rowsCount; $i++) {
130 return $count > 0 && $this->content[0] instanceof
HtmlGridCol;
141 if (isset($width)===
false) {
144 if ($toCreate ===
true) {
145 $count=$this->
count();
147 for($i=$count; $i < $numCols; $i++) {
151 for($i=0; $i < $count; $i++) {
152 $this->
getItem($i)->setColsCount($numCols);
180 $count=$this->
count();
191 $count=$this->
count();
195 return $this->
getItem(0)->count();
210 $colO=$rowO->getItem($col);
221 $value=($vertically ===
true) ?
"vertically divided" :
"divided";
231 $value=($internally ===
true) ?
"internally celled" :
"celled";
232 return $this->
addToPropertyCtrl(
"class", $value, array (
"celled",
"internally celled" ));
267 $value=($very ===
true) ?
"very relaxed" :
"relaxed";
268 return $this->
addToPropertyCtrl(
"class", $value, array (
"relaxed",
"very relaxed" ));
282 if ($this->_createCols ===
false)
284 $item=
new HtmlGridRow($this->identifier .
"-row-" . ($this->
count() + 1), $value, $this->_colSizing, $this->_implicitRows);
293 $count=$this->
count();
294 $valuesSize=\sizeof($values);
295 if ($this->_createCols ===
false || $force ===
true) {
296 for($i=$count; $i < $valuesSize; $i++) {
297 $colSize=\sizeof($values[$i]);
298 $this->
addItem(
new HtmlGridRow($this->identifier .
"-row-" . ($this->
count() + 1), $colSize, $this->_colSizing, $this->_implicitRows));
301 $count=\min(array ($this->
count(),$valuesSize ));
302 for($i=0; $i < $count; $i++) {
303 $this->content[$i]->setValues($values[$i], $this->_createCols ===
false);
308 foreach ($this->content as $row){
309 $row->getCol($numCol)->setWidth($width);
330 $col=$this->
getCell(0, $afterColIndex);
332 $col->addDivider($vertical,
$content);
addDivider($afterColIndex, $vertical=true, $content=NULL)
Adds a divider after the specified col.
addCol($width=NULL)
Adds a col.
addToProperty($name, $value, $separator=" ")
getRow($index)
return the row at $index
getCell($row, $col)
Returns the cell (HtmlGridCol) at position $row,$col.
setCentered()
A grid can have its columns centered.
setValues($values, $force=true)
Sets $values to the grid.
A row for the Semantic Grid component.
addItem($item)
adds and returns an item
rowCount()
Returns the row count.
colCount()
Returns the column count.
addRow($colsCount=NULL)
Adds a row with $colsCount columns.
setDivided($vertically=false)
Adds dividers between columns ($vertically=false) or between rows ($vertically=true) ...
setWidth($width)
Defines the grid width.
__construct($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false)
static getConstantValues($postFix="", $prefixBefore=false)
setStretched()
stretch the row contents to take up the entire column height
setEqualWidth()
automatically resize all elements to split the available width evenly
setPadded($value=NULL)
Adds vertical or/and horizontal gutters.
A col in the Semantic Grid component.
setRowsCount($rowsCount, $colsCount=NULL, $force=false)
Create $rowsCount rows.
Base class for Semantic Html collections.
setCelled($internally=false)
Divides rows into cells.
setVerticalAlignment($value=VerticalAlignment::MIDDLE)
setColsCount($numCols, $toCreate=true, $width=NULL)
Defines the number of columns in the grid.
setColWidth($numCol, $width)
addToPropertyCtrl($name, $value, $typeCtrl)
setWide($wide)
Defines the grid width (alias for setWidth)