-
Notifications
You must be signed in to change notification settings - Fork 0
Load Layer
defvayne23 edited this page Jan 13, 2012
·
6 revisions
object $this->load->controller(string $controller);
Loads the given controller.
-
controller
Name of the controller to load.
Returns the object of the controller.
$oProducts = $this->load->controller("products");
mixed $this->load->model(string $model[, string $variable_name]);
Loads the given model.
-
model
Name of the model to load. -
variable_name
If set, loads the model into the application instead of returning the object.
Returns the object of the model if variable name is not set.
$oProducts = $this->load->model("products");
$oProducts->getProduct(1);
$this->load->model("products", 'prod');
$this->prod->getProduct(1);
string $this->load->view(string $template);
Loads the given view.
-
view
Name of the view file to load. -
arguments
Data that is loaded for the view to use. -
return
If contents of view should be returned, otherwise sent to the browser.
Returns the contents of the view after rendering if return parameter is set to true.
$this->load->view("products.php", array('aProducts' => array(...)));
$this->load->view("email.php", array('aProducts' => array(...)), true);
void $this->load->helper(string $helper);
Loads the given helper.
-
helper
Name of the helper to load.
$this->load->helper("tax");
$tax = calculate_tax($subTotal);