Twig_Environment PHP Class Code Examples

This page contains top rated real world PHP examples of class Twig_Environment extracted from open source projects. You can rate examples to help us improve the quality of examples

Example #1
Show file File: a0b99d5e172cc3229f4e0bb0e87b96c3c3f6f8da82a1df30098da34dd408d39a.php Project: raphydev/onep
1
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("@WebProfiler/Profiler/layout.html.twig", "@WebProfiler/Collector/ajax.html.twig", 1);
     $this->blocks = array('toolbar' => array($this, 'block_toolbar'));
 }
Example #2
Show file File: Fuel_twig_parser.php Project: huayuxian/FUEL-CMS
0
 /**
  * Spawns a new instance of Twig.
  *
  * @return object
  **/
 protected function spawn()
 {
     // register the Twig autoloader.
     Twig_Autoloader::register();
     // Init the Twig loader.
     $loader = new Twig_Loader_String();
     // check if the cache dir is set.
     if ($this->compile_dir) {
         if (is_null($this->debug)) {
             $this->debug = is_dev_mode();
         }
         $twig = new Twig_Environment($loader, array('autoescape' => FALSE, 'cache' => $this->compile_dir, 'debug' => $this->debug, 'charset' => $this->charset, 'base_template_class' => $this->base_template_class, 'strict_variables' => $this->strict_variables, 'autoescape' => $this->autoescape, 'optimizations' => $this->optimizations));
     } else {
         $twig = new Twig_Environment($loader, array('autoescape' => FALSE));
     }
     // init all functions as Twig functions.
     foreach ($this->allowed_functions as $function) {
         $twig->addFunction($function, new Twig_Function_Function($function));
     }
     // setup debugger
     $twig->addExtension(new Twig_Extension_Debug());
     // setup the Lexer
     $lexer = new Twig_Lexer($twig, $this->delimiters);
     $twig->setLexer($lexer);
     // finally, return the object.
     return $twig;
 }
Example #3
Show file File: e5c1fa41102afdb1873b48d0a9ea6267f93fd89d365c6e2e625ac2514b1f192e.php Project: LamaDelRay/test_symf
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("FOSUserBundle::layout.html.twig", "FOSUserBundle:Group:edit.html.twig", 1);
     $this->blocks = array('fos_user_content' => array($this, 'block_fos_user_content'));
 }
Example #4
Show file File: ec8a343dc2cc4700fd854eef51b95e9f181e94c582150b5a952b65aaa019884f.php Project: Dren-x/mobitnew
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("base.html.twig", "blog/index.html.twig", 1);
     $this->blocks = array('body_id' => array($this, 'block_body_id'), 'main' => array($this, 'block_main'), 'sidebar' => array($this, 'block_sidebar'));
 }
Example #5
Show file File: 8227f3957f19339a5ce375bbe63017b1f68a656bdbcb2f485e7ababbf8197021.php Project: RuntyCybin/CProject
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("@WebProfiler/Profiler/layout.html.twig", "@WebProfiler/Collector/form.html.twig", 1);
     $this->blocks = array('toolbar' => array($this, 'block_toolbar'), 'menu' => array($this, 'block_menu'), 'head' => array($this, 'block_head'), 'panel' => array($this, 'block_panel'));
 }
Example #6
Show file File: 87ec0a1e234c8548ef2488bbdb0e312304c02e04aa2c760eb57304cb1f3997ae.php Project: CharuniKaushalya/Database-Project
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("base.html.twig", "childrenofotoeos/edit.html.twig", 1);
     $this->blocks = array('body' => array($this, 'block_body'));
 }
Example #7
Show file File: 82bf9060026b41e452330cfc24d37c25c316e055316dbb8dab75c50f5505f6e3.php Project: MikeVeerman/symf2tut
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("@WebProfiler/Profiler/layout.html.twig", "WebProfilerBundle:Collector:request.html.twig", 1);
     $this->blocks = array('toolbar' => array($this, 'block_toolbar'), 'menu' => array($this, 'block_menu'), 'panel' => array($this, 'block_panel'));
 }
Example #8
Show file File: 71458703d8d7ebadd72aba1fde61c0a967ed57ada620f14bb86942cd1d2d03c6.php Project: mshishkov/santanno
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("@WebProfiler/Profiler/layout.html.twig", "@Security/Collector/security.html.twig", 1);
     $this->blocks = array('page_title' => array($this, 'block_page_title'), 'toolbar' => array($this, 'block_toolbar'), 'menu' => array($this, 'block_menu'), 'panel' => array($this, 'block_panel'));
 }
Example #9
Show file File: 982275bf3c0c46c01c39ebeb929ab11b13a0d60fc7ddd76d9358253319f47a2f.php Project: Dren-x/mobit
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("@WebProfiler/Profiler/layout.html.twig", "@WebProfiler/Collector/time.html.twig", 1);
     $this->blocks = array('toolbar' => array($this, 'block_toolbar'), 'menu' => array($this, 'block_menu'), 'panel' => array($this, 'block_panel'), 'panelContent' => array($this, 'block_panelContent'));
 }
Example #10
Show file File: b0fc1b00d79acaf6b323ed6068be69780cde72b73169bfc849cffc7fce8eace2.php Project: shine2lay/jack
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("base.html.twig", "home.html.twig", 1);
     $this->blocks = array('title' => array($this, 'block_title'), 'body' => array($this, 'block_body'));
 }
Example #11
Show file File: 0dc366914a910d6a5d8cda0352e8292a119437d408550893d046ca898f1eed3f.php Project: MathieuThauvin/NDL
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("@WebProfiler/Profiler/layout.html.twig", "@Swiftmailer/Collector/swiftmailer.html.twig", 1);
     $this->blocks = array('toolbar' => array($this, 'block_toolbar'), 'menu' => array($this, 'block_menu'), 'panel' => array($this, 'block_panel'));
 }
Example #12
Show file File: NameTest.php Project: HeroesOfZoltan/wishr
0
 public function getTests()
 {
     $node = new Twig_Node_Expression_Name('foo', 1);
     $context = new Twig_Node_Expression_Name('_context', 1);
     $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => true));
     $env1 = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => false));
     return array(array($node, "// line 1\n" . (PHP_VERSION_ID >= 50400 ? '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))' : '$this->getContext($context, "foo")'), $env), array($node, $this->getVariableGetter('foo', 1), $env1), array($context, "// line 1\n\$context"));
 }
Example #13
Show file File: 39fe22556a7c5a83be0e3387ebbeceb84bbbd0bf7d1fd788c1331697a302ae34.php Project: stuckiest/SymfonyBlog
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("@WebProfiler/Profiler/layout.html.twig", "WebProfilerBundle:Profiler:results.html.twig", 1);
     $this->blocks = array('summary' => array($this, 'block_summary'), 'panel' => array($this, 'block_panel'));
 }
Example #14
Show file File: 16d70472ac29c6169e7364b9b6967ec52d889e729b5f9f09cf97c9b719ddae28.php Project: tsurune/Pruebas
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("FOSUserBundle::layout.html.twig", "FOSUserBundle:Resetting:passwordAlreadyRequested.html.twig", 1);
     $this->blocks = array('fos_user_content' => array($this, 'block_fos_user_content'));
 }
Example #15
Show file File: 596f0a1f5ac90be90b39376884f6f00c0b8cc8c129ce175b3c6ac65138242be0.php Project: CharuniKaushalya/Database-Project
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("base.html.twig", "applicant/index2.html.twig", 1);
     $this->blocks = array('body' => array($this, 'block_body'));
 }
Example #16
Show file File: Controlador.php Project: Didweb/MyTDisco
0
 public function cargaTwig($path)
 {
     if ($_SERVER['HTTP_HOST'] == 'localhost') {
         $loader = new Twig_Loader_Filesystem($path);
         $twig = new Twig_Environment($loader, array('cache' => __DIR__ . '/cache', 'debug' => true));
     } else {
         $loader = new Twig_Loader_Filesystem($path);
         $twig = new Twig_Environment($loader, array('cache' => __DIR__ . '/cache', 'debug' => false));
     }
     $twig->addGlobal("session", $_SESSION);
     $this->twig = $twig;
     return $this->twig;
 }
Example #17
Show file File: applyfilterextension.php Project: NaszvadiG/kiss-manage
0
 public function applyFilter(Twig_Environment $env, $context = array(), $value, $filters)
 {
     $old_env = $env->getLoader();
     $env = new Twig_Environment(new Twig_Loader_String(), array('cache' => false, 'autoescape' => false));
     $name = 'apply_filter_' . md5($filters);
     $template = sprintf('{{ %s|%s }}', $name, $filters);
     $template = $env->loadTemplate($template);
     $context[$name] = $value;
     $finale = $template->render($context);
     $env = $env->setLoader($old_env);
     return $finale;
 }
Example #18
Show file File: NameTest.php Project: shomimn/builder
0
 public function getTests()
 {
     $node = new Twig_Node_Expression_Name('foo', 1);
     $self = new Twig_Node_Expression_Name('_self', 1);
     $context = new Twig_Node_Expression_Name('_context', 1);
     $env = new Twig_Environment(null, array('strict_variables' => true));
     $env1 = new Twig_Environment(null, array('strict_variables' => false));
     return array(version_compare(PHP_VERSION, '5.4.0') >= 0 ? array($node, '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))', $env) : array($node, '$this->getContext($context, "foo")', $env), array($node, $this->getVariableGetter('foo'), $env1), array($self, '$this'), array($context, '$context'));
 }
Example #19
Show file File: NameTest.php Project: jothatron/xvwa
0
 public function getTests()
 {
     $node = new Twig_Node_Expression_Name('foo', 1);
     $self = new Twig_Node_Expression_Name('_self', 1);
     $context = new Twig_Node_Expression_Name('_context', 1);
     $env = new Twig_Environment(null, array('strict_variables' => true));
     $env1 = new Twig_Environment(null, array('strict_variables' => false));
     return array(array($node, "// line 1\n" . (PHP_VERSION_ID >= 50400 ? '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))' : '$this->getContext($context, "foo")'), $env), array($node, $this->getVariableGetter('foo', 1), $env1), array($self, "// line 1\n\$this"), array($context, "// line 1\n\$context"));
 }
Example #20
Show file File: NameTest.php Project: tahermarkos/Transport
0
 public function getTests()
 {
     $node = new Twig_Node_Expression_Name('foo', 1);
     $self = new Twig_Node_Expression_Name('_self', 1);
     $context = new Twig_Node_Expression_Name('_context', 1);
     $env = new Twig_Environment(null, array('strict_variables' => true));
     $env1 = new Twig_Environment(null, array('strict_variables' => false));
     return array(array($node, "// line 1\n" . (version_compare(PHP_VERSION, '5.4.0') >= 0 ? '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))' : '$this->getContext($context, "foo")'), $env), array($node, $this->getVariableGetter('foo', 1), $env1), array($self, "// line 1\n\$this"), array($context, "// line 1\n\$context"));
 }
Example #21
Show file File: NameTest.php Project: PieterSwitten/webandmobile
0
 public function getTests()
 {
     $node = new Twig_Node_Expression_Name('foo', 1);
     $context = new Twig_Node_Expression_Name('_context', 1);
     $env = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => true));
     $env1 = new Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => false));
     return array(array($node, "// line 1\n" . '(isset($context["foo"]) || array_key_exists("foo", $context) ? $context["foo"] : $this->notFound("foo", 1))', $env), array($node, $this->getVariableGetter('foo', 1), $env1), array($context, "// line 1\n\$context"));
 }
Example #22
Show file File: 29fc25868eeeb7615ab16174079dd604d6d2cf9942d01cc4f7dc3119d9661129.php Project: tsurune/Pruebas
0
 public function __construct(Twig_Environment $env)
 {
     parent::__construct($env);
     // line 1
     $this->parent = $this->loadTemplate("@WebProfiler/Profiler/layout.html.twig", "WebProfilerBundle:Collector:translation.html.twig", 1);
     $this->blocks = array('toolbar' => array($this, 'block_toolbar'), 'menu' => array($this, 'block_menu'), 'panel' => array($this, 'block_panel'), 'panelContent' => array($this, 'block_panelContent'));
 }