CodeIgniter Forums
Uri segment not working - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Uri segment not working (/thread-59899.html)

Uri segment not working - El Forum - 12-06-2013

HI , I need some help please, i don't understand why uri segment is not shows Object not found.

this is my controller....
class Firstpage extends CI_Controller {

   function index(){


   function pagesite(){

    $p['page'] = $this->uri->segment(2);




this is my menuview

<li ><a href="&lt;?php echo base_url();?&gt;pagesite/home">Home</a></li>
  <li><a href="&lt;?php echo base_url();?&gt;pagesite/gallery">Gallery</a></li>

when i click the gallery the url will be like this.


but it shows Object not found...can you help me please how do i fix this.

Thank you in advance.

Uri segment not working - El Forum - 12-06-2013

Did you make, a function in pagesite controller named gallery or home ?

Uri segment not working - El Forum - 12-06-2013

Your anchors are missing the controller name, firstpage.
<li ><a href="&lt;?php echo base_url();?&gt;firstpage/pagesite/home">Home</a></li>

And I believe this would be segment 3. Segment 1 = controller, segment 2 = method, segments 3+ are parameters.
$p['page'] = $this->uri->segment(3);

Uri segment not working - El Forum - 12-11-2013

[eluser]Kiran K[/eluser]
I think , what CroNiX said is right.