public function init() { $element = new Input(); $element->setAttributes(['name' => 'firstName', 'type' => 'text', 'placeholder' => 'Имя', 'required' => 'required']); $element->setValidators(['blank']); $element->getLabel()->setText('Имя'); $this->append($element); $element = new Input(); $element->setAttributes(['name' => 'emailAddress', 'type' => 'text', 'placeholder' => 'Электронная почта', 'required' => 'required']); $element->setValidators(['email', 'EvaUser\\Validator\\EmailNotExist']); $element->getLabel()->setText('Электронная почта'); $this->append($element); $element = new Input(); $element->setAttributes(['name' => 'phoneNumber', 'type' => 'text', 'placeholder' => 'Телефон', 'required' => 'required']); $element->setValidators(['phone', 'EvaUser\\Validator\\PhoneNotExist']); $element->getLabel()->setText('Телефон'); $this->append($element); $element = new Input(); $element->setAttributes(['name' => 'password', 'type' => 'password', 'placeholder' => 'Пароль', 'required' => 'required']); $element->setValidators(['blank']); $element->getLabel()->setText('Пароль'); $this->append($element); $element = new Input(); $element->setAttributes(['type' => 'submit', 'value' => 'Регистрация']); $this->append($element); }
public function init() { $element = new Input(); $element->setAttributes(['name' => 'identifier', 'type' => 'text', 'placeholder' => 'Электронная почта', 'required' => 'required']); $element->setValidators(['email', 'EvaUser\\Validator\\EmailExist']); $element->getLabel()->setText('Электронная почта'); $this->set('identifier', $element); $element = new Input(); $element->setAttributes(['type' => 'submit', 'value' => 'Восстановить пароль']); $this->append($element); }
protected function init() { $element = new Input(); $element->setAttributes(['name' => 'name', 'type' => 'text', 'placeholder' => 'Название']); $element->getLabel()->setText('Название'); $this->append($element); $element = new Textarea(); $element->setAttributes(['name' => 'options']); $element->getLabel()->setText('Варианты'); $this->append($element); $element = new Input(); $element->setAttributes(['type' => 'submit', 'value' => 'Сохранить']); $this->append($element); }
public function init() { $element = new Input(); $element->setAttributes(['name' => 'old_password', 'type' => 'password', 'placeholder' => 'Текущий пароль', 'required' => 'required']); $element->setValidators(['blank', 'EvaUser\\Validator\\CurrentPassword']); $element->getLabel()->setText('Текущий пароль'); $this->append($element); $element = new Input(); $element->setAttributes(['name' => 'password', 'type' => 'password', 'placeholder' => 'Новый пароль', 'required' => 'required']); $element->setValidators(['blank']); $element->getLabel()->setText('Новый пароль'); $this->append($element); $element = new Input(); $element->setAttributes(['type' => 'submit', 'value' => 'Сменить пароль']); $this->append($element); }
public function init() { $element = new Input(); $element->setAttributes(['name' => 'identifier', 'type' => 'text', 'placeholder' => 'Электронная почта или телефон', 'required' => 'required']); $element->getLabel()->setText('Электронная почта или телефон'); $this->set('identifier', $element); $element = new Input(); $element->setAttributes(['name' => 'password', 'type' => 'password', 'placeholder' => 'Пароль', 'required' => 'required']); $element->getLabel()->setText('Пароль'); $this->append($element); $element = new Input(); $element->setAttributes(['name' => 'remember', 'type' => 'checkbox']); $element->getLabel()->setText('Запомнить меня'); $this->append($element); $element = new Input(); $element->setAttributes(['type' => 'submit', 'value' => 'Войти']); $this->append($element); }
public function setValue($value) { if (!$value instanceof Entity) { throw new \Exception('Значение должно быть экземпляром Entity'); } if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/data/' . $this->dataPath . '/image/' . $value->getId() . 'thumb.jpg')) { $div = new Div(); $div->setAttribute('class', 'clearfix photos-input'); $this->append($div); $html = ' <div class="pull-left"> <div class="btn-group btn-group-sm"> <a href="/' . $this->modulePath . '/удалить-изображение/id/' . $value->getId() . '" class="btn btn-default" title="Удалить изображение"><span class="glyphicon glyphicon-remove"></span></a></div> <img src="/data/' . $this->dataPath . '/image/' . $value->getId() . 'thumb.jpg" class="img-thumbnail"> </div> '; $div->setText($html); } parent::setValue($value); }
public function setValue($value) { if ($value instanceof \ArrayObject) { $div = new Div(); $div->setAttribute('class', 'clearfix photos-input'); $this->append($div); $html = ''; foreach ($value as $entity) { /** @var \Eva\Entity\Entity $entity */ $html .= ' <div class="pull-left"> <div class="btn-group btn-group-sm"> <a href="/' . $this->modulePath . '/удалить-фото/id/' . $entity->getId() . '" class="btn btn-default" title="Удалить фото"><span class="glyphicon glyphicon-remove"></span></a></div> <img src="/data/' . $this->dataPath . '/photo/' . $entity->getId() . 'thumb.jpg" class="img-thumbnail"> </div> '; } $div->setText($html); } parent::setValue($value); }