public function action_index() { $kosher_options = Kohana::config('global.kosher_level'); $payment_method = Kohana::config('global.payment_method'); $categories = Kohana_ORM::factory('category')->where('model', '=', 'restaurant')->find_all()->as_array('id', 'name'); $this->template->content = View::factory('site/main_index')->set('kosher_options', $kosher_options)->set('payment_method', $payment_method)->set('categories', $categories); }
/** * wrapper for factory */ public static function factory($model, $id = NULL) { // uppercase name $model = ucfirst($model); // create model $model = parent::factory($model, $id); // call hook Event::raise($model, Event::BEFORE_INIT, array('model' => $model)); // call init in model if (method_exists($model, 'init')) { $model->init(); } // call hook Event::raise($model, Event::AFTER_INIT, array('model' => $model)); //return the model return $model; }
public static function factory($model, $id = NULL) { $model = ucfirst($model); return parent::factory($model, $id); }
public static function factory($model, $id = NULL) { return parent::factory($model, $id); }