什么是用于CakePHP的.ctp文件? [英] What is a .ctp file used for in CakePHP?

查看:331
本文介绍了什么是用于CakePHP的.ctp文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用CakePHP,我正在阅读手册 。在页面的大约一半处,有以下注释:

  //在/views/elements/ajaxreturn.ctp $ b出现不同类型的.ctp文件扩展名,其扩展名为.ctp,.bp格式的扩展名是什么?一般用例是什么?



感谢。

解决方案

CakePHP 1.2引入.ctp作为视图的文件扩展名。


CakePHP视图文件使用普通PHP编写,并且默认扩展名为。 ctp(CakePHP模板)。这些文件包含了从控制器接收到的数据所需的所有呈现逻辑,其格式为您正在服务的受众群体准备就绪。



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



I'm starting to use CakePHP, and I'm in the process of reading the manual. About halfway down the page, there's this comment:

// Render the element in /views/elements/ajaxreturn.ctp

So a very simple question: what's the .ctp extension refer to? What's the general use case?

Thanks.

解决方案

CakePHP 1.2 introduced .ctp as it's file extension for views.

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

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

这篇关于什么是用于CakePHP的.ctp文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆