Advertisement
Armandobs14

Chamando método CodeIgniter

Aug 31st, 2013
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php
  2.     class some_model extends CI_Model{
  3.         public some_method(){
  4.             // Do something
  5.         }
  6.     }
  7. ?>
  8. <?php
  9.     class somectrl extends CI_Controller{
  10.        
  11.         public __construct(){
  12.             parent::__construct();
  13.             $this->load->model("some_model"); // carregamento do model
  14.         }
  15.         public some_method(){
  16.             $this->some_model->some_method(); // método do model
  17.         }
  18.     }
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement