duanca3415 2014-10-06 03:27
浏览 26

CakePHP:通过从其他控制器获取数据来创建仪表板页面

I have researched for this solution all month but I didn't get the right answer for my page. Please take a look and give me suggestions.

I have the admin page and the view is Dashboard.

I have tables are Staffs, Customers, Comments, Contacts....

I created these page to show data on view successfully for each of them.

NOW, I want to make the dashboard page to view each 5 top new Staffs, Customers, Comments....were being added to system. The summary page. My Dashboard page will be my main page (when access the domain, it will direct to dashboard page).

My question are:

  1. Where should I create the Dashboard page in?

  2. How can I take the data from Staff Controllers, Customers Controller....in the dashboard page. Dashboard page is not include in view of these above controllers.

I use cakephp 1.3

Please give me the best suggestion for this. Thank everyone much !

  • 写回答

1条回答 默认 最新

  • douda5706 2014-10-06 04:53
    关注

    First of all it depends upon the way you wanna go ahead:

    1) Where should I create the Dashboard page in?

    Its totally upto you where you want to create the page, but it should ideally be the page to be redirected after the admin login.(BTW its a foolish question to be asked.)

    2) How can I take the data from Staff Controllers, Customers Controller....in the dashboard page. Dashboard page is not include in view of these above controllers.

    You can do that in 2 ways:

    a) Create common functions for these in their respective model and just call those into your single function created for dashboard.

    b) Create functions in their respective controller and import the controller and use these methods in the dashboard function(But avoid this approach as long as you can as it will load unnecessary controller class files).

    Hope it helps you.

    评论

报告相同问题?

悬赏问题

  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行