예제 #1
0
 protected function getValueByModelAndName(array $data)
 {
     if (!isset($data[$this->model->name()][$this->elementName])) {
         throw new \Rapid\Form\Validator\Exception\DoesntExist();
     }
     return $data[$this->model->name()][$this->elementName];
 }
예제 #2
0
파일: Form.php 프로젝트: creogen/rapidphp
 /**
  * Build name for element.
  *
  * @param string $name
  *
  * @return string
  */
 protected function elementName($name)
 {
     return $this->model ? sprintf('%s[%s]', $this->model->name(), $name) : $name;
 }