Example #1
0
 public static function _validation_valid_product($val)
 {
     if (self::_empty($val)) {
         return true;
     }
     return Model_Base_Product::valid_field('id', $val);
 }
Example #2
0
 public function action_edit($id = null)
 {
     if (empty($id) || !Model_Base_Product::valid_field('id', $id)) {
         Response::redirect('/admin/product');
     }
     $this->data['category'] = Model_Base_Category::get_all();
     $this->data['product'] = Model_Base_Product::get_one($id);
     $this->data['product']['category'] = Model_Base_ProductCategory::get_by('category_id', 'product_id', $id);
     $this->data['product']['sub_photo'] = Model_Base_Product::get_sub_photo($id);
     $this->template->content = View::forge($this->layout . '/product/edit', $this->data);
 }