1
votes

How to set and retrieve error inside component in model I have:

  if (empty($coupon->coupon_id))
    {
        $this->setError( JText::_( "Invalid Coupon" ) );
        return false;
    }

How to retrieve this error inside controller? this->getError gives nothing :(

Thanks

2

2 Answers

2
votes

Do you want to return the error to the screen?

If so, http://docs.joomla.org/Display_error_messages_and_notices

1
votes

In your controller you need to invoke your model and use the $model->getError(); function instead of $this->getError();