Open ponyjoy opened 10 years ago
in the template file:
<a href = "{{ html.url({'controller' : 'category', 'action' : 'edit'}) }}"> Edit </a>
render ==>
<a href = "/category/edit"> Edit </a>
It's right.
<a href = "{{ html.url({'controller' : 'category', 'action' : 'edit', 'id' : 1}) }}"> Edit </a>
<a href = "/category/edit/id:1"> Edit </a>
this is not desirable, I need like this:
<a href = "/category/edit/1"> Edit </a>
so I change it to
<a href = "{{ html.url({'controller' : 'category', 'action' : 'edit', 1}) }}"> Edit </a>
got error: A hash key must be followed by a colon (:). Unexpected token "punctuation" of value "." ("punctuation" expected with value ":")
in ctp view file, we can use like this:
echo $this->Html->url(array('controller' => 'category', 'action' => 'edit', 1));
How to resolve it ?
You should be able to use a numeral as the key instead of nothing.
<a href = "{{ html.url({'controller' : 'category', 'action' : 'edit', '0' : 1}) }}"> Edit </a>
in the template file:
render ==>
It's right.
render ==>
this is not desirable, I need like this:
so I change it to
got error: A hash key must be followed by a colon (:). Unexpected token "punctuation" of value "." ("punctuation" expected with value ":")
in ctp view file, we can use like this:
How to resolve it ?