本文整理汇总了PHP中JError::handleEcho方法的典型用法代码示例。如果您正苦于以下问题:PHP JError::handleEcho方法的具体用法?PHP JError::handleEcho怎么用?PHP JError::handleEcho使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JError
的用法示例。
在下文中一共展示了JError::handleEcho方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConnection
/**
* @since 3.0b
* helper function get get a connection
* @param mixed - a list table or connection id
*/
public function getConnection($item = null)
{
$jform = JRequest::getVar('jform', array(), 'post');
if (is_object($item)) {
$item = is_null($item->connection_id) ? JArrayHelper::getValue($jform, 'connection_id', -1) : $item->connection_id;
}
$connId = (int) $item;
$config = JFactory::getConfig();
if (!self::$connection) {
self::$connection = array();
}
if (!array_key_exists($connId, self::$connection)) {
$connectionModel = JModel::getInstance('connection', 'FabrikFEModel');
$connectionModel->setId($connId);
if ($connId === -1) {
//-1 for creating new table
$connectionModel->loadDefaultConnection();
$connectionModel->setId($connectionModel->getConnection()->id);
}
$connection = $connectionModel->getConnection();
self::$connection[$connId] = $connectionModel;
if (JError::isError(self::$connection[$connId])) {
JError::handleEcho(self::$connection[$connId]);
}
}
return self::$connection[$connId];
}
示例2: array
/**
* function get the tables connection object
* sets $this->_oConn to the tables connection
* @return object connection
*/
function &getConnection()
{
$config = JFactory::getConfig();
if (!isset($this->_oConn)) {
$table =& $this->getTable();
$connectionModel = JModel::getInstance('connection', 'FabrikFEModel');
$jform = JRequest::getVar('jform', array(), 'post');
$connId = is_null($table->connection_id) ? JArrayHelper::getValue($jform, 'connection_id', null) : $table->connection_id;
$connectionModel->setId($connId);
if ($connId == '' || is_null($connId) || $connId == '-1') {
//-1 for creating new table
$connectionModel->loadDefaultConnection();
$connectionModel->setId($connectionModel->getConnection()->id);
}
$connection =& $connectionModel->getConnection();
$this->_oConn =& $connectionModel;
if (JError::isError($this->_oConn)) {
JError::handleEcho($this->_oConn);
}
}
return $this->_oConn;
}