Posted By

daisuke103 on 04/06/09


Tagged

php textmate plugin Smarty array


Versions (?)

PHP Smarty 配列を定義する


 / Published in: Other
 

  1. /**
  2. * assign_array
  3. *
  4. * @param array $value 引数のハッシュ
  5. * @param object &$smarty Smartyオブジェクト
  6. * @return void
  7.  * @usage {assign_array var="fruits" values="apple,banana,orange"}...
  8. */
  9. function smarty_function_assign_array($value, &$smarty)
  10. {
  11. if (!isset($value['var']) || !isset($value['values'])) return;
  12. $separator = (isset($value['separator'])) ? $value['separator'] : ',';
  13. $smarty->assign($value['var'], explode($separator, $value['values']));
  14. }

Report this snippet  

You need to login to post a comment.