ErrorException [ Warning ]: Invalid argument supplied for foreach()

APPPATH/views/products/_list.php [ 3 ]

1 <?php
2 $counter = 0;
3 foreach ($products as $product):
4     $counter++;
5     if ((!isset($total_products) || $total_products == 1) && !isset($block_redirect)) {   // Nie sprawdzone wszystkie strony dlatego dziwny warunek
6         Request::current()->redirect($product->get_url());
7     }
8     ?>
  1. APPPATH/views/products/_list.php [ 3 ] » Kohana_Core::error_handler(arguments)

  2. SYSPATH/classes/kohana/view.php [ 61 ] » include(arguments)

  3. SYSPATH/classes/kohana/view.php [ 343 ] » Kohana_View::capture(arguments)

  4. SYSPATH/classes/kohana/view.php [ 228 ] » Kohana_View->render()

  5. APPPATH/views/products/index.php [ 5 ] » Kohana_View->__toString()

  6. SYSPATH/classes/kohana/view.php [ 61 ] » include(arguments)

  7. SYSPATH/classes/kohana/view.php [ 343 ] » Kohana_View::capture(arguments)

  8. SYSPATH/classes/kohana/view.php [ 228 ] » Kohana_View->render()

  9. APPPATH/views/templates/default/layout.php [ 4 ] » Kohana_View->__toString()

  10. SYSPATH/classes/kohana/view.php [ 61 ] » include(arguments)

  11. SYSPATH/classes/kohana/view.php [ 343 ] » Kohana_View::capture(arguments)

  12. SYSPATH/classes/kohana/controller/template.php [ 44 ] » Kohana_View->render()

  13. {PHP internal call} » Kohana_Controller_Template->after()

  14. SYSPATH/classes/kohana/request/client/internal.php [ 135 ] » ReflectionMethod->invoke(arguments)

  15. SYSPATH/classes/kohana/request.php [ 1138 ] » Kohana_Request_Client_Internal->execute(arguments)

  16. DOCROOT/index.php [ 114 ] » Kohana_Request->execute()

Environment