鉴于cakephp的调用函数 [英] Calling function in view of cakephp

查看:55
本文介绍了鉴于cakephp的调用函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个团队数组,希望在每个显示团队名称的地方都使用该团队名称。可以构建一个可以返回团队名称的全局函数,然后从我的视图中调用该函数即ctp文件。

I have one team array and want that team name every where to show team name.It is possible to built a global function which can return team name and I call that function from my view means ctp file.

推荐答案

please try this for west:

<?php
// controller name like app,users
// action name like getdata should be in controller
// and you can send parameter also
$output = $this->requestAction('controllerName/actionName/'.$parameter);
?>

这篇关于鉴于cakephp的调用函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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