I got the same error doing:
{loop posts}
`<?= $post_loop_counter; ?>
{end}
This should not be like this...
-
$posts is a two index array that I got with $params, first is numeric, second represent columns.
How do I do to to access every record????
I can't believe that I'm not able to do:
`<?= $id = $post[$pos_loop_counter]["id"]; ?>
Actually I think that one is not able to set any variable in a .tpl...
Why is this?? can I change it?? it looks absurd to me... And it doesn't let me go on...
That is to keep on with best practices and avoid writing unsustainable/hard to test code. Views should not contain logic at all. If you need presentation logic, that is what helpers are for.
Some best practices taken from Kaushik G's blog and adapted to Akelos
If you still hungry for some spaghetti, then just add
define('AK_TEMPLATE_SECURITY_CHECK', false);
in your config/config.php file and have nice meal ;)
Ehmmm... I see..
I only wanted to use a class with some static methods an attributes as a kind of common helper, one wich holds standars and conventions...
understanding the reasons, I'll try to move these into a place wich does not trigger the security error :(
But I'm not completelly agree ;)
Considering the premise of not to include logic into views, how do we define "logic"? if it is the fact of asigning a value or making an operarion...
we'll still should be able of JUST make a call to an static function or invoking an static attribute ;)
well.. thanks...
Trying to keep views simple by avoiding "dangerous" code to empower best practices is hard. Any help to improve the PHP tokenizer to allow more safe constructions on views is welcomed.
As I said before you can all ways skip this verification if you really need to use that static calls, but be aware that other static calls like Ak::delete() can be used as well in views.
ok I got it...
1 to 9 of 9