I want to check in zend, whether a posted form value 'name' contains a value.For this i have used the following code
one method
if ($this->_getPatram('name') != null ) {
echo 'field name contains value';
} else {
echo 'field name contains null value';
}
second method
if ($this->_hasParam('name')) {
echo 'field name contains value';
} else {
echo 'field name contains null value';
}
output , when submitting the form with the 'name' field contains null value
in first method
field name contains null value (result is correct)
in second method
field name contains value (result is wrong)
So what is the difference between these two ? _hasParam and _getParam