cakephp中的ctp文件是什么? [英] What is ctp file in cakephp?

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

问题描述

我想开发一个网站应用程序。该网站使用cakePHP Framework。我刚学习cakePHP。 CakePHP使用MVC。当我打开View文件时,还有很多带有ctp扩展名的文件。什么是ctp扩展名?那么与模型和控制器文件的关系是什么?



我尝试了什么:



admin_dashboard.ctp:



<! - 内容标题(页眉) - > 
<?php
$ allowed_module = $ this-> General-> CheckIsPermitted($ this-> Session-> read('Auth.User.id'),'user_manager') ;
$ admin_role_id = $ this-> Session-> read('Auth.User.role_id');
// pr($ allowed_module); die;
?>
< section class =content-header>
< h1>
信息中心
< small>控制面板< / small>
< / h1>
< ol class =breadcrumb>
< li>< a href =javascript:void(0)> <?php echo $ this-> Html- > link('Home',array('controller'=>'admins','action'=>'dashboard','plugin'=> null)); ?>< / A>< /锂>
< li class =active>信息中心< / li>
< / ol>
< / section>

解决方案

allowed_module =


this-> General-> CheckIsPermitted (

这 - >会话而>读取( 'Auth.User.id'), 'user_manager');

I want to developing an website application. That website using cakePHP Framework. I am just learn about cakePHP. CakePHP using MVC. When i opened View file, theres alot file with ctp extension. What is ctp extension for? so what is that relation to Model and Controller File?

What I have tried:

admin_dashboard.ctp:

<!-- Content Header (Page header) -->
           <?php
               $permitted_module = $this->General->CheckIsPermitted($this->Session->read('Auth.User.id'),'user_manager');
               $admin_role_id = $this->Session->read('Auth.User.role_id');
               // pr($permitted_module);die;
           ?>
               <section class="content-header">
                   <h1>
                       Dashboard
                       <small>Control panel</small>
                   </h1>
                   <ol class="breadcrumb">
                       <li><a href="javascript:void(0)"> <?php echo $this->Html->link('Home', array('controller' => 'admins', 'action' => 'dashboard', 'plugin' => null)); ?></a></li>
                       <li class="active">Dashboard</li>
                   </ol>
               </section>

解决方案

permitted_module =


this->General->CheckIsPermitted(


this->Session->read('Auth.User.id'),'user_manager');


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

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