Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when extending tag #46

Open
hakimihamdan88 opened this issue Jun 3, 2017 · 1 comment
Open

Error when extending tag #46

hakimihamdan88 opened this issue Jun 3, 2017 · 1 comment

Comments

@hakimihamdan88
Copy link

tried this but return error, can you confirm LiquidBlock class?

class LiquidTagNodisplay extends LiquidBlock
{
    public function render(&$context)
    {
        return '';
    }
}
$text = " {% nodisplay %} don't show me! {% endnodisplay %} ";
$liquid = new LiquidTemplate();
$liquid->registerTag('nodisplay', 'LiquidTagNodisplay');
$liquid->parse($text);
echo $liquid->render();  // => ""
@kubk
Copy link

kubk commented Oct 19, 2017

This example from wiki is outdated. Here is the working example of nodisplay: https://github.com/harrydeluxe/php-liquid/blob/master/src/Liquid/Tag/TagComment.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants