Skip to content

Instantly share code, notes, and snippets.

@vitqst
Created December 3, 2015 19:15
Show Gist options
  • Select an option

  • Save vitqst/7331743f00b763805b4c to your computer and use it in GitHub Desktop.

Select an option

Save vitqst/7331743f00b763805b4c to your computer and use it in GitHub Desktop.
// CI_Controller.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
$this->home() ;
}
public function home(){
$this->load->model('CI_Model') ;
$data['name'] = $this->cimodel->getName() ;
$this->load->view('welcome_message',$data) ;
}
}
// CI_Model.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class cimodel extends CI_Controller{
function __construct() {
parent::__construct();
}
function getName(){
return "Đặng xuân Vui" ;
}
}
?>
// CI_View.php
<?php
echo $name ;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment