I have strange problem. I created a link:
<a href="/module/default/editEvent" style="font-size: 14px;">Edit Event</a>
and an action
public function actionEditEvent(){
if(isset($_POST)){
echo '<pre>';
print_r($_POST);
die;
}
$this->render('editEvent');
}
when I click on link it prints blank array.
Can anyone tell me reason for that?<

$_POSTis a superglobal array, so it will always be set regardless whether it has any value or not. Useempty()instead. You can also use$_SERVER['REQUEST_METHOD']as suggested by Alexander Taver