/** * Gets the input field name for the current tag * * @param array $options * @param string $key * @return array */ function __name($options = array(), $field = null, $key = 'name') { if ($this->requestType == 'get') { if ($options === null) { $options = array(); } elseif (is_string($options)) { $field = $options; $options = 0; } if (!empty($field)) { $this->setEntity($field); } if (is_array($options) && isset($options[$key])) { return $options; } $name = $this->field(); if (is_array($options)) { $options[$key] = $name; return $options; } else { return $name; } } return parent::__name($options, $field, $key); }
/** * Gets the input field name for the current tag * * @param array $options * @param string $key * @return array */ function __name($options = array(), $field = null, $key = 'name') { if ($this->requestType == 'get') { if ($options === null) { $options = array(); } elseif (is_string($options)) { $field = $options; $options = 0; } if (!empty($field)) { $this->setEntity($field); } if (is_array($options) && isset($options[$key])) { return $options; } $view = ClassRegistry::getObject('view'); $name = $view->field; if (!empty($view->fieldSuffix)) { $name .= '[' . $view->fieldSuffix . ']'; } if (is_array($options)) { $options[$key] = $name; return $options; } else { return $name; } } return parent::__name($options, $field, $key); }