code/libraries/joomlatools/library/template/template.php
public function addFilter($filter, $config = array())
    {
        //Create the complete identifier if a partial identifier was passed
        if (is_string($filter) && strpos($filter, '.') === false)
        {
            $identifier = $this->getIdentifier()->toArray();
            $identifier['path'] = array('template', 'filter');
            $identifier['name'] = $filter;

            $identifier = $this->getIdentifier($identifier);
        }
        else $identifier = $this->getIdentifier($filter);

        if (!$this->hasFilter($identifier->name))
        {
            $filter = $this->getObject($identifier, array_merge($config, array('template' => $this)));

            if (!($filter instanceof KTemplateFilterInterface))
            {
                throw new UnexpectedValueException(
                    "Template filter $identifier does not implement KTemplateFilterInterface"
                );
            }

            //Store the filter
            $this->__filters[$filter->getIdentifier()->name] = $filter;

            //Enqueue the filter
            $this->__filter_queue->enqueue($filter, $filter->getPriority());
        }

        return $this;
    }
public function addFilter($filter, $config = array())
    {
        //Create the complete identifier if a partial identifier was passed
        if (is_string($filter) && strpos($filter, '.') === false)
        {
            $identifier = $this->getIdentifier()->toArray();
            $identifier['path'] = array('template', 'filter');
            $identifier['name'] = $filter;

            $identifier = $this->getIdentifier($identifier);
        }
        else $identifier = $this->getIdentifier($filter);

        if (!$this->hasFilter($identifier->name))
        {
            $filter = $this->getObject($identifier, array_merge($config, array('template' => $this)));

            if (!($filter instanceof KTemplateFilterInterface))
            {
                throw new UnexpectedValueException(
                    "Template filter $identifier does not implement KTemplateFilterInterface"
                );
            }

            //Store the filter
            $this->__filters[$filter->getIdentifier()->name] = $filter;

            //Enqueue the filter
            $this->__filter_queue->enqueue($filter, $filter->getPriority());
        }

        return $this;
    }
public function addFilter ( $ filter , $ config = array ( ) ) { //Create the complete identifier if a partial identifier was passed if ( is_string ( $ filter ) && strpos ( $ filter , '.' ) === false ) { $ identifier = $ this -> getIdentifier ( ) -> toArray ( ) ; $ identifier [ 'path' ] = array ( 'template' , 'filter' ) ; $ identifier [ 'name' ] = $ filter ; $ identifier = $ this -> getIdentifier ( $ identifier ) ; } else $ identifier = $ this -> getIdentifier ( $ filter ) ; if ( ! $ this -> hasFilter ( $ identifier -> name ) ) { $ filter = $ this -> getObject ( $ identifier , array_merge ( $ config , array ( 'template' => $ this ) ) ) ; if ( ! ( $ filter instanceof KTemplateFilterInterface ) ) { throw new UnexpectedValueException ( "Template filter $identifier does not implement KTemplateFilterInterface" ) ; } //Store the filter $ this -> __filters [ $ filter -> getIdentifier ( ) -> name ] = $ filter ; //Enqueue the filter $ this -> __filter_queue -> enqueue ( $ filter , $ filter -> getPriority ( ) ) ; } return $ this ; }
Attach a filter for template transformation

@param   mixed $filter An object that implements ObjectInterface, ObjectIdentifier object
or valid identifier string
@param   array $config An optional associative array of configuration settings
@throws UnexpectedValueException
@return KTemplateAbstract
Attach a filter for template transformation