简体   繁体   English

cakePHP-日历插件问题

[英]cakePHP - calendar plugin question

im currently working on creating a small application for a website i'm working on the calendar im using is in the cakephp plugins folder. 我目前正在为网站创建一个小型应用程序,我正在使用日历,我正在使用cakephp plugins文件夹中的即时消息。 I have to display events depending on the city or view id i want the url like this. 我必须根据城市显示事件或查看ID,我想要这样的网址。

http://imstillreallybored.com/cupload/full_calendar/cities/1 http://imstillreallybored.com/cupload/full_calendar/cities/1

i also want to load the event model and not have load a 'cities' database table i already have all the information i need in two tables events and event_locations i just need to run a condition to get events according to the id. 我也想加载事件模型,而不必加载“城市”数据库表。我已经在两个表中获取了我需要的所有信息:event和event_locations,我只需要运行一个条件即可根据id获取事件。 here the original link 这里是原始链接

http://imstillreallybored.com/cupload/full_calendar/ http://imstillreallybored.com/cupload/full_calendar/

This could be accomplished with a route. 这可以通过一条路线来完成。

Router::connect(
    '/full_calendar/cities/*',
    array(
       'plugin' => 'full_calendar',
       'controller' => 'events',
       'action' => 'view'
    )
);

That would match the /full_calendar/cities/[id] and the id would be passed in as the first parameter for the EventsController::view() action. 它将与/ full_calendar / cities / [id]匹配,并且id将作为EventsController :: view()操作的第一个参数传入。

public function view($id = null) {
    // Your action logic
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM