當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FormHelper::to_text_area_tag方法代碼示例

本文整理匯總了PHP中FormHelper::to_text_area_tag方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormHelper::to_text_area_tag方法的具體用法?PHP FormHelper::to_text_area_tag怎麽用?PHP FormHelper::to_text_area_tag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FormHelper的用法示例。


在下文中一共展示了FormHelper::to_text_area_tag方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: text_area

/**
 *  Example: text_area("post", "body", array("cols" => 20, "rows" => 40));
 *  Result: <textarea cols="20" rows="40" id="post_body" name="post[body]">$post->body</textarea>
 *  @uses FormHelper::to_text_area_tag()
 */
function text_area($object, $field, $options = array())
{
    $form = new FormHelper($object, $field);
    return $form->to_text_area_tag($options);
}
開發者ID:phpontrax,項目名稱:trax,代碼行數:10,代碼來源:form_helper.php

示例2: array

 /**
  *  @todo Document this method
  *
  *  @param string object_name    Name of an ActiveRecord subclass
  *  @param string attribute_name Name of an attribute of $object_name
  *  @param string[] options
  *  @uses attribute_name
  *  @uses column_type()
  *  @uses error_wrapping()
  *  @uses object_name
  *  @uses DateHelper::to_date_select_tag()
  *  @uses FormHelper::to_boolean_select_tag()
  *  @uses FormHelper::to_input_field_tag()
  *  @uses FormHelper::to_text_area_tag()
  *  @uses to_datetime_select_tag()
  *  @uses object()
  */
 function to_tag($object_name, $attribute_name, $options = array())
 {
     $this->object_name = $object_name;
     $this->attribute_name = $attribute_name;
     $form = new FormHelper($object_name, $attribute_name);
     switch ($this->column_type()) {
         case 'string':
         case 'varchar':
         case 'varchar2':
             $field_type = preg_match("/password/i", $this->attribute_name) ? "password" : "text";
             $results = $form->to_input_field_tag($field_type, $options);
             break;
         case 'text':
         case 'blob':
             $results = $form->to_text_area_tag($options);
             break;
         case 'integer':
         case 'int':
         case 'number':
         case 'float':
         case 'real':
             $results = $form->to_input_field_tag("text", $options);
             break;
         case 'date':
             $form = new DateHelper($object_name, $attribute_name);
             $results = $form->to_date_select_tag($options);
             break;
         case 'datetime':
         case 'timestamp':
             $results = $this->to_datetime_select_tag($options);
             break;
         case 'boolean':
         case 'bool':
             $results = $form->to_boolean_select_tag($options);
             break;
     }
     if (count($this->object()->errors)) {
         $results = $this->error_wrapping($results, $this->object()->errors[$this->attribute_name]);
     }
     return $results;
 }
開發者ID:phpontrax,項目名稱:trax,代碼行數:58,代碼來源:active_record_helper.php


注:本文中的FormHelper::to_text_area_tag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。