controller/action using POST instead of GET


Is it possible to specify which controller/action should be invoked using POST instead of GET?


two ways you can invoke POST request to server:

  1. form request:

<form action="<?php echo $this->createUrl(‘controller/action’); ?>" method=“get/post”>

  1. ajax

 url = "<?php echo $this->createUrl('controller/action'); ?>";

         params = {

            'p1': someVaule,

             'pX': valX,





If you are using a CActiveForm widget then you can set the method property in the instantiation options of beginWidget().