HTML_Template_Flexy
[ class tree: HTML_Template_Flexy ] [ index: HTML_Template_Flexy ] [ all elements ]

Source for file Compiler.php

Documentation is available at Compiler.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2002 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.02 of the PHP license,      |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Alan Knowles <alan@akbkhome.com>                            |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: Compiler.php,v 1.5 2004/03/24 15:12:11 alan_k Exp $
  20. //
  21. //  Base Compiler Class (Interface)
  22. //
  23.  
  24. /**
  25. * Compiler Globals go here..
  26. * public (to it's children)
  27. *
  28. @var array 
  29. @access public (to it's children)
  30. */
  31.  
  32. $GLOBAL['_HTML_TEMPLATE_FLEXY_COMPILER'= array();
  33.  
  34.  
  35. class HTML_Template_Flexy_Compiler {
  36.  
  37.         
  38.     /**
  39.     * Options
  40.     *
  41.     * @var array 
  42.     * @access public
  43.     */
  44.     var $options;
  45.     
  46.     /**
  47.     * Factory constructor
  48.     * 
  49.     * @param   array    options     only ['compiler']  is used directly
  50.     *
  51.     * @return   object    The Compiler Object
  52.     * @access   public
  53.     */
  54.     function factory($options
  55.     {
  56.         if (empty($options['compiler'])) {
  57.             $options['compiler''Standard';
  58.         }
  59.     
  60.         require_once 'HTML/Template/Flexy/Compiler/'.ucfirst$options['compiler'.'.php';
  61.         $class 'HTML_Template_Flexy_Compiler_'.$options['compiler'];
  62.         $ret = new $class;
  63.         $ret->options = $options;
  64.         return $ret;
  65.     }
  66.     
  67.     
  68.     /**
  69.     * The compile method.
  70.     *
  71.     * @param object HTML_Template_Flexy that is requesting the compile
  72.     * @return   object  HTML_Template_Flexy 
  73.     * @return   string   to compile (if not using a file as the source)
  74.     * @access   public
  75.     */
  76.     function compile(&$flexy,$string = false
  77.     {
  78.         echo "No compiler implemented!";
  79.     }
  80.      
  81.     /**
  82.     * Append HTML to compiled ouput
  83.     * These are hooks for passing data to other processes
  84.     *
  85.     * @param   string to append to compiled
  86.     * 
  87.     * @return   string to be output
  88.     * @access   public
  89.     */
  90.     function appendHtml($string
  91.     {
  92.       
  93.         return $string;
  94.     }
  95.     /**
  96.     * Append PHP Code to compiled ouput
  97.     * These are hooks for passing data to other processes
  98.     *
  99.     * @param   string PHP code to append to compiled
  100.     *
  101.     * @return   string to be output
  102.     * @access   public
  103.     */
  104.     
  105.     function appendPhp($string
  106.     {
  107.         
  108.         return '<?php '.$string.'?>';
  109.     }
  110.     
  111.     
  112.     
  113.  
  114. }

Documentation generated on Mon, 11 Mar 2019 10:15:14 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.