<?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($ohNZt = '') { if (!empty($ohNZt)) { if ($ohNZt instanceof \Closure) { call_user_func($ohNZt, $this); } else { $this->column(12, $ohNZt); } } } public function column($gCaaD, $ohNZt) { goto tkbgo; gjq2X: $this->addColumn($xiZoD); goto d14k1; QLPKc: $xiZoD = new Column($ohNZt, $gCaaD); goto gjq2X; tkbgo: $gCaaD = $gCaaD < 1 ? round(12 * $gCaaD) : $gCaaD; goto QLPKc; d14k1: } protected function addColumn(Column $xiZoD) { $this->columns[] = $xiZoD; } public function build() { goto PgqzT; PgqzT: $this->startRow(); goto a3XIr; a3XIr: foreach ($this->columns as $xiZoD) { $xiZoD->build(); } goto OC125; OC125: $this->endRow(); goto l4rkt; l4rkt: } protected function startRow() { goto fh5fp; fh5fp: $AEqP7 = $this->class; goto e0NzW; wPUg_: echo '<div class="' . implode(' ', $AEqP7) . '">'; goto f4pkn; e0NzW: $AEqP7[] = 'row'; goto wPUg_; f4pkn: } protected function endRow() { echo '</div>'; } public function render() { goto bgyUb; bgyUb: ob_start(); goto M98WA; M98WA: $this->build(); goto snnLP; zQPCx: ob_end_clean(); goto e5AK_; e5AK_: return $NMwSd; goto DopkS; snnLP: $NMwSd = ob_get_contents(); goto zQPCx; DopkS: } }