Skip to content
Advertisement

Tag: controller

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.

Show PDF without path in URL

Refer to Can an ASP.NET MVC controller return an Image? , the answer suggest to return image file from controller in C#. My question is: Can I do the same thing or similar in PHP? What I want is to hide PDF path from URL. Thanks Answer I think you are trying to hide the real local path of your

Advertisement