Results 1 to 2 of 2

Thread: Mixing jquery with php

  1. #1
    Join Date
    Dec 2012

    Mixing jquery with php

    I have a jquery calendar in my cakephp application with

    	<?php //foreach ($mealplans as $mealplan){ ?>
    					title: '<?php echo $mealplan['Mealplan']['event_name'] . ", ". $mealplan['Mealplan']['total_calories']. " cals"; ?>',
    					start: new Date(y, m, <?php
    					$event = $mealplan['Mealplan']['event_date']; echo substr($event, 0, -8); ?>, 0),
    					end: new Date(y, m, 16),
    					allDay: true,
    					url: 'http://localhost/mealplans/view/1'
    				<?php //} ?>

    When I uncomment foreach and its curly bracket at the end then it prints out the first of my meal plans on January 15 until January 16 but I want it to print out all of them. Most of the php is working in the jquery code it's just this one part that doesn't work. When I uncomment the foreach and its end bracket then the calendar disappears. You can see it at http://myownmealplanner.com/calendars/navigate The calendar code is from http://arshaw.com/fullcalendar/docs/usage/

  2. #2
    Join Date
    Dec 2012
    I found the problem. One of the meal plans had no date associated with it and the jquery was corrupted as a result. It works now at localhost.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center