Example #1
0
 /**
  * @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');
 }
Example #2
0
 /**
  * @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');
 }
Example #3
0
 /**
  * @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);
 }
Example #4
0
File: Grid.php Project: cocona/core
 /**
  * @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');
 }
Example #5
0
 /**
  * @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');
 }
Example #6
0
 /**
  * @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')]);
 }
Example #7
0
 /**
  * @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);
 }
Example #8
0
File: Row.php Project: cocona/core
 /**
  * @param array $attributes
  */
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     $this->presenters->put('tr', view('cocona.core::html.presenters.overview.grid.row.tr'));
 }
Example #9
0
File: Form.php Project: cocona/core
 /**
  * @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');
 }
Example #10
0
 /**
  * @param array $attributes
  */
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     $this->setRules(null);
 }
Example #11
0
File: Cell.php Project: cocona/core
 /**
  * @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);
 }