Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Parser Package : get parser instance in controller
  • Hey guys,
    there's any method to retrieve the parser instance into controller?? That can be useful if a user would load parser extensions from a controller
  • What is the definition of a parser instance? Every parser view instance has a public method called parser(), which will return the parser object. It that what you're looking for?
  • Yes but, I would permit to load a set of parser extensions from a controller without specifying a view template. Like this :
    class Controller_Admin extends Controller {
    
       public function before()
       {  
          // Load Parser extensions
          $twig = View::instance();  // instance method obviously doesn't exists, is an example
      
          include_once APPPATH.'vendor/Twig_ext/operators/concat.php';
          $twig->addExtension(new \Concat_Twig_Extension());
          ...
       }
    
    }
    
  • Please add this as a feature request on http://github.com/fuel/parser/issues
  • Done ... thank you. After that feature, all parser driver ( smarty, dwoo, ... ) can support extensions ... and that is cool!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion