<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Layout; use Illuminate\Contracts\Support\Renderable; class Row implements Buildable, Renderable { protected $columns = array(); protected $class = array(); public function __construct($DTnPC = '') { if (!empty($DTnPC)) { if ($DTnPC instanceof \Closure) { call_user_func($DTnPC, $this); } else { $this->column(12, $DTnPC); } } } public function column($r3IZu, $DTnPC) { goto RaG5E; zcSDs: $this->addColumn($XrXh2); goto wZLuS; i7zs5: $XrXh2 = new Column($DTnPC, $r3IZu); goto zcSDs; RaG5E: $r3IZu = $r3IZu < 1 ? round(12 * $r3IZu) : $r3IZu; goto i7zs5; wZLuS: } protected function addColumn(Column $XrXh2) { $this->columns[] = $XrXh2; } public function build() { goto dgxxH; dgxxH: $this->startRow(); goto Wfn_e; SqOsf: $this->endRow(); goto wJUfX; Wfn_e: foreach ($this->columns as $XrXh2) { $XrXh2->build(); } goto SqOsf; wJUfX: } protected function startRow() { goto D_drd; ratst: $cl6c3[] = 'row'; goto yapx9; yapx9: echo '<div class="' . implode(' ', $cl6c3) . '">'; goto Xg9OM; D_drd: $cl6c3 = $this->class; goto ratst; Xg9OM: } protected function endRow() { echo '</div>'; } public function render() { goto QBUcU; YlvmB: $wvdXH = ob_get_contents(); goto T5UEu; t91dy: $this->build(); goto YlvmB; QBUcU: ob_start(); goto t91dy; McBuh: return $wvdXH; goto Jycmo; T5UEu: ob_end_clean(); goto McBuh; Jycmo: } }