本文整理汇总了PHP中JApplicationCms::getParams方法的典型用法代码示例。如果您正苦于以下问题:PHP JApplicationCms::getParams方法的具体用法?PHP JApplicationCms::getParams怎么用?PHP JApplicationCms::getParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JApplicationCms
的用法示例。
在下文中一共展示了JApplicationCms::getParams方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Execute the controller.
*
* @return boolean True if controller finished execution, false if the controller did not
* finish execution. A controller might return false if some precondition for
* the controller to run has not been satisfied.
*
* @since 12.1
* @throws LogicException
* @throws RuntimeException
*/
public function execute()
{
$model = new MonitorModelIssue();
$id = $this->input->getInt('id');
$user = JFactory::getUser();
// Get the params
// TODO: may be removed when new MVC is implemented completely
$this->app = JFactory::getApplication();
if ($this->app instanceof JApplicationSite) {
$params = $this->app->getParams();
}
if (!$model->canEdit($user, $id)) {
if ($user->guest && isset($params) && $params->get('redirect_login', 1)) {
$this->app->enqueueMessage(JText::_('JGLOBAL_YOU_MUST_LOGIN_FIRST'), 'error');
$this->app->redirect(JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode(JUri::getInstance()->toString()), '403'));
} else {
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}
}
if ($id) {
$model->setIssueId($id);
}
$model->loadForm();
$view = new MonitorViewIssueHtml($model);
$view->setLayout('edit');
$view->loadForm();
echo $view->render();
return true;
}
示例2: getParams
/**
* Get the configuration for the component and (if given) the active menu item.
*
* TODO: may be removed when new MVC is implemented completely
*
* @return \Joomla\Registry\Registry Object containing the parameters.
*/
public function getParams()
{
if ($this->app instanceof JApplicationSite) {
$params = $this->app->getParams();
$active = $this->app->getMenu()->getActive();
if ($active) {
$params->merge($active->params);
}
} else {
$params = JComponentHelper::getParams('com_monitor');
}
return $params;
}
示例3: populateState
/**
* Set model sate
*
* @return void
*/
protected function populateState()
{
$input = $this->app->input;
if (!$this->app->isAdmin()) {
// Load the menu item / component parameters.
$params = $this->app->getParams();
$this->setState('params', $params);
// Load state from the request.
$pk = $input->getInt('listid', $params->get('listid'));
} else {
$pk = $input->getInt('listid');
}
$this->setState('list.id', $pk);
$offset = $input->getInt('limitstart');
$this->setState('list.offset', $offset);
}