25 $this->_implicitRows=$implicitRows;
26 $this->_createCols=$createCols;
27 if (isset($numCols)) {
28 $this->_colSizing=
false;
48 if(isset(Wide::getConstants()[
"W" . $wide])){
49 $wide=Wide::getConstants()[
"W" . $wide];
70 public function addRow($colsCount=NULL) {
73 return $this->content[$rowCount - 1];
81 public function addCol($width=NULL) {
85 return $this->content[$colCount - 1];
95 foreach ( $sizes as $size ) {
107 public function setRowsCount($rowsCount, $colsCount=NULL, $force=
false) {
108 $count=$this->
count();
109 if ($rowsCount < 2 && $force ===
false) {
110 for($i=$count; $i < $colsCount; $i++) {
116 $item=$this->
addItem($colsCount);
117 $item->setContent($tmpContent);
118 $this->content=array ();
121 for($i=$count; $i < $rowsCount; $i++) {
129 return $count > 0 && $this->content[0] instanceof
HtmlGridCol;
140 if (isset($width)===
false) {
143 if ($toCreate ===
true) {
144 $count=$this->
count();
146 for($i=$count; $i < $numCols; $i++) {
150 for($i=0; $i < $count; $i++) {
151 $this->
getItem($i)->setColsCount($numCols);
171 return parent::getItem($index);
179 $count=$this->
count();
190 $count=$this->
count();
194 return $this->
getItem(0)->count();
209 $colO=$rowO->getItem($col);
220 $value=($vertically ===
true) ?
"vertically divided" :
"divided";
230 $value=($internally ===
true) ?
"internally celled" :
"celled";
231 return $this->
addToPropertyCtrl(
"class", $value, array (
"celled",
"internally celled" ));
266 $value=($very ===
true) ?
"very relaxed" :
"relaxed";
267 return $this->
addToPropertyCtrl(
"class", $value, array (
"relaxed",
"very relaxed" ));
281 if ($this->_createCols ===
false)
283 $item=
new HtmlGridRow($this->identifier .
"-row-" . ($this->
count() + 1), $value, $this->_colSizing, $this->_implicitRows);
292 $count=$this->
count();
293 $valuesSize=\sizeof($values);
294 if ($this->_createCols ===
false || $force ===
true) {
295 for($i=$count; $i < $valuesSize; $i++) {
296 $colSize=\sizeof($values[$i]);
297 $this->
addItem(
new HtmlGridRow($this->identifier .
"-row-" . ($this->
count() + 1), $colSize, $this->_colSizing, $this->_implicitRows));
300 $count=\min(array ($this->
count(),$valuesSize ));
301 for($i=0; $i < $count; $i++) {
302 $this->content[$i]->setValues($values[$i], $this->_createCols ===
false);
307 foreach ($this->content as $row){
308 $row->getCol($numCol)->setWidth($width);
329 $col=$this->
getCell(0, $afterColIndex);
331 $col->addDivider($vertical,
$content);
static getConstantValues($postFix="", $prefixBefore=false)
addItem($item)
adds and returns an item
Base class for Semantic Html collections.
addToProperty($name, $value, $separator=" ")
addToPropertyCtrl($name, $value, $typeCtrl)
setRowsCount($rowsCount, $colsCount=NULL, $force=false)
Create $rowsCount rows.
setVerticalAlignment($value=VerticalAlignment::MIDDLE)
setWide($wide)
Defines the grid width (alias for setWidth)
createItem($value)
The item factory.
addRow($colsCount=NULL)
Adds a row with $colsCount columns.
addCol($width=NULL)
Adds a col.
setDivided($vertically=false)
Adds dividers between columns ($vertically=false) or between rows ($vertically=true)
setCentered()
A grid can have its columns centered.
__construct($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false)
colCount()
Returns the column count.
addDivider($afterColIndex, $vertical=true, $content=NULL)
Adds a divider after the specified col.
getCell($row, $col)
Returns the cell (HtmlGridCol) at position $row,$col.
rowCount()
Returns the row count.
getRow($index)
return the row at $index
setEqualWidth()
automatically resize all elements to split the available width evenly
setColWidth($numCol, $width)
setCelled($internally=false)
Divides rows into cells.
setWidth($width)
Defines the grid width.
setValues($values, $force=true)
Sets $values to the grid.
setStretched()
stretch the row contents to take up the entire column height
setColsCount($numCols, $toCreate=true, $width=NULL)
Defines the number of columns in the grid.
setPadded($value=NULL)
Adds vertical or/and horizontal gutters.
A col in the Semantic Grid component.
A row for the Semantic Grid component.