public function createAttributeHandler(PHPTAL_NamespaceAttribute $att, PHPTAL_Dom_Element $tag, $expression)
 {
     $name = Inflector::classify($att->getLocalName());
     $class = 'Cake_PHPTAL_Php_Attribute_Cake_' . $name;
     include_once dirname(__FILE__) . DS . $class . '.php';
     $result = new $class($tag, $expression);
     return $result;
 }
Exemple #2
0
 /**
  * Create an instance of a class that can handle processing the supplied attribute.
  *
  * @param PHPTAL_NamespaceAttribute $att        The attribute.
  * @param PHPTAL_Dom_Element        $tag        The element containing the attribute.
  * @param string                    $expression The attribute expression.
  *
  * @return AppLibrary_PHPTAL_Php_Attribute
  */
 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, '-', ' ')));
     $class = '\\Ztal\\Tal\\Php\\Attribute\\' . strtoupper($this->getPrefix()) . '\\' . $name;
     $result = new $class($tag, $expression);
     return $result;
 }
Exemple #3
0
 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;
 }
Exemple #4
0
 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
     if (version_compare(PHP_VERSION, '5.3', '>=') && __NAMESPACE__) {
         $class = 'PHPTALNAMESPACE\\Php\\Attribute\\' . strtoupper($this->getPrefix()) . '\\' . $name;
     } else {
         $class = 'PHPTAL_Php_Attribute_' . strtoupper($this->getPrefix()) . '_' . $name;
     }
     $result = new $class($tag, $expression);
     return $result;
 }
Exemple #5
0
 public function createAttributeHandler(PHPTAL_NamespaceAttribute $att, PHPTAL_Php_Element $tag, $expression)
 {
     $name = $att->getName();
     $name = str_replace('-', '', $name);
     $class = 'PHPTAL_Php_Attribute_' . $this->getName() . '_' . $name;
     $result = new $class();
     $result->tag = $tag;
     $result->name = strtoupper($att->getFullName());
     $result->expression = $expression;
     return $result;
 }
Exemple #6
0
 public function addAttribute(PHPTAL_NamespaceAttribute $attribute)
 {
     $attribute->setNamespace($this);
     $this->_attributes[strtolower($attribute->getLocalName())] = $attribute;
 }