Can we write multiple functions inside another function in Codeigniter.? here is my controlller
class Products extends CI_Controller {
public function myproduct() {
$this->load->view('myproduct'); // call myproduct.php
public function features() {
$this->load->view('features'); // call "myproduct/features"
}
public function screenshots() {
$this->load->view('screenshots'); // call "myproduct/screenshots"
}
}
}
as per my controller there are 2 inline functions inside myproduct(). my aim isto display the url as
localhost/mysite/products/myproduct
localhost/mysite/products/myproduct/features
localhost/mysite/products/myproduct/screenshots
i already tried it but it gives me a error
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in D:\...........\application\controllers\mysite\products.php on line 5
and the line 5 was
public function features() { .........
You can just treat this as a uri paramater in the url: