startDate = $startDate; return $this; } /** * @return mixed */ public function getStartDate() { return $this->startDate; } protected function _initElements() { foreach ($this->_defaults as $name => $defaults) { $showDay = count($this->_defaults) > 1; $date = date('Y-m-d', strtotime($this->getStartDate() . ' + ' . $name . ' days')); $this->addSubForm(new Item(compact('defaults', 'name', 'showDay', 'date')), strval($name)); } return parent::_initElements(); } public function loadDefaultDecorators() { if ($this->loadDefaultDecoratorsIsDisabled()) { return $this; } $decorators = $this->getDecorators(); if (empty($decorators)) { $this->addDecorator('TableHeader') ->addDecorator(['thead' => 'HtmlTag'], ['tag' => 'thead']) ->addDecorator(['tbodyOpen' => 'HtmlTag'], ['tag' => 'tbody', 'openOnly' => true, 'placement' => 'append']) ->addDecorator('FormElements') ->addDecorator(['tbodyClose' => 'HtmlTag'], ['tag' => 'tbody', 'closeOnly' => true, 'placement' => 'append']) ->addDecorator(['table' => 'HtmlTag'], ['tag' => 'table', 'class' => 'table table-bordered table-striped']) ->addDecorator('DtDdWrapper'); } return $this; } }