/** * @param array $attributes */ public function __construct(array $attributes = []) { parent::__construct($attributes); $this->actions = new Collection(); $this->columns = new Collection(); // Create the default child elements foreach (['filters', 'actions', 'body'] as $group) { $this->children->put($group, $this->{$group} = new Element(['class' => $group])); } $this->body->children()->put('grid', $this->grid = new Grid()); // Change the default presenter $this->presenters->put('default', view('cocona.core::html.presenters.overview')); $this->present('default'); }
/** * @param null $value * @param array $attributes */ public function __construct($value = null, array $attributes = []) { parent::__construct(array_merge($attributes, ['type' => 'submit'])); $this->presenters->put('default', view('cocona.core::html.presenters.form.controls.submit')); $this->present('default'); $this->children->put('body', $value ?: 'Submit'); }
/** * @param \Cocona\Core\Html\Presenter $label * @param array $attributes */ public function __construct($label, array $attributes = []) { parent::__construct($attributes); $this->presenters->put('default', view('cocona.core::html.presenters.form.label')); $this->present('default'); $this->children->put('body', $label); }
/** * @param array $attributes */ public function __construct(array $attributes = []) { parent::__construct($attributes); $this->presenters->put('table', view('cocona.core::html.presenters.overview.grid.table')); // Create the default groups foreach (['head', 'body', 'tail'] as $group) { $this->children->put($group, new Group(['data-group' => $group])); } $this->present('table'); }
/** * @param array $attributes */ public function __construct(array $attributes = []) { parent::__construct($attributes); $this->presenters->put('default', view('cocona.core::html.presenters.form.group')); $this->present('default'); }
/** * @param array $attributes */ public function __construct(array $attributes = []) { parent::__construct($attributes); $this->presenters = $this->presenters->merge(['thead' => view('cocona.core::html.presenters.overview.grid.group.thead'), 'tbody' => view('cocona.core::html.presenters.overview.grid.group.tbody'), 'tfoot' => view('cocona.core::html.presenters.overview.grid.group.tfoot')]); }
/** * @param string|integer $value * @param string $label * @param array $attributes */ public function __construct($value, $label, array $attributes = []) { parent::__construct(array_merge($attributes, ['value' => $value])); $this->children->put('body', $label); }
/** * @param array $attributes */ public function __construct(array $attributes = []) { parent::__construct($attributes); $this->presenters->put('tr', view('cocona.core::html.presenters.overview.grid.row.tr')); }
/** * @param array $attributes */ public function __construct(array $attributes = []) { parent::__construct(array_merge($attributes, ['method' => 'POST'])); $this->presenters->put('default', view('cocona.core::html.presenters.form')); $this->present('default'); }
/** * @param array $attributes */ public function __construct(array $attributes = []) { parent::__construct($attributes); $this->setRules(null); }
/** * @param array|Arrayable|string $elements * @param array $attributes */ public function __construct($elements, array $attributes = []) { parent::__construct($attributes); $this->presenters = $this->presenters->merge(['td' => view('cocona.core::html.presenters.overview.grid.cell.td'), 'th' => view('cocona.core::html.presenters.overview.grid.cell.th')]); $this->children->put('body', $elements); }