Source for file modifier.form_value.php

Documentation is available at modifier.form_value.php

  1. <?php
  2. /**
  3.  *  smarty modifier:フォーム値出力フィルタ
  4.  *
  5.  *  フォーム名を変数で指定してフォーム値を取得したい場合に使用する
  6.  *
  7.  *  sample:
  8.  *  <code>
  9.  *  $this->af->set('foo', 'bar');
  10.  *  $smarty->assign('key', 'foo');
  11.  *  {$key|form_value}
  12.  *  </code>
  13.  *  <code>
  14.  *  bar
  15.  *  </code>
  16.  *
  17.  *  @param  string  $string フォーム項目名
  18.  *  @return string  フォーム値
  19.  */
  20. function smarty_modifier_form_value($string)
  21. {
  22.     $c Ethna_Controller::getInstance();
  23.     $af $c->getActionForm();
  24.  
  25.     $elts explode("."$string);
  26.     $r $af->get($elts[0]);
  27.     for ($i 1$i count($elts)$i++{
  28.         $r $r[$elts[$i]];
  29.     }
  30.  
  31.     return htmlspecialchars($rENT_QUOTES);
  32. }

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