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]; }
/** * Build name for element. * * @param string $name * * @return string */ protected function elementName($name) { return $this->model ? sprintf('%s[%s]', $this->model->name(), $name) : $name; }