PHP Classes

File: lib/plugins/inlinemodifier.cat.php

Recommend this page to a friend!
  Classes of David Tamas   g-template-php   lib/plugins/inlinemodifier.cat.php   Download  
File: lib/plugins/inlinemodifier.cat.php
Role: Example script
Content type: text/plain
Description: Example script
Class: g-template-php
Process and render templates generating PHP code
Author: By
Last change:
Date: 5 years ago
Size: 688 bytes
 

Contents

Class file image Download
<?php
/**
 * gTemplate Plugins
 *
 * @package gTemplate
 * @subpackage Plugins
 */

/**
 * gTemplate cat modifier plugin
 *
 * Type: inlinemodifier<br>
 * Name: cat<br>
 * Purpose: catenate a value to a variable<br>
 * Example: {$var|cat:"foo"}
 *
 * @version 1.0
 * @author Tamas David (G-Lex) <glex at mittudomain.info>
 * @link https://github.com/glex86/g-template-php G-Template Engine on Github
 */
function tpl_inlinemodifier_cat($variable, $arguments, &$gTpl)
{
    if (!
$arguments[0]) {
       
$gTpl->trigger_error("[SYNTAX] 'cat' modifier requires one parameter", E_USER_NOTICE, $object->_file, $object->_linenum);
    }
    return
$variable .'.'.$arguments[0];
}