Blame view

mobile/source/ext/phptal/PHPTAL/Namespace/Builtin.php 1.04 KB
a1684257   Administrator   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  <?php
  /**
   * PHPTAL templating engine
   *
   * PHP Version 5
   *
   * @category HTML
   * @package  PHPTAL
   * @author   Laurent Bedubourg <lbedubourg@motion-twin.com>
   * @author   Kornel LesiƄski <kornel@aardvarkmedia.co.uk>
   * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
   * @version  SVN: $Id: Builtin.php 614 2009-05-24 01:52:23Z kornel $
   * @link     http://phptal.org/
   */
  
  /**
   * @package PHPTAL
   * @subpackage Namespace
   */
  class PHPTAL_Namespace_Builtin extends PHPTAL_Namespace
  {
      public function createAttributeHandler(PHPTAL_NamespaceAttribute $att, PHPTAL_Dom_Element $tag, $expression)
      {
          $name = $att->getLocalName();
          
          // change define-macro to "define macro" and capitalize words
          $name = str_replace(' ', '', ucwords(strtr($name,'-',' ')));
  
          // case is important when using autoload on case-sensitive filesystems
          $class = 'PHPTAL_Php_Attribute_'.strtoupper($this->getPrefix()).'_'.$name;
          $result = new $class($tag, $expression);
          return $result;
      }
  }