Plenty Parser (Driver Based Template Library, Supports Smarty and Twig Rendering) |
[eluser]Vheissu[/eluser]
I'm at it again. I've developed a driver based parser library using Codeigniter drivers. It comes with a Smarty and Twig driver and I've tested it and everything works as it should. There's a readme on the repo, but it's not that hard if you look at the code though. Get it from the Github repo here: https://github.com/Vheissu/Plenty-Parser Features: * Driver based * Comes with a Smarty and Twig drivers to render your templates * Does not override in-built view or parser functionality. * So easy to use * Requires little configuration to get it working, even a beginner Codeigniter developer could use this Coming soon: * More drivers * A lightweight theming library to work side-by-side with Plenty Parser. * Examples * Documentation Default usage: In your controller you load the drivers $this->load->driver('pp'); without any configuration you will now be able to render templates via, $this->pp->parse('templatename', $data); If you want to use additional drivers without having to set it as a default driver you can go $this->pp->drivername->parse('templatename', $data); so for Twig you would go: $this->pp->twig->parse('templatename', $data);
[eluser]Vheissu[/eluser]
There have been a few updates to this library since I first posted the thread. Has anyone checked it out? Constructive feedback?
[eluser]suntrop[/eluser]
I am trying to use the driver (with smarty). I'have uploaded the 4 folders and put in my controller … $this->load->driver('plenty_parser'); $this->plenty_parser->parse('home_view'); I get this error message "Unable to load the requested driver: Plenty_parser_smarty". What's wrong?
[eluser]Vheissu[/eluser]
I know this is a super late reply, but yes there is a way to use Codeigniter helper functions in your templates. You can register their use via the register_plugin function in the Smarty or Twig driver. The Smarty driver should automatically include in-built Codeigniter helper functions from both the system and application helper directories, the Twig driver will shortly as well. I've just made a slew of updates to the library as well, the Twig and Smarty drivers are compatible with the latest version of Codeigniter. I shorted the driver name from plenty_parser to be just pp. So you go $this->load->driver('pp') and use it like this: $this->pp->parse(), or $this->pp->twig->parse() and so on. |
Welcome Guest, Not a member yet? Register Sign In |