File: lib/plugins/block.capture.php

Recommend this page to a friend!
  Classes of David Tamas  >  g-template-php  >  lib/plugins/block.capture.php  >  Download  
File: lib/plugins/block.capture.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: 2 years ago
Size: 887 bytes
 

 

Contents

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

/**
 * gTemplate {capture}{/capture} block plugin
 *
 * Type: block function<br>
 * Name: capture<br>
 * Purpose: removes content and stores it in a variable<br>
 *
 * @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
 *
 * @internal Some source codes are taken from Smarty
 * @internal author Monte Ohrt <monte at ohrt dot com>
 * @internal link http://smarty.net Smarty
 */
function tpl_block_capture($params, $content, &$gTpl) {
   
extract($params);

    if (isset(
$name)) {
       
$buffer = $name;
    } else {
       
$buffer = "'default'";
    }

   
$gTpl->_vars['capture'][$buffer] = $content;
    if (isset(
$assign)) {
       
$gTpl->assign($assign, $content);
    }
    return;
}


For more information send a message to info at phpclasses dot org.