Welcome Guest, Not a member yet? Register   Sign In
anchor; get method; ?
#1

[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 Sad ????
#2

[eluser]Samus[/eluser]
i'm going to assume you're not actually sending anything through the GET array.

Post what your url looks like.
#3

[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"
#4

[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 {

function test($param)
echo $param;
}

Then your url looks like this:

www.site.com/controller/test/samus

if I entered that url, the controller will echo 'samus'.
#5

[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!
#6

[eluser]PankajBalani[/eluser]
ok sorry that was really dumb of me...you had already answered that.

thanks it has been great help! Smile




Theme © iAndrew 2016 - Forum software by © MyBB