<?php
namespace Parser;
use Twig_Extension;
use Twig_Function_Function;
use Twig_Function_Method;
/**
* Nevermind the bullsh*t in there, it's just a test.
*/
class Twig_Tom_Extension extends Twig_Extension
{
/**
* Gets the name of the extension.
*
* @return string
*/
public function getName()
{
return 'tom';
}
/**
* Sets up all of the functions this extension makes available.
*
* @return array
*/
public function getFunctions()
{
return array(
'myfilter' => new Twig_Function_Method($this, 'myfilterfunction')
);
}
public function myfilterfunction($s)
{
return md5($s);
}
}
'View_Twig' => array(
'include' => APPPATH.'vendor'.DS.'Twig'.DS.'Autoloader.php',
'auto_encode' => true,
'views_paths' => array(APPPATH.'views'),
'delimiters' => array(
'tag_block' => array('left' => '{%', 'right' => '%}'),
'tag_comment' => array('left' => '{#', 'right' => '#}'),
'tag_variable' => array('left' => '{{', 'right' => '}}'),
),
'environment' => array(
'debug' => false,
'charset' => 'utf-8',
'base_template_class' => 'Twig_Template',
'cache' => APPPATH.'cache'.DS.'twig'.DS,
'auto_reload' => true,
'strict_variables' => false,
'autoescape' => false,
'optimizations' => -1,
),
'extensions' => array(
'Twig_Fuel_Extension',
'Twig_Tom_Extension'
),
),
ErrorException [ Error ]: Class 'Twig_Extension' not found
It looks like you're new here. If you want to get involved, click one of these buttons!