I am a little confused. The following is my nav controller. i have been getting my page layout this way.
nav
<a href ="<?php echo base_url();?>main/index/home_v">Home</a>
<a href ="<?php echo base_url();?>main/index/contact_v">Contact</a>
<a href ="<?php echo base_url();?>main/index/test_v">Test</a>
Main Controller
public function index()
{
if($this->uri->segment(3))
{
$content = $this->uri->segment(3);
}
else
{
$content = 'home_v';
}
$data = ['title'=> 'home', 'main_content' => "$content"];
$this->load->view('tempelate',$data);
}
since, all those content in my nav is inside view, its not a problem but what if i have a folder inside a view and want to send it to that controller? am i here all clear asking the question? because i am myself confused.
I want to sent another uri->segment into the same function.
<a href ="<?php echo base_url();?>main/index/category_v/category">Cat</a>
category here is the folder name. so now what i basically want to add into the function is .
$folderName = $this->uri->segment(4);
$datato the view inside that folder, you can simply do$this->load->view('foldername/viewname', $data);- Parag Tyagicategoryand the view name inside it iscategory_v.php. Am I going right ?? - Parag Tyagi