Exemple #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');
 }
Exemple #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');
 }
Exemple #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);
 }
Exemple #4
0
 /**
  * @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');
 }
Exemple #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');
 }
Exemple #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')]);
 }
Exemple #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);
 }
Exemple #8
0
 /**
  * @param array $attributes
  */
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     $this->presenters->put('tr', view('cocona.core::html.presenters.overview.grid.row.tr'));
 }
Exemple #9
0
 /**
  * @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');
 }
Exemple #10
0
 /**
  * @param array $attributes
  */
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     $this->setRules(null);
 }
Exemple #11
0
 /**
  * @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);
 }