FullCalendar


(Emailnyadyo) #21

anybody knows how to add events from MySQL database without using this json-events.html? can I render my data from my controller like this :


public function actionGetTasks() {

        $query = Yii::app()->db->createCommand('SELECT TASKID, STARTTIME, ENDTIME

            FROM task');

        $result = $query->queryAll();

        foreach ($result as $row) {

            $data[] = array(

                'id' => $row['TASKID'],

                'title' => $row['TASKNAME'],

                'start' => $row['STARTTIME'],

                'end' => $row['ENDTIME'],

                'allDay' => false,

            );

        }

        echo str_replace("'", '"', json_encode($data));

    }

and my view (calendar.php):


<div class="two_third maincontent_inner">

    <div class="left">

        <?php

        $this->widget('application.extensions.fullcalendar.FullcalendarGraphWidget',

        array(

        'data' => array(

        'title' => 'All Day Event',

        'start' => date('Y-m-j')//events from database should be here

        ),

        'options' => array(

        'selectable' => true,

        'header' => array(

        'left' => 'prev,next today',

        'center' => 'title',

        'right' => 'month,agendaWeek,agendaDay'

        ),

        ),

        'htmlOptions' => array(

        ),

        )

        );

        ?>

        <br />

    </div><!-- left -->

</div><!-- two_third -->




and how to change the ‘data’=>array so it can read and put the events from my controller?

thanks in advance.


(Rupesh Ninawe007) #22

full calendar is not working for yii v 1.1.14


(Rupesh Ninawe007) #23

sry it was my mistake, Now it is working


(Raghav Agarwal 05) #24

Hi Paskuale,

I saw one of your link on this link.

http://www.yiiframew…6-fullcalendar/

Here You describe a way, how to add different event color to different event.

I am using this thing, But still no color are reflecting on my calender for different event.

Even I am not able to change color of all event, through this property.

Here is my code:

$aray[‘eventBackgroundColor’] = ‘#ff0000’;

I am creating array of data.

Please help.

Thanks


(vitocourt) #25

Where can I download fullcalendar for Yii1.1 ?


(tri - Tommy Riboe) #26

https://www.yiiframework.com/search?version=1.1&type=extension&q=fullcalendar