[CakePHP] View convention

View convention in CakePHP
[ qui ước đặt tên view trong cakephp ]

////////////////////////////////////////////////////////////
Conventions
////////////////////////////////////////////////////////////
View template files are named after the controller functions they display,
in an underscored form

the basic pattern is:
/app/views/controller/underscored_function_name.tcp

////////////////////////////////////////////////////////////
Examples
////////////////////////////////////////////////////////////
the getReady() function of the PeopleController class will look
for a view template in /app/views/people/get_ready.ctp



+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
final convention example
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Database table: "people"
Model class: "Person", found at /app/models/person.php
Controller class: "PeopleController"found at /app/controllers/people_controller.php
View template, found at /app/views/people/index.ctp


---
name: hoang nguyen
nickname: mathhoang
Y!M: vietnam_hoangminhnguyen@yahoo.com
mail: vietnam_hoangminhnguyen@Yahoo.com
site: http://tech-vnit.tk
---

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...