本文整理匯總了PHP中AppHelper::_name方法的典型用法代碼示例。如果您正苦於以下問題:PHP AppHelper::_name方法的具體用法?PHP AppHelper::_name怎麽用?PHP AppHelper::_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AppHelper
的用法示例。
在下文中一共展示了AppHelper::_name方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _name
/**
* Gets the input field name for the current tag
*
* @param array $options
* @param string $field
* @param string $key
* @return array
*/
protected 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;
}
$entity = $this->entity();
$model = $this->model();
$name = $model === $entity[0] && isset($entity[1]) ? $entity[1] : $entity[0];
$last = $entity[count($entity) - 1];
if (in_array($last, $this->_fieldSuffixes)) {
$name .= '[' . $last . ']';
}
if (is_array($options)) {
$options[$key] = $name;
return $options;
} else {
return $name;
}
}
return parent::_name($options, $field, $key);
}
示例2: array
/**
* Gets the input field name for the current tag
*
* @param array $options
* @param string $key
* @return array
* @access protected
*/
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);
}
示例3: _name
/**
* Gets the input field name for the current tag
*
* @param array $options
* @param string $key
* @return array
*/
protected 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 = !empty($this->_View->field) ? $this->_View->field : $this->_View->model;
if (!empty($this->_View->fieldSuffix)) {
$name .= '[' . $this->_View->fieldSuffix . ']';
}
if (is_array($options)) {
$options[$key] = $name;
return $options;
} else {
return $name;
}
}
return parent::_name($options, $field, $key);
}
示例4: array
/**
* Gets the input field name for the current tag
*
* @param array $options
* @param string $key
* @return array
* @access protected
*/
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);
}