处理自定义组件Joomla时出错

时间:2011-01-27 10:13:22

标签: joomla

如何设置和检索模型中组​​件内的错误:

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

如何在控制器内检索此错误? this-> getError什么都没有:(

谢谢

2 个答案:

答案 0 :(得分:2)

您要将错误返回到屏幕吗?

如果是,http://docs.joomla.org/Display_error_messages_and_notices

答案 1 :(得分:1)

在你的控制器中你需要调用你的模型并使用$ model-> getError();函数而不是$ this-> getError();

相关问题