简体   繁体   中英

How to pass multiple parameters from view to controller?

If function in the controller waits one parameter, works fine:

<a href="<?=  base_url()?>blog/edit_user/<?=$row['username']?>"><span class="glyphicon glyphicon-edit" title="Edit user"></span></a>

But I need to pass $row['username'] and $post['post_id'].

If you want to pass multiple parameter to controller use below line

<a href="<?=  base_url()?>blog/edit_user/<?=$row['username'].'/'.$post['post_id']; ?>"><span class="glyphicon glyphicon-edit" title="Edit user"></span></a>

In your controller

Function edit_user($param1, $param2) 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM