CodeIgniter Forums
simple get() question - 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: simple get() question (/showthread.php?tid=51581)



simple get() question - El Forum - 05-09-2012

[eluser]jordantkj[/eluser]
Hi,
I have the following code in my view. When I click the link, I get sent to the appropriate page. The only thing that I can't figure out is how to access the variable from part_details. I know I'm supposed to use
Code:
$this->input->get();

Code:
echo '<tr><td class="pic_title" align="center">' .
     anchor("welcome/part_details", $fpc[$f]['type'], "sn='1234'");
echo '</td></tr>';

part_details
Code:
echo $this->input->get();

I've tried a million variations of the above. I know I'm doing something wrong, just not sure what it is. Any ideas?

-Tyler


simple get() question - El Forum - 05-09-2012

[eluser]weboap[/eluser]
try
Code:
anchor("welcome/part_details/".$fpc[$f]['sn'], $fpc[$f]['type'], "sn='1234'");

$fpc[$f]['sn'] should output the 1234 (the part sn pulled from your table)
in the controller function part_details()

do
Code:
$part_number = $this->uri->segment(3);
use then $part_number to look the part record in the part table, and show the details...



simple get() question - El Forum - 05-09-2012

[eluser]InsiteFX[/eluser]
Try using the code tags!



simple get() question - El Forum - 05-10-2012

[eluser]jordantkj[/eluser]
Thanks for the help, the URI method worked. I don't even need the extra attribute at the end. It would be nice if the CI documentation mention this when discussing get(). The URI documentation is fine, but it doesn't make a connection between the two, strange.