CodeIgniter Forums
url helper problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: url helper problem (/showthread.php?tid=27325)



url helper problem - El Forum - 02-07-2010

[eluser]blackgoo[/eluser]
that is what i do:

1) i load "url" helper in one of my controller files. the controller file loads data to the view file (dummy.php).
2) then,i want to display the first segment of the URL in the view file (dummy.php)

Code:
<?php echo $this->$uri->segment(1); ?>

And i always have this ERROR:

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: uri

Filename: views/dummy.php

Line Number: 22

please, explain what should i do to solve this
Thank you.


url helper problem - El Forum - 02-07-2010

[eluser]pistolPete[/eluser]
Use this:
Code:
<?php echo $this->uri->segment(1); ?>



url helper problem - El Forum - 02-07-2010

[eluser]blackgoo[/eluser]
Thank you! it works!
i`m so n00b


url helper problem - El Forum - 02-08-2010

[eluser]jmadsen[/eluser]
nevermind


url helper problem - El Forum - 02-08-2010

[eluser]mattpointblank[/eluser]
Dude, put a (NSFW) warning in your signature link.