public function createFiltersMethods(array $names, $variable)
    {
        if($names === array())
        {
            return $variable;
        }

        $filter = array_shift($names);

        if($filter === 'raw')
        {
            $result = $this->createFiltersMethods($names, $variable);
        }
        else
        {
            $begin = '';
            $end   = '';

            if(function_exists($filter))
            {
                $begin = "{$filter}(";
            }
            else
            {
                $begin = "\$env->filter('{$filter}', ";
            }

            $result = $begin.$this->createFiltersMethods($names, $variable).')';
        }

        return $result;
    }
public function createFiltersMethods(array $names, $variable)
    {
        if($names === array())
        {
            return $variable;
        }

        $filter = array_shift($names);

        if($filter === 'raw')
        {
            $result = $this->createFiltersMethods($names, $variable);
        }
        else
        {
            $begin = '';
            $end   = '';

            if(function_exists($filter))
            {
                $begin = "{$filter}(";
            }
            else
            {
                $begin = "\$env->filter('{$filter}', ";
            }

            $result = $begin.$this->createFiltersMethods($names, $variable).')';
        }

        return $result;
    }
public function createFiltersMethods ( array $ names , $ variable ) { if ( $ names === array ( ) ) { return $ variable ; } $ filter = array_shift ( $ names ) ; if ( $ filter === 'raw' ) { $ result = $ this -> createFiltersMethods ( $ names , $ variable ) ; } else { $ begin = '' ; $ end = '' ; if ( function_exists ( $ filter ) ) { $ begin = "{$filter}(" ; } else { $ begin = "\$env->filter('{$filter}', " ; } $ result = $ begin . $ this -> createFiltersMethods ( $ names , $ variable ) . ')' ; } return $ result ; }
Creates filters methods for varible.

@param  array  $names    Array of filters to apply.
@param  string $variable Variable name for filtering.
@return string
Creates filters methods for varible .