コード例 #1
0
 public static function sandbox()
 {
     $first = Recipe::find(1);
     $recipes = Recipe::all();
     Kint::dump($recipes);
     Kint::dump($first);
 }
コード例 #2
0
 public static function sandbox()
 {
     // Testaa koodiasi täällä
     // View::make('helloworld.html');
     $indi = Recipe::find(1);
     $indis = Recipe::all();
     Kint::dump($indi);
     Kint::dump($indis);
 }
コード例 #3
0
ファイル: RecipeController.php プロジェクト: suhael/laravel
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function listall()
 {
     //
     $recipes = Recipe::all();
     return Response::json($recipes);
 }
コード例 #4
0
 /**
  * @param $params
  * @param $pages
  * @param $page_size
  */
 protected static function make_paged_index($params, $pages, $page_size)
 {
     $page = $params['page'];
     if ($page <= 0 || $page > $pages) {
         Redirect::to('/', array('error' => 'Sivua ei ole olemassa'));
     } else {
         $recipes = Recipe::all(array('page' => $page, 'page_size' => $page_size));
         $content = self::make_paged_content($pages, $recipes, $page);
         View::make('recipe/index.html', $content);
     }
 }