Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Editing modifierdefault changes nothing, it's like magic

 
Post new topic   Reply to topic    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
pedrotester
Smarty Regular


Joined: 06 Jun 2019
Posts: 36

PostPosted: Thu Mar 11, 2021 10:42 pm    Post subject: Editing modifierdefault changes nothing, it's like magic Reply with quote

Hello,

Why when I edit this plugin, it does nothing at all: modifiercompiler.default.php

I change the last line to:
Code:
    return $output . "lllllllllllllllllll";


Then in my tpl I use {$test|default:"hoho"}

Result: "hoho" is displayed, and not "hohollllllllllllllllllllllllll"


I tried to delete the entire code from the plugin too, and same result, no error...

Note: I'm trying to understand why I have the same issue as this guy https://www.smarty.net/forums/viewtopic.php?t=19439 and can't figure it out, that's why I'm testing all of this. EDIT: i found the solution, it's because i use a custom error handler which doesn't verify if the @$var must be ignored or not cf: https://stackoverflow.com/questions/6610441/error-control-operator-not-working


Last edited by pedrotester on Thu Mar 11, 2021 11:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
pedrotester
Smarty Regular


Joined: 06 Jun 2019
Posts: 36

PostPosted: Thu Mar 11, 2021 11:10 pm    Post subject: Reply with quote

Ok, I think I figured it out, it's because I have to delete the "compile" directory first (the previously compiled tpl)

But then, how to force recompiling each time I load the page?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1719

PostPosted: Wed Mar 17, 2021 12:20 pm    Post subject: Reply with quote

Read the documentation?
Code:
$smarty->setForceCompile(true);
Back to top
View user's profile Send private message
pedrotester
Smarty Regular


Joined: 06 Jun 2019
Posts: 36

PostPosted: Wed Mar 17, 2021 9:31 pm    Post subject: Reply with quote

thank you bro
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP