Changeset 28703 for trunk/include/template.class.php
- Timestamp:
- Jun 14, 2014, 4:15:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r28600 r28703 122 122 $this->smarty->registerPlugin('modifiercompiler', 'translate_dec', array('Template', 'modcompiler_translate_dec') ); 123 123 $this->smarty->registerPlugin('modifier', 'explode', array('Template', 'mod_explode') ); 124 $this->smarty->registerPlugin('modifier', 'ternary', array('Template', 'mod_ternary') ); 124 125 $this->smarty->registerPlugin('modifier', 'get_extent', array($this, 'get_extent') ); 125 126 $this->smarty->registerPlugin('block', 'html_head', array($this, 'block_html_head') ); … … 666 667 * "explode" variable modifier. 667 668 * Usage : 668 * - {assign var=valueExploded value=$value| @explode:','}669 * - {assign var=valueExploded value=$value|explode:','} 669 670 * 670 671 * @param string $text … … 675 676 { 676 677 return explode($delimiter, $text); 678 } 679 680 /** 681 * ternary variable modifier. 682 * Usage : 683 * - {$variable|ternary:'yes':'no'} 684 * 685 * @param mixed $param 686 * @param mixed $true 687 * @param mixed $false 688 * @return mixed 689 */ 690 static function mod_ternary($param, $true, $false) 691 { 692 return $param ? $true : $false; 677 693 } 678 694
Note: See TracChangeset
for help on using the changeset viewer.