Wednesday, September 26, 2012

Re: $this->html->link not changing location

You should always use the array format for urls ( http://book.cakephp.org/2.0/en/appendices/glossary.html#term-routing-array ), otherwise the Router has a difficult time finding the correct route. Also, the routes in your routes.php file are parsed in the order that they are declared. So if you have two similar routes you need to be careful about the order that they appear.

On Wednesday, 26 September 2012 19:04:56 UTC+2, arron wrote:
thank you that worked 

On Wednesday, September 26, 2012 12:12:56 AM UTC-7, marco metal wrote:
Hi,

Just a small mistake :)

check your line

$this->Html->link($examples['model']['somename'], '/controllername/slug/' + $examples['model']['slug']);

You wrote '+', it will concat the string. Use '.' sign, so your new code should be

$this->Html->link($examples['model']['somename'], '/controllername/slug/' . $examples['model']['slug']);



Enjoy,

Marcus

--
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
 
 

No comments: