Uri Routing |
[eluser]Dizza[/eluser]
Hi, Oke, im stuck (again, lol). I want to pass an id to a next page (so it can be loaded there with all the info). Im having this Controller Code: function meer() and the view: Code: <div class="iLayer" id="waVoorgerecht" title="Voorgerechten"> the part where i use <?php echo anchor('home/meer/' . $row->id); ?> in the view has to pass the id to the controller, but it wont work, can someone help me please? Im stuck with this thing for almost 2 days
[eluser]Cristian Gilè[/eluser]
Code: function meer() Cristian Gilè
[eluser]Dizza[/eluser]
Wow, thanks! That worked out my problem! Do you maybe know how i can get that id to work? I need to echo it, if its possible! Thanks! Edit: Hmm i found out to echo the uri, but it wont echo the 3 one. Only the first(home) if i state that it should echo Code: <?php $id = $this->uri->segment(3);?> i dont see anything Anyone knows where it goes wrong? Could it be that i am stating the wrong uripath?
[eluser]Cristian Gilè[/eluser]
Could you be more clear? If your full URL is: Code: http://example.com/index.php/news/local/metro/crime_is_up news is the segment 1 local is the segment 2 metro is the segment 3 crime_is_up is the segment 4 so, if you echo Code: $this->uri->segemnt(2); it will ouptput local if you echo Code: $this->uri->segemnt(4); it will output crime_is_up...and so on. If your full URL is: Code: http://example.com/index.php/news/local and you echo Code: $this->uri->segemnt(3); the third segment is missing and the function returns FALSE. If you echo Code: $this->uri->segemnt(3,0); because the third segment is missing, it will output 0. Please, read the user guide. Cristian Gilè
[eluser]Dizza[/eluser]
Im sorry, the thing is that if i echo: Code: <?php echo $this->uri->segemnt(1,0); ?> Code: home It grabs the first segment, which is home: http://jtbfolio.nl/cms/index.php/home/#_Meer/129 if i echo Code: <?php echo $this->uri->segemnt(2,0); ?> But it should be #_Meer http://jtbfolio.nl/cms/index.php/home/#_Meer/129 If i echo Code: <?php echo $this->uri->segemnt(3,0); ?> But it should be 129 http://jtbfolio.nl/cms/index.php/home/#_Meer/129 Could it be because i added the #_Meer part in my controller? Code: redirect('home/#_Meer/'.$id); Hope i explained it better this time btw, you can also see what i mean @ http://jtbfolio.nl/cms/index.php/home/#_Home > voorgerechten and then click the link under the price.
[eluser]Dizza[/eluser]
hmm i keep getting the same problem as above, i almost tried everything, anyone got a clue?
[eluser]Cristian Gilè[/eluser]
Quote:A valid function name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*. Change the name of the #_Meer function Cristian Gilè |
Welcome Guest, Not a member yet? Register Sign In |