Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Mixing jquery with PHP

$
0
0
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/

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>