You need to implement a filter for the goods (for example, with / without photos, with / without description, etc.). If the parameter is not specified, then nothing needs to be added to the request.
public function action_index() { $orm = ''; if(isset($_POST['filter_submit'])) { if(!empty($_POST['filter_name'])) { $name = $_POST['filter_name']; $orm .= "->where('name', '=', $name)"; } switch($_POST['filter_main_image']) { case 1: $orm .= "->where('main_image','!=','')"; break; case 2: $orm .= "->where('main_image','=','')"; break; } // Как здесь прикрутить переменную $orm перед find_all() $products = ORM::factory('product')->find_all(); } $content = View::factory('admin/a_products/va_products_index') ->bind('products', $products); // Выводим в шаблон $this->template->page_title = 'Продукты'; $this->template->block_center = array($content); }
I am ready to listen to any other options how this can be implemented, because this option is not a cake.