This repository has been archived by the owner on Feb 8, 2019. It is now read-only.
forked from m3nt0r/cakephp-twig-view
-
Notifications
You must be signed in to change notification settings - Fork 31
Error using elements #9
Comments
also, the element isn't getting the view variables like a normal .ctp variable would. - variables set in the controller using $this->set('foo' , $foo); |
this is with cakePHP 2.1.2 |
I know this is mega old now but you could try:
And, if you want to pass additional variables to it:
|
passing parameters works using the {% element 'element_file' with {'parameter':'value','parameter2':'value2'} %} 👍 Still need to figure out how to access the view variables from inside the element… :-/ |
The workaround I use now to get around the view variables problem is that I pass them as parameters into the element, as described above. There's actually an upside to this solution: it decouples the Element from the View itself, forcing a cleaner interface and thus Separation of Concerns. Code reuse FTW. |
Just as elements were intended. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Unexpected token "string" of value "datepicker"
This happens when doing:
if i change it to :
it calls the template. But how to pass options array?
if i do:
i get: Unexpected token "punctuation" of value ","
The text was updated successfully, but these errors were encountered: