开发者

Error handling custom component Joomla

开发者 https://www.devze.com 2023-02-07 04:25 出处:网络
How to set and retrieve error inside component in model I have: if (empty开发者_JAVA百科($coupon->coupon_id))

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

  if (empty开发者_JAVA百科($coupon->coupon_id))
    {
        $this->setError( JText::_( "Invalid Coupon" ) );
        return false;
    }

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

Thanks


Do you want to return the error to the screen?

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消