exportRules() public static method

public static exportRules ( Rules $rules ) : array
$rules Rules
return array
コード例 #1
0
ファイル: BaseControl.php プロジェクト: jave007/test
 /** @deprecated */
 protected static function exportRules($rules)
 {
     trigger_error(__METHOD__ . '() is deprecated; use Nette\\Forms\\Helpers::exportRules() instead.', E_USER_DEPRECATED);
     return Nette\Forms\Helpers::exportRules($rules);
 }
コード例 #2
0
ファイル: BaseControl.php プロジェクト: nette/forms
 /**
  * Generates control's HTML element.
  * @return Html|string
  */
 public function getControl()
 {
     $this->setOption('rendered', TRUE);
     $el = clone $this->control;
     return $el->addAttributes(['name' => $this->getHtmlName(), 'id' => $this->getHtmlId(), 'required' => $this->isRequired(), 'disabled' => $this->isDisabled(), 'data-nette-rules' => Nette\Forms\Helpers::exportRules($this->rules) ?: NULL]);
 }
コード例 #3
0
ファイル: custom-control.php プロジェクト: jjanekk/forms
 /**
  * Generates control's HTML element.
  */
 public function getControl()
 {
     $name = $this->getHtmlName();
     return Html::el('input', ['name' => $name . '[day]', 'id' => $this->getHtmlId(), 'value' => $this->day, 'type' => 'number', 'min' => 1, 'max' => 31, 'data-nette-rules' => Helpers::exportRules($this->getRules()) ?: NULL]) . Helpers::createSelectBox([1 => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], ['selected?' => $this->month])->name($name . '[month]') . Html::el('input', ['name' => $name . '[year]', 'value' => $this->year, 'type' => 'number']);
 }