/** * Create a new item instance * * @param ItemList $parent The parent * @param Tag $value The content * @param array $children Facultative children ItemLists * @param array $element The Item element */ public function __construct(ItemList $parent, Tag $value, $children = null, $element = null) { $this->parent = $parent; $this->children = is_null($children) ? new ItemList() : $children; $this->element = $element; // Create content $this->value = $value->setParent($this); }
/** * Delegate methods to the Imagine instance * * @param string $method * @param array $arguments * * @return Image */ public function __call($method, $arguments) { if (method_exists('Imagine\\Gd\\Image', $method)) { $this->salts[$method] = $arguments; } return parent::__call($method, $arguments); }
/** * Opens a group * * @return string Opening tag */ public function open() { if ($this->getErrors()) { $this->state($this->app['former.framework']->errorState()); } // Retrieve state and append it to classes if ($this->state) { $this->addClass($this->state); } // Required state if ($this->app->bound('former.field') and $this->app['former.field']->isRequired()) { $this->addClass($this->app['former']->getOption('required_class')); } return parent::open(); }
/** * @return string */ public function render() { $value = $this->choices->all(); if (!empty($this->label)) { $label = Element::create('label', $this->label); $this->nest($label, 'label'); $this->nest('<br>'); } $this->nest($value, 'choices'); return parent::render(); }