Is there a way to change the extension of the view files generated by cake bake view
? Presently, the task generates .ctp
files -whereas I want .php
.
I tried using the alias argument @
cake bake view MyController index "index.php"
, however CakePHP thinks I am trying to load a plugin named "index":
Error: Plugin index could not be found
Obviously, I can change the file names manually or through a batch script. However, it would be ideal for the console to do this.
Edit:
Through answering Salines' question as to why I want to do this, I realized this question is more IDE specific. I found what I was looking for in this answer: Display CTP Files as PHP Files in PHPStorm. That said, I would still be interested in knowing if/how to generate alternative file extensions with cake bake view
.
How to bake views with custom extensions?
public $ext = '.php';
Note: your CakePHP application will not be made in the standard approach, which can make it difficult for future upgrades. I did not use cakephp views with custom extensions, but I give you instructions on how to do.