I may sound silly….But please help to clarify…Am using netbeans IDE to create web pages using PHP (MVC). View files are created with an extension .phtml or .html. Controllers are created with extension .php
The thing is, even if we store all files as .php also, its working. But what is the significance of storing with different extensions??
If everything is the same then what is the need of different extensions???
Thanks in advance..
If your views directory is inside your document root, then it will be possible to access your views directly with a browser. If they have .php extension, they will be executed by the PHP interpreter, which might or might not be a problem. If they have .html or .phtml extension they will be displayed directly in the browser, which again might or might not be a problem.
If your views directory is not within your document root, or if you have other security mechanisms restricting direct access to them, then the file extension is just a matter of preference.