Example #1
0
 /**
  * カレンダーコントロール付きのテキストフィールド
  * jquery-ui-1.7.2 必須
  * 
  * @param string $fieldName フィールド文字列
  * @param array $attributes HTML属性
  * @return string html
  * @access public
  */
 public function datepicker($fieldName, $attributes = array())
 {
     if ($this->freezed) {
         list($model, $field) = explode('.', $fieldName);
         if (isset($attributes)) {
             $attributes = am($attributes, array('type' => 'hidden'));
         } else {
             $attributes = array('type' => 'hidden');
         }
         if (!empty($this->request->data[$model][$field])) {
             $value = date('Y/m/d', strtotime($this->request->data[$model][$field]));
         } else {
             $value = "";
         }
         return parent::text($fieldName, $attributes) . $value;
     } else {
         return parent::datepicker($fieldName, $attributes);
     }
 }