Re: How can controller action function distinguish whether URL ends with .xml or not?
From what i remember this should do the trick, in your controller action
if ( $this->RequestHandler->isXML()) {
// do some xml specific code
}
Check out the documentation on Request Handling for more details.
http://book.cakephp.org/2.0/en/core-libraries/components/request-handling.html
On Friday, September 14, 2012 6:31:38 AM UTC+3, Lightee wrote:
Dear Cakephp gurus,--I am creating some web services using cakephp with XML. When user visit a URL, cakephp is smart enough to detect the URL extension and direct to the correct view folder. For example, if URL ends with .xml, view is directed to the xml folder. My problem comes with the controller. If there any way for controller to know whether URL ends with .xml? Currently, I have to create new actions for add, edit, delete and view just to handle .xml URLs.THank you.
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-US.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home