php-liquid
php-liquid copied to clipboard
Error when extending tag
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(); // => ""
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