I have a model's field like this:
$xmlDocument->masterInformation->nextPage->prefix
this field is not required.
I want to check if that field is empty or not
I do this:
if(trim($xmlDocument->masterInformation->nextPage->prefix)){
$data['NextPage']['prefix'] = $xmlDocument->masterInformation->nextPage->prefix;
}
but the if
statement is never becomming true though when I echo
that field, i got data.
what am i missing please?