Tuesday, May 31, 2011

Re: .ctp files

On May 30, 2011, at 18:13, Magician wrote:

> I am trying to create a .ctp file for the tutorial program listed in
> book.cakephp.org. I have copied and pasted the exact .ctp code listed
> and placed it in the proper file it asked for. However, when I try to
> access this file in either Windows IE or Firefox, it displays the code
> and not the proper output. Does anyone know how to remedy this
> situation?
>
> exact tutorial page:
>
> http://book.cakephp.org/view/1536/Creating-Post-Views

You don't view .ctp files in a web browser. In a properly configured CakePHP installation, Apache does not even have access to them. (Apache's DocumentRoot should be pointed to the webroot folder.) Instead, you access the URL corresponding to the controller action that loads that view. In the case of the specific tutorial page you referred to, the .ctp file is at app/views/posts/index.ctp, but the URL of the controller action that loads that view is http://www.example.com/posts/index -- as it says on that page of the book.


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: