Hello Ryan,
when using the wireRenderFile function, the TemplateFile instance is using the data($name, $value = null) function to set template vars. The (little) issue here is that when the $value argument is null data() it acts as a getter not as a setter. I would like to have a method that always act as a setter even for null value smt like setVar($name, $value) or assign($name, $value) and bypasses the set() logic same way as data() does.
for instance in the example above in product-list.html.php I would like to check for the $user var without using isset(). Of course this is no big deal but technically it seems more appropriate that the code that assigns vars to the template file always acts as a setter no matter what kind of value is passed in.
Hello Ryan, when using the
wireRenderFile
function, theTemplateFile
instance is using thedata($name, $value = null)
function to set template vars. The (little) issue here is that when the $value argument is nulldata()
it acts as a getter not as a setter. I would like to have a method that always act as a setter even for null value smt likesetVar($name, $value)
orassign($name, $value)
and bypasses theset()
logic same way asdata()
does.for instance in the example above in
product-list.html.php
I would like to check for the$user
var without using isset(). Of course this is no big deal but technically it seems more appropriate that the code that assigns vars to the template file always acts as a setter no matter what kind of value is passed in.kind regards