CodeIgniter Forums
Problem to pass an argument to a function - 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: Problem to pass an argument to a function (/showthread.php?tid=54574)



Problem to pass an argument to a function - El Forum - 09-14-2012

[eluser]Diegosf93[/eluser]
I have a problem to pass an argument to a function look i have this view file:

Code:
<table>
<tr>
<th>Nombre</th>
<th>Apellido</th>
<th>Empresa</th>
<th>Usuario</th>
<th>Password</th>
<th>-</th>
</tr>

&lt;?php foreach ($usuarios as $usuario): ?&gt;

<tr>

<td>&lt;?= $usuario->nombre ?&gt;</td>
<td>&lt;?= $usuario->apellido ?&gt;</td>
<td>&lt;?= $usuario->empresa ?&gt;</td>
<td>&lt;?= $usuario->usuario ?&gt;</td>
<td>&lt;?= $usuario->password ?&gt;</td>
<td>
&lt;?php echo anchor('Panel_Admin/Modify_Usuario', 'Modificar');
    echo "-";
    echo anchor('Panel_Admin/Eliminar_USuario', 'Borrar');?&gt;</td>
</tr>

&lt;?php endforeach;?&gt;



</table>

So i want to modify an user and call a function in the controller and i want to pass it the id of the user to load his information, but i dont know how to pass it to the function.



Problem to pass an argument to a function - El Forum - 09-14-2012

[eluser]CroNiX[/eluser]
The user guide on Views covers that.


Problem to pass an argument to a function - El Forum - 09-17-2012

[eluser]Diegosf93[/eluser]
Yes i see it, the problems was in the concatenation of the arguments, thanks!