开发者

Full Calendar in CakepPHP

I am following this tutorial: http://duckranger.com/2010/03/fullcalendar-and-cakephp-part-1-set-up/ and I cannot display my fullcalendar. I uploaded jquery lib into app/webroot/js, css into app/webroot/css,

My Event model:

< ?php
 class Event extends AppModel {

开发者_如何转开发var $name = 'Event';
}
?>

I got events_controller:

 < ?php

class EventsController extends BaseController  
{
    var $name = 'Events';
>
    var $helpers = array('Admin','Time','Javascript');
}

In views/events i got calendar.ctp:

 <?php


    echo $javascript->link('jquery-1.3.2.min.js');
    echo $javascript->link('ui.core.js');
    echo $javascript->link('ui.resizable.js');
    echo $javascript->link('fullcalendar.min.js');
    echo $javascript->link('ui.draggable.js');
    echo $html->css('fullcalendar');
    //Note: to use $html->css as above, the fullcalendar.css 
    //file must be in your app/webroot/css folder.
?>

<div id="calendar"></div>

And i dont know what to do. Where tu put these lines?:

<script type='text/javascript'>

    $(document).ready(function() {
        $('#calendar').fullCalendar({});
    });

BTW, i got error name:

Fatal error: Class 'BaseControllerÂ' not found in D:\PHP Projekty\salon\app\controllers\events_controller.php on line 2


First On your debugging mode app -> Config -> Core.php

Configure::write('debug',2);

It should be 2.

In cakephp all the controller default extend with AppController. If you want to use some extra function than create a component instead a controller. Load component in Your controller Like public $components = array('Session','Email','Cookie', 'RequestHandler', 'Cookie');

You can also use cakephp pulgin for this http://bakery.cakephp.org/articles/silasmontgomery/2011/03/02/cakephp_full_calendar_plugin_2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜