本文整理汇总了PHP中JModel::populateState方法的典型用法代码示例。如果您正苦于以下问题:PHP JModel::populateState方法的具体用法?PHP JModel::populateState怎么用?PHP JModel::populateState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JModel
的用法示例。
在下文中一共展示了JModel::populateState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @since 1.6
*/
protected function populateState()
{
// Load the parameters.
$params = JComponentHelper::getParams('com_patchtester');
$this->setState('params', $params);
$this->setState('github_user', $params->get('org', 'joomla'));
$this->setState('github_repo', $params->get('repo', 'joomla-cms'));
parent::populateState();
}
示例2: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @since 1.6
*/
protected function populateState()
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
$this->setState('message', $app->getUserState('com_installer.message'));
$this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
$app->setUserState('com_installer.message', '');
$app->setUserState('com_installer.extension_message', '');
// Recall the 'Install from Directory' path.
$path = $app->getUserStateFromRequest($this->_context . '.install_directory', 'install_directory', $app->getCfg('tmp_path'));
$this->setState('install.directory', $path);
parent::populateState();
}
示例3: populateState
/**
* populateState
*
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @since 1.6
*/
protected function populateState()
{
/** messages **/
$this->setState('message', JFactory::getApplication()->getUserState('com_jfoobar.message'));
$this->setState('extension_message', JFactory::getApplication()->getUserState('com_jfoobar.extension_message'));
JFactory::getApplication()->setUserState('com_jfoobar.message', '');
JFactory::getApplication()->setUserState('com_jfoobar.extension_message', '');
/** extension type **/
$this->setState('create.createtype', JRequest::getCmd('createtype', 'component'));
/** module **/
$this->setState('create.module_name', JRequest::getCmd('module_name', ''));
/** plugin **/
$this->setState('create.plugin_name', JRequest::getCmd('plugin_name', ''));
$this->setState('create.plugin_type', JRequest::getCmd('plugin_type', 'content'));
parent::populateState();
}
示例4: populateState
/**
* @param null $ordering
* @param null $direction
*/
protected function populateState($ordering = null, $direction = null)
{
// Adjust the context to support modal layouts.
if ($layout = JRequest::getVar('layout')) {
$this->context .= '.' . $layout;
}
//$search = $this->getUserStateFromRequest($this->context . 'filter.published', 'filter_published');
// /$this->setState('tag.filter.search', $search);
// List state information.
parent::populateState('a.title', 'asc');
}