anchor; get method; ? |
[eluser]PankajBalani[/eluser]
I have the following in my view: <?php echo anchor('lb/test', $row->name, array('rowName'=>$row->Name)); ?> and in the lb controller public function test(){ $namearray['name'] = $this->input->get('rowName'); $this->load->view('newView',$namearray); } On 'newview' I have: <html><body>You clicked on <?php echo $name; ?> </body></html> doesn't work ????
[eluser]Samus[/eluser]
i'm going to assume you're not actually sending anything through the GET array. Post what your url looks like.
[eluser]PankajBalani[/eluser]
[quote author="Samus" date="1337418133"]i'm going to assume you're not actually sending anything through the GET array. Post what your url looks like.[/quote] yeah i just realized that i am not sending any info to get. So my question should be how to send some info to controller when user clicks a link. url looks like "www...../lb/test"
[eluser]Samus[/eluser]
[quote author="PankajBalani" date="1337418772"] So my question should be how to send some info to controller when user clicks a link. url looks like "www...../lb/test" [/quote] Have your controller accept a parameter. If you have a controller like this: Code: Controller extends CI_Controller { Then your url looks like this: www.site.com/controller/test/samus if I entered that url, the controller will echo 'samus'.
[eluser]PankajBalani[/eluser]
how does my anchor link look like in this case?? <?php echo anchor(‘lb/test’, $row->name, array(‘rowName’=>$row->Name)); ?> sorry for asking basic questions!
[eluser]PankajBalani[/eluser]
ok sorry that was really dumb of me...you had already answered that. thanks it has been great help! |
Welcome Guest, Not a member yet? Register Sign In |