CHttpRequest::getPost() checks if the first parameter exists, and if it does not return a default value that you can pass to it.
Here is its actual implementation:
public function getPost($name,$defaultValue=null)
{
return isset($_POST[$name]) ? $_POST[$name] : $defaultValue;
}
source
share