This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

herizo.ludovic16552
herizo.ludovic16552

Hi all, With a home made plugin , i have a special filter to interact with pages. I want to get some page/:slug from php inside Plugin.php but look like there is no way.

This is a standard Plugin filters registered and working correctly . public function registerMarkupTags(){ return [ 'filters' => ['myfunc' => [$this, 'myspecialfilter']]; }

public function myspecialfilter($someparams){ //want to get Slug value here. } Documentation didn't helped me but may be someone already had same problem and have solution to share.

thanks

Last updated

alxy
alxy

You need to pass the slug to the filter. Filters accepts arguments, for more info you can have a look on the official twig docs: http://twig.sensiolabs.org/doc/advanced.html

In your case, you will have to use the filter like this: {{ 'some test'|myfunc(this.param.slug) }}

herizo.ludovic16552
herizo.ludovic16552

Thank you very much i will test that.

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.