コード例 #1
0
ファイル: form.php プロジェクト: BGCX067/fake-as3-svn-to-git
 /**
  * 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);
 }
コード例 #2
0
ファイル: form.php プロジェクト: Navdeep736/regetp01
 /**
  * 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);
 }