Reputation: 2760
I know that you can use anchor_popup() to open up a new window in codeigniter, but what i cant figure out is how to pass values using that.
Here is the code i am using,
$attr = array('width'=>'800','height'=>'700');
echo anchor_popup('friends/'.$uid.'/'.$suid.'','add as friend',$attr);
Now i get a popup window which links to friends/34/34 where friends is a controller and rest are values which i want to give to my controller. but iam getting an error 404,
404 Page Not Found The page you requested was not found. I am using uri segment to grab the values.
Could any tell me what i am doing wrong?
Upvotes: 1
Views: 6537
Reputation: 17977
the link friends/34/34/
is looking for a controller called "friends" and a method called "34", hence why it can't be found.
If your friends
controller has no other methods, then change the link to this:
echo anchor_popup('friends/index/'.$uid.'/'.$suid,'add as friend',$attr);
else, add the appropriate method.
Upvotes: 2