D
D
des1roer2015-04-10 11:10:59
Yii
des1roer, 2015-04-10 11:10:59

Yii Post request to current page?

in php constantly used post requests. and in yii even everything goes through controllers, ajax and so on.
how mona implement the following

<form id="newForm"  method="post">
<input type="submit" name="ex" value="Excel" onclick="document.getElementById("newForm").submit()">
  </form>

if(isset($_POST["ex"])) 
    {
      header('Content-Type: text/x-csv; charset=utf-8');
      header("Content-Disposition: attachment;filename=".date("d-m-Y")."-export.xls");
      header("Content-Transfer-Encoding: binary ");
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sharov Dmitry, 2015-04-10
@vlom88

https://github.com/yiisoft/yii2/blob/master/docs/g...
https://github.com/yiisoft/yii2/blob/master/docs/g...
and it might be useful there will be routing
https://github.com/yiisoft/yii2/blob/master/docs/g...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question