[ACCEPTED]-What is a .ctp file used for in CakePHP?-ctp-file

Accepted answer
Score: 70

CakePHP 1.2 introduced .ctp as its file 7 extension for views.

CakePHP view files are 6 written in plain PHP and have a default 5 extension of .ctp (CakePHP Template). These files contain all the 4 presentational logic needed to get the data 3 it received from the controller in a format 2 that is ready for the audience you’re serving 1 to.

http://book.cakephp.org/2.0/en/views.html#view-templates

Score: 9

Template file used by CakePHP, a development 6 framework for PHP Web applications; contains 5 the PHP "view" code within the 4 Model-View-Controller (MVC) software architecture 3 design pattern; stores a template for how 2 information is displayed in the Web application.

See 1 more in http://www.fileinfo.com/extension/ctp

Score: 6

You can change the .ctp file extention by using 3 property in Controller or AppController:

public $ext = '.php';

.ctp is 2 the view file extention of CakePHP template 1 file. It stands for "CakePHP Template".

Score: 4

CakePHP provides an extendable architecture 11 for designing, developing and distributing 10 software using a rapid development framework. The 9 .CTP file extension supports CakePHP's view 8 scripts and provides the set of helpers 7 appropriate for CakePHP version 1.2.

CTP 6 files are templates for the CakePHP framework 5 for application development, managed by 4 the Cake Software Foundation. CTP files 3 contain information for the program's user 2 interface and dictates how an application 1 appears to the user.... More »

http://book.cakephp.org/2.0/en/views.html#view-templates

Score: 3

Cakephp follow 3-tier architecture, Model 4 ,Controller and View are 3-tier of this 3 architecture.All MVC Framework follows this 2 architecture Including Cakephp, .ctp extension 1 used by Cakephp views.

enter image description hereS.jpg

Score: 2

ctp stands for CakePHP Template

It is a template 4 file used by CakePHP. Basically it is a 3 application View layer, it contains the 2 PHP,Html "view" code to display the end 1 user.

Score: 1

Cakephp is based on MVC framework. 'M' stands 10 for model, 'C' for Controller and 'V' for 9 Views. Model is used for interacting with 8 database tables, Controller used for controlling 7 request and response of client and also 6 for logic implementation and process and 5 views are for presentation. Other two have 4 file extension .php, but views has .ctp 3 extension. Reason is that Cakephp architecture 2 is using template caching internally, such 1 as tpl in Smarty.

Score: 1

CTP files may contain layouts, elements, or 6 helpers. Layouts define presentation code. Elements 5 contain smaller, reusable segments of view 4 code. Helpers contain classes that encapsulate 3 logic used between many views, elements, or 2 layouts.

CTP files are stored in the CakePHP 1 /app/views directory.

Score: 0

the ctp file type in cakePHP is used for 4 views it can be used to represent :

1. The standard views, wich are related to a model and a controller;
2. Elements, wich can be inserted in other views (Pages, or standard view);
3. Pages : Static pages .

Inside 3 a view you can use HTML and PHP, and in 2 the most of cases you have an object available, wich 1 represent the model (Example $Product).

Score: 0

CakePHP's View Class has a class varibale 6 called $viewExtension or perhaps $viewExt 5 and its default value is set to 'ctp' which 4 stands for cake php template, you can over 3 write this value in any of your controller 2 or in derived view classes or in any controller 1 action within the scope of code.

Score: 0

.ctp files are CakePHP Template Pages, that 8 is view templates. It is used for the view 7 in the MVC that shows output in the browser 6 and act as a view for a controller action. JSON, XML, HTML, JS, CSS, PHP 5 code can be written in it. More than as 4 HTML/PHP pages, it shows data sent from 3 controller. Also .ctp files CakePHP can 2 act as a layout that wraps the view around 1 it.

Score: 0

Its a view file from where controller render 4 the presentation login.You can change the 3 extension ".ctp" to ".php" for views to 2 set the $ext property for specific controller 1 $this->ext = '.php'

More Related questions