本文整理匯總了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');
}