What is the default extension of view files in cakephp?can we change it?if yes then how?

Answer

default extension of view files is '.ctp'.
yes we can change it by writing public $ext = '.yourext'; in AppController.If you want to change it for particular controller then add it into that controller only.You can also change it for the specific action of the controller by putting it in that action of controller.
 
 
public $ext = '.yourext'; in AppController
 - you can change all the views extentions.
 
 public $ext = '.yourext';  in specific controller like, PostsController
- you can change all the views extentions of PostsController.
 
public $ext = '.yourext';  in specific controller action like, index()
- you can change the view extention of index.ctp 
 
 
Note: You cannot specify multiple extensions, however it seems like there is a fall back to .ctp if no .php file is found.

All cakephp Questions

Ask your interview questions on cakephp

Write Your comment or Questions if you want the answers on cakephp from cakephp Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---