Skip to content

Instantly share code, notes, and snippets.

@arunoda
Created June 14, 2012 04:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arunoda/f046ea26ba51c983ccae to your computer and use it in GitHub Desktop.
Save arunoda/f046ea26ba51c983ccae to your computer and use it in GitHub Desktop.
Codeigniter - Views
<h1>This is the header</h1>
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Hello extends CI_Controller {
public function index() {
//
echo "This is my index function";
}
public function one($name) {
$this->load->view('header');
$data = array("n" => $name);
$this->load->view('one', $data);
}
public function two() {
//
echo "This is the two";
}
}
<h1>This is the One</h1>
Hello, <?php echo $n; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment