Created
December 3, 2015 19:15
-
-
Save vitqst/7331743f00b763805b4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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