![]() |
parameter passing from view to controller via anchor - 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: parameter passing from view to controller via anchor (/showthread.php?tid=44233) |
parameter passing from view to controller via anchor - El Forum - 08-08-2011 [eluser]Lakshminarayanank[/eluser] Hi all... I am a fresher to CI.. using with mysql I am facing a difficulty in passing and accessing the parameter. here is ma code.. in a view : $d = array('proj_id'=>$pid) echo anchor('aims/view_project',$pid,$d) in controller am accessing it.. function view_project() { echo 'project no is' .$proj_id; } Am getting undefined symbol proj_id error message .. i got helg up there... pls help me...!! parameter passing from view to controller via anchor - El Forum - 08-08-2011 [eluser]danmontgomery[/eluser] Code: echo anchor('aims/view_project/'.$pid, 'Link'); http://ellislab.com/codeigniter/user-guide/general/urls.html parameter passing from view to controller via anchor - El Forum - 08-08-2011 [eluser]Lakshminarayanank[/eluser] No.. :-( I am getting a warning as missing argument and an error for using indefined variable ($pid)... parameter passing from view to controller via anchor - El Forum - 08-08-2011 [eluser]Bart v B[/eluser] Take a look at your url.. Code: $this->load->helper('url'); parameter passing from view to controller via anchor - El Forum - 08-08-2011 [eluser]OliverHR[/eluser] Is as noctrum say. parameter passing from view to controller via anchor - El Forum - 08-08-2011 [eluser]OliverHR[/eluser] In the view as noctrum say: Code: echo anchor('your_controller/your_function/'.$pid, 'Link text'); On the controller: Code: function your_function($proj_id) // check your parameters names parameter passing from view to controller via anchor - El Forum - 08-09-2011 [eluser]Lakshminarayanank[/eluser] thank you guys... thats superb.... and i wanna pass an argument from controller to a model... how can i do that...?! plz help me...!! parameter passing from view to controller via anchor - El Forum - 08-09-2011 [eluser]OliverHR[/eluser] ??? No offense man but, It could be better if you read first the documentation and a good php book. parameter passing from view to controller via anchor - El Forum - 08-09-2011 [eluser]Lakshminarayanank[/eluser] hmmm ya.... could you pls suggest me some good books for php.... so that i can work well with codeigniter.... plz help.. as i said.. am new to this area.... parameter passing from view to controller via anchor - El Forum - 08-10-2011 [eluser]OliverHR[/eluser] Well look at this titles. Beginning PHP5 Wrox Press PHP 5 Power Programming PRENTICE HALL Object-Oriented Programming with PHP5 Packt Publishing PHP Objects, Patterns, and Practice Apress Pro PHP Patterns, Frameworks, Testing and More Apress ---------- And of course the CI docs: http://ellislab.com/codeigniter/user-guide/ |