Closed bricebou closed 6 years ago
You're using the DummyPlugin
as of Pico 1.0, not of Pico 2.0.
Yeah, I figure that out... I should use the onTemplateRendered with the &output variable?
-- Brice Boucard
Le 28 juin 2018 à 16:19, Daniel Rudolf notifications@github.com a écrit :
You're using the DummyPlugin as of Pico 1.0, not of Pico 2.0.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
For what? Registering a Twig function? No. You can access $twig
using the onTwigRegistered
event.
I'll give it a try ! But I don't understand... I'm a bit frustrated, cause I launched the search Twig_Environment
on this repo and this function didn't appear... (https://github.com/picocms/Pico/search?q=Twig_Environment&unscoped_q=Twig_Environment)
Sorry, and many thanks !
GitHub's web search only searches in the repo's default branch (the master
branch), and since Pico 2.0 is still in beta, you will therefore search in the source code of Pico 1.0. I'm not sure why you even want to use GitHub's web search, it's so inflexible... Simply search your local files or, even better, check your local plugins/DummyPlugin.php
directly.
I wanted to make sure I wasn't missing anything... :-(
Again, so sorry for all the noise I make...
Time to play with Twig filters and functions... Thanks again !
Hi, again...
I'm really sorry, you know. I try, I read, I search but I can't figure out some things...
I'd like to declare some personal Twig filters or functions and I tried to reproduce https://github.com/picocms/Pico/issues/424.
In a copy of the DummyPlugin.php, just to make sure the issue wasn't due to something else, I have exactly this:
But I have a PHP fatal error:
I've tried to look the Pico source code but I don't understand much. I've seen a PicoTwigExtension class which structure I tried to copy but filters and functions were not recognized...
Thanks in advance :)