jquery - Undefined index: posts_start on one localhost machine, but not on another? with Laravel 4 -
i have been trying set "load-more" functional widget, , successful earlier today on localhost. however, on computer (same mac os, mamp, etc...), getting error session variable: undefined index: posts_start.
in javascript, these relevant lines:
<?php $number_of_posts = 2; ?>; //<?php $_session['posts_start'] = $_session['posts_start'] ? $_session['posts_start'] : $number_of_posts; ?>; <?php $_session['posts_start'] = 2 ?>; var start = <?php echo $_session['posts_start']; ?>;
this using laravel 4, have session running current user (no need use session_start()). not sure why isn't working on machine, working on another. thoughts? thank you.
i use laravel's session
library. lib can handle situations beautifly...
var start = <?=session::get('posts_start', 2) ?>; // or this, if use blade syntax var start = {{ session::get('posts_start', 2) }};
what call do? tries posts_start
session, , fallbacks number 2
, if number not set in session.
Comments
Post a Comment