0

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'].

0

1 Answer 1

2

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) 
Sign up to request clarification or add additional context in comments.

1 Comment

this solution is ok if all the data are specified. What if your first parameter is, for example, null and you only want to pass the second one? Then this scenario won't work. To be honest I do not know how to do it better, any other idea?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.