Skip to main content

OpenCart : Create a Model

To make  a Model  
class Model<foldername><filename with out extention> extends Model{
  
   public function methode(){
    .....
    } 

We can call a model from controller using 

$this->load->model('<folder>/<filename with out extention>');

And after that we can call the method like below
$this->model_<folder>_<filename with out extention>->methode();

The Method should be public

Comments

  1. Best 1xbet korean bitcoin gambling sites - Online bettors - Legalbet.co.KR
    Best 1xbet korean bitcoin gambling sites · 1xbet korean bitcoin gambling sites · 1xbet korean bitcoin 1xbet зеркало gambling sites · 1xbet korean bitcoin gambling sites · 1xbet korean bitcoin gambling sites

    ReplyDelete

Post a Comment

Popular posts from this blog

OpenCart : Route

In open cart the routeing technique is very simple, If we wan  to call a module or controller /catalog/controller/product/category.php the we have to call it like 'index.php?route=product/product'. Here product is the folder name category is the controller file name without the file extension.   'index.php?route=product/product'  it will execute the   public function index(){     ...  }  'index.php?route=product/product/menthod' then is ill call    public function method(){     ...  } the method should be public otherwise the system will not be able to call it we will know more about that later.

PROCEDURE to execute multiple query in mysql by php

Ok, my problem was that i have to execute query to multiple mysql server, The easy way to do that to make connection to each of those servers and send query. And i work with php. In some part of my project i need to do hundreds of query at a time and normally php don't support multiple query to database. To do that i have to change some (.h) file in server what i don't have access. I't take lots more time to execute query cos every time send a query to the remote serve the php wait for the result and then send the next query. but if i can send all the query once then it will take less time. I saw searching net for that and couldn't find a better way. Then i thought to do it by my my salfe. And i thought to make a PROCEDURE where i will send all the query with some delimiter. And i coded the below  PROCEDURE CREATE  PROCEDURE `execute_query`(var_complexe_query LONGTEXT,var_query_delimiter VARCHAR(20)) BEGIN SET @new_string := var_complexe_query; SET @execute_query:=