lekoala /
silverstripe-blocks
| 1 | <?php |
||
| 2 | |||
| 3 | namespace LeKoala\Blocks; |
||
| 4 | |||
| 5 | use PageController; |
||
| 6 | |||
| 7 | /** |
||
| 8 | * Extend page controller |
||
| 9 | * |
||
| 10 | * @property \LeKoala\Blocks\BlocksPage dataRecord |
||
| 11 | * @method \LeKoala\Blocks\BlocksPage data() |
||
| 12 | * @mixin \LeKoala\Blocks\BlocksPage dataRecord |
||
| 13 | */ |
||
| 14 | class BlocksPageController extends PageController |
||
| 15 | { |
||
| 16 | public function BodyClass() |
||
| 17 | { |
||
| 18 | $class = parent::BodyClass(); |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 19 | |||
| 20 | $arr = $this->data()->getBlocksListArray(); |
||
| 21 | if (!empty($arr)) { |
||
| 22 | $class .= ' Starts-' . $arr[0]; |
||
| 23 | } |
||
| 24 | |||
| 25 | return $class; |
||
| 26 | } |
||
| 27 | } |
||
| 28 |