本文整理汇总了PHP中JError::handleMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP JError::handleMessage方法的具体用法?PHP JError::handleMessage怎么用?PHP JError::handleMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JError
的用法示例。
在下文中一共展示了JError::handleMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* display the template
*
* @param sting $tpl
*/
function display($tpl = null)
{
FabrikHelperHTML::framework();
$element = JRequest::getVar('element');
$elementid = JRequest::getVar('elid');
$pluginManager = JModel::getInstance('Pluginmanager', 'FabrikFEModel');
$className = JRequest::getVar('plugin');
$plugin = $pluginManager->getPlugIn($className, 'element');
if (JError::isError($plugin)) {
JError::handleMessage($plugin);
return;
}
$plugin->setId($elementid);
$data = array();
$repeatCounter = 0;
$groupModel = $plugin->getGroup();
$srcs = array();
$plugin->formJavascriptClass($srcs);
echo "srcs = ";
print_r($srcs);
FabrikHelperHTML::script($srcs, true);
$html = '<script>';
$html .= $plugin->elementJavascript($repeatCounter);
$html .= '</script>';
$html .= $plugin->_getElement($data, $repeatCounter, $groupModel);
echo $html;
}
示例2: _loadPlugin
/**
* @param string group name (currently only 'element' is supported)
* @param object database row of plugin info
* @return bol true if loaded ok
*/
function _loadPlugin($group, &$row)
{
if (!is_object($row)) {
return false;
}
$folder = $row->type;
$element = $row->name;
$published = $row->state;
$params = $row->params;
$p = COM_FABRIK_FRONTEND . DS . 'plugins' . DS . $folder . DS . $element . DS;
$path = $p . $element . '.php';
$xmlPath = $p . $element . '.xml';
JModel::getInstance('Element', 'FabrikModel');
JModel::getInstance('Plugin', 'FabrikModel');
JModel::getInstance('Visualization', 'FabrikModel');
$this->_loadPaths($group, $element);
$plugIn =& JModel::getInstance($element, 'FabrikModel');
if (!is_object($plugIn)) {
//plugin filename / folder name incorrect
JError::raiseWarning(500, 'Could not load the fabrik plugin: ' . $element);
return false;
}
if (JError::isError($plugIn)) {
JError::handleMessage($plugIn);
return false;
}
$plugIn->row = $row;
$plugIn->_type = $folder;
$plugIn->_pluginLabel = $row->label;
$plugIn->_xmlPath = $xmlPath;
$this->_plugIns[$group][$element] =& $plugIn;
$plugIn->_loading = null;
return true;
}