I am facing some problems in routing under cakephp
there are two actions in my controller
they are as below:
example.com/posts/show/show-by-day
example.com/posts/view/slug-post
I want them as:
example.com/article/show-by-day.html
example.com/article/slug-post.html
So i routes file under config file I wrote as:
Router::connect('/article/:show_by_day', array('controller' => 'posts', 'action' => 'show'), array('pass' => array('show_by_day')));
Router::connect('/article/:slug', array('controller' => 'posts', 'action' => 'view'), array('pass' => array('slug')));
its working fine when I hit the url example.com/article/show-by-day.html
but when I hit url example.com/article/slug-post.html , its again point to action show.
So how can I solve it?
Many thanks!
Like Us on FaceBook 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 unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment