Source for file function.form_name.php

Documentation is available at function.form_name.php

  1. <?php
  2. /**
  3.  *  smarty function:フォーム表示名生成
  4.  *
  5.  *  @param  string  $name   フォーム項目名
  6.  */
  7. function smarty_function_form_name($params&$smarty)
  8. {
  9.     // name
  10.     if (isset($params['name'])) {
  11.         $name $params['name'];
  12.         unset($params['name']);
  13.     else {
  14.         return null;
  15.     }
  16.  
  17.     // view object
  18.     $c Ethna_Controller::getInstance();
  19.     $view $c->getView();
  20.     if ($view === null{
  21.         return null;
  22.     }
  23.  
  24.     // action
  25.     $action null;
  26.     if (isset($params['action'])) {
  27.         $action $params['action'];
  28.         unset($params['action']);
  29.     else {
  30.         for ($i count($smarty->_tag_stack)$i >= 0--$i{
  31.             if ($smarty->_tag_stack[$i][0=== 'form'{
  32.                 if (isset($smarty->_tag_stack[$i][1]['ethna_action'])) {
  33.                     $action $smarty->_tag_stack[$i][1]['ethna_action'];
  34.                 }
  35.                 break;
  36.             }
  37.         }
  38.     }
  39.     if ($action !== null{
  40.         $view->addActionFormHelper($action);
  41.     }
  42.  
  43.     return $view->getFormName($name$action$params);
  44. }

Documentation generated on Fri, 11 Nov 2011 03:58:09 +0900 by phpDocumentor 1.4.3