Skip to content
Advertisement

Tag: action

Yii2: Controller action parameters with a dash?

If I have a URL like https://example.com/controller/action?customer-id=7414 how do I get customer-id in my action parameters? Since a dash is not allowed in variables names I cannot do the following! Documentation is usually excellent but on this exact point it’s just silent. How do I solve this? Answer When yiiwebController calls action it only binds parameters which names match exactly.

how to pass form data to controller

I am not getting how to pass data to the controller to update data, below I have given code. // below is my jquery which I am using to pass form data to the controller. // below is my route // inside controller I am having a function called edit profile Answer Is your form method set to ‘POST’? If

php form action php self

I have a php form like this. In form action I want to use page name with parameters. like house.php?p_id=10111 . But $_SERVER[‘PHP_SELF’] gives only the house.php (My page full url is house.php?p_id=10111 like this) Please help me to solve this problem. thanks. Answer How about leaving it empty, what is wrong with that? Also, you can omit the action

Advertisement