本文整理汇总了PHP中JComponentHelper::renderComponent方法的典型用法代码示例。如果您正苦于以下问题:PHP JComponentHelper::renderComponent方法的具体用法?PHP JComponentHelper::renderComponent怎么用?PHP JComponentHelper::renderComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JComponentHelper
的用法示例。
在下文中一共展示了JComponentHelper::renderComponent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dispatch
/**
* Dispatch the application
*
* @param string $component The component which is being rendered.
*
* @return void
*
* @since 3.2
*/
public function dispatch($component = null)
{
if ($component === null) {
$component = JAdministratorHelper::findOption();
}
// Load the document to the API
$this->loadDocument();
// Set up the params
$document = JFactory::getDocument();
// Register the document object with JFactory
JFactory::$document = $document;
switch ($document->getType()) {
case 'html':
$document->setMetaData('keywords', $this->get('MetaKeys'));
// Get the template
$template = $this->getTemplate(true);
// Store the template and its params to the config
$this->set('theme', $template->template);
$this->set('themeParams', $template->params);
break;
default:
break;
}
$document->setTitle($this->get('sitename') . ' - ' . JText::_('JADMINISTRATION'));
$document->setDescription($this->get('MetaDesc'));
$document->setGenerator('Joomla! - Open Source Content Management');
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('system');
$this->triggerEvent('onAfterDispatch');
}
示例2: dispatch
/**
* Dispatch the application.
*
* Dispatching is the process of pulling the option from the request object and
* mapping them to a component. If the component does not exist, it handles
* determining a default component to dispatch.
*
* @param string $component The component to dispatch.
*
* @return void
*
* @since 11.1
* @deprecated 4.0
*/
public function dispatch($component = null)
{
$document = JFactory::getDocument();
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('system');
$this->triggerEvent('onAfterDispatch');
}
示例3: dispatch
/**
* Dispatch the application
*
* @param string
*/
public function dispatch($component = null)
{
// Get the component if not set.
if (!$component) {
$component = $this->input->get('option');
}
$document = JFactory::getDocument();
$router = $this->getRouter();
$params = $this->getParams();
switch ($document->getType()) {
case 'html':
// Get language
$lang_code = JFactory::getLanguage()->getTag();
$languages = JLanguageHelper::getLanguages('lang_code');
// Set metadata
if (isset($languages[$lang_code]) && $languages[$lang_code]->metakey) {
$document->setMetaData('keywords', $languages[$lang_code]->metakey);
} else {
$document->setMetaData('keywords', $this->getCfg('MetaKeys'));
}
$document->setMetaData('rights', $this->getCfg('MetaRights'));
if ($router->getMode() == JROUTER_MODE_SEF) {
$document->setBase(htmlspecialchars(JUri::current()));
}
break;
case 'feed':
$document->setBase(htmlspecialchars(JUri::current()));
break;
}
$document->setTitle($params->get('page_title'));
$document->setDescription($params->get('page_description'));
// Add version number or not based on global configuration
if ($this->getCfg('MetaVersion', 0)) {
$document->setGenerator('Joomla! - Open Source Content Management - Version ' . JVERSION);
} else {
$document->setGenerator('Joomla! - Open Source Content Management');
}
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('system');
$this->triggerEvent('onAfterDispatch');
}
示例4: dispatch
/**
* Dispatch the application
*
* @access public
*/
function dispatch($component)
{
$document =& JFactory::getDocument();
$user =& JFactory::getUser();
switch ($document->getType()) {
case 'html':
$document->setMetaData('keywords', $this->getCfg('MetaKeys'));
if ($user->get('id')) {
$document->addScript(JURI::root(true) . '/includes/js/joomla.javascript.js');
}
JHTML::_('behavior.mootools');
break;
default:
break;
}
$document->setTitle(htmlspecialchars_decode($this->getCfg('sitename')) . ' - ' . JText::_('Administration'));
$document->setDescription($this->getCfg('MetaDesc'));
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
}
示例5: dispatch
/**
* Dispatch the application
*
* @param string
*/
public function dispatch($component = null)
{
try {
// Get the component if not set.
if (!$component) {
$component = JRequest::getCmd('option');
}
$document = JFactory::getDocument();
$user = JFactory::getUser();
$router = $this->getRouter();
$params = $this->getParams();
switch ($document->getType()) {
case 'html':
// Get language
$lang_code = JFactory::getLanguage()->getTag();
$languages = JLanguageHelper::getLanguages('lang_code');
// Set metadata
if (isset($languages[$lang_code]) && $languages[$lang_code]->metakey) {
$document->setMetaData('keywords', $languages[$lang_code]->metakey);
} else {
$document->setMetaData('keywords', $this->getCfg('MetaKeys'));
}
$document->setMetaData('rights', $this->getCfg('MetaRights'));
if ($router->getMode() == JROUTER_MODE_SEF) {
$document->setBase(htmlspecialchars(JURI::current()));
}
break;
case 'feed':
$document->setBase(htmlspecialchars(JURI::current()));
break;
}
$document->setTitle($params->get('page_title'));
$document->setDescription($params->get('page_description'));
// Add version number or not based on global configuration
if ($this->getCfg('MetaVersion', 0)) {
$document->setGenerator('HUBzero - The open source platform for scientific and educational collaboration (version ' . \Hubzero\Version\Version::VERSION . ')');
} else {
$document->setGenerator('HUBzero - The open source platform for scientific and educational collaboration');
}
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('system');
$this->triggerEvent('onAfterDispatch');
} catch (Exception $e) {
$code = $e->getCode();
JError::raiseError($code ? $code : 500, $e->getMessage());
}
}
示例6: dispatch
/**
* Dispatch the application
*
* @param string $component The component to dispatch.
*
* @return void
* @since 1.5
*/
public function dispatch($component = null)
{
try {
if ($component === null) {
$component = JAdministratorHelper::findOption();
}
$document = JFactory::getDocument();
$user = JFactory::getUser();
switch ($document->getType()) {
case 'html':
$document->setMetaData('keywords', $this->getCfg('MetaKeys'));
break;
default:
break;
}
$document->setTitle($this->getCfg('sitename') . ' - ' . JText::_('JADMINISTRATION'));
$document->setDescription($this->getCfg('MetaDesc'));
$document->setGenerator('Jokte! - CMS Lationamericano Cien por Ciento Libre');
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('system');
$this->triggerEvent('onAfterDispatch');
} catch (Exception $e) {
$code = $e->getCode();
JError::raiseError($code ? $code : 500, $e->getMessage());
}
}
示例7: dispatch
/**
* Dispatch the application
*
* @param string $component The component which is being rendered.
*
* @return void
*
* @since 3.2
*/
public function dispatch($component = null)
{
// Get the component if not set.
if (!$component) {
$component = $this->input->getCmd('option', null);
}
// Load the document to the API
$this->loadDocument();
// Set up the params
$document = $this->getDocument();
$router = static::getRouter();
$params = $this->getParams();
// Register the document object with JFactory
JFactory::$document = $document;
switch ($document->getType()) {
case 'html':
// Get language
$lang_code = $this->getLanguage()->getTag();
$languages = JLanguageHelper::getLanguages('lang_code');
// Set metadata
if (isset($languages[$lang_code]) && $languages[$lang_code]->metakey) {
$document->setMetaData('keywords', $languages[$lang_code]->metakey);
} else {
$document->setMetaData('keywords', $this->get('MetaKeys'));
}
$document->setMetaData('rights', $this->get('MetaRights'));
if ($router->getMode() == JROUTER_MODE_SEF) {
$document->setBase(htmlspecialchars(JUri::current()));
}
// Get the template
$template = $this->getTemplate(true);
// Store the template and its params to the config
$this->set('theme', $template->template);
$this->set('themeParams', $template->params);
break;
case 'feed':
$document->setBase(htmlspecialchars(JUri::current()));
break;
}
$document->setTitle($params->get('page_title'));
$document->setDescription($params->get('page_description'));
// Add version number or not based on global configuration
if ($this->get('MetaVersion', 0)) {
$document->setGenerator('Joomla! - Open Source Content Management. Translated by JoomlaFarsi.com - Version ' . JVERSION);
} else {
$document->setGenerator('Joomla! - Open Source Content Management. Translated by JoomlaFarsi.com');
}
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('system');
$this->triggerEvent('onAfterDispatch');
}
示例8: dispatch
/**
* Dispatch the application
*
* @param string $component The component to dispatch.
*
* @return void
* @since 1.5
*/
public function dispatch($component = null)
{
if ($component === null) {
$component = JAdministratorHelper::findOption();
}
$document = JFactory::getDocument();
switch ($document->getType()) {
case 'html':
$document->setMetaData('keywords', $this->getCfg('MetaKeys'));
break;
default:
break;
}
$document->setTitle($this->getCfg('sitename') . ' - ' . JText::_('JADMINISTRATION'));
$document->setDescription($this->getCfg('MetaDesc'));
$document->setGenerator('Joomla! - Open Source Content Management');
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('system');
$this->triggerEvent('onAfterDispatch');
}
示例9: dispatch
/**
* Dispatch the application
*
* @access public
*/
function dispatch($component)
{
$document =& JFactory::getDocument();
$user =& JFactory::getUser();
$router =& $this->getRouter();
$params =& $this->getParams();
switch($document->getType())
{
case 'html':
{
if ( $user->get('id') ) {
$document->addScript( JURI::root(true).'/media/system/js/legacy.js');
}
if($router->getMode() == JROUTER_MODE_SEF) {
$document->setBase(JURI::current());
}
} break;
case 'feed':
{
$document->setBase(JURI::current());
} break;
default: break;
}
$document->setTitle( $params->get('page_title') );
$document->setDescription( $params->get('page_description') );
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer( $contents, 'component');
}
示例10: dispatch
/**
* Dispatch the application
*
* @param string
*/
public function dispatch($component = null)
{
try {
// Get the component if not set.
if (!$component) {
$component = JRequest::getCmd('option');
}
$document = JFactory::getDocument();
$user = JFactory::getUser();
$router = $this->getRouter();
$params = $this->getParams();
switch ($document->getType()) {
case 'html':
// Get language
$lang_code = JFactory::getLanguage()->getTag();
$languages = JLanguageHelper::getLanguages('lang_code');
// Set metadata
if (isset($languages[$lang_code]) && $languages[$lang_code]->metakey) {
$document->setMetaData('keywords', $languages[$lang_code]->metakey);
} else {
$document->setMetaData('keywords', $this->getCfg('MetaKeys'));
}
$document->setMetaData('rights', $this->getCfg('MetaRights'));
$document->setMetaData('language', $lang_code);
if ($router->getMode() == JROUTER_MODE_SEF) {
$document->setBase(JURI::current());
}
break;
case 'feed':
$document->setBase(JURI::current());
break;
}
$document->setTitle($params->get('page_title'));
$document->setDescription($params->get('page_description'));
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('system');
$this->triggerEvent('onAfterDispatch');
} catch (Exception $e) {
$code = $e->getCode();
JError::raiseError($code ? $code : 500, $e->getMessage());
}
}
示例11: dispatch
/**
* Dispatch the application
*
* @access public
*/
function dispatch($component)
{
$document =& JFactory::getDocument();
$user =& JFactory::getUser();
$router =& $this->getRouter();
$params =& $this->getParams();
switch ($document->getType()) {
case 'html':
//set metadata
$document->setMetaData('keywords', $this->getCfg('MetaKeys'));
if ($user->get('id')) {
$document->addScript(JURI::root(true) . '/includes/js/joomla.javascript.js');
}
if ($router->getMode() == JROUTER_MODE_SEF) {
$document->setBase(JURI::current());
}
break;
case 'feed':
$document->setBase(JURI::current());
break;
default:
break;
}
$document->setTitle($params->get('page_title'));
$document->setDescription($params->get('page_description'));
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
}
示例12: dispatch
/**
* Dispatch the application
*
* @param string
*/
public function dispatch($component = null)
{
// Get the component if not set.
if (!$component) {
$component = JRequest::getCmd('option');
}
$document =& JFactory::getDocument();
$user =& JFactory::getUser();
$router =& $this->getRouter();
$params =& $this->getParams();
switch ($document->getType()) {
case 'html':
//set metadata
$document->setMetaData('keywords', $this->getCfg('MetaKeys'));
if ($router->getMode() == JROUTER_MODE_SEF) {
$document->setBase(JURI::current());
}
break;
case 'feed':
$document->setBase(JURI::current());
break;
}
$document->setTitle($params->get('page_title'));
$document->setDescription($params->get('page_description'));
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('system');
$this->triggerEvent('onAfterDispatch');
}
示例13: dispatch
/**
* Dispatch the applicaiton.
*
* Dispatching is the process of pulling the option from the request object and
* mapping them to a component. If the component does not exist, it handles
* determining a default component to dispatch.
*
* @abstract
* @access public
*/
function dispatch($component)
{
$document =& JFactory::getDocument();
$document->setTitle($this->getCfg('sitename') . ' - ' . JText::_('Administration'));
$document->setDescription($this->getCfg('MetaDesc'));
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
}
示例14: dispatch
/**
* Dispatch the application
*
* @access public
* @throws KDispatcherException If the user is not logged in.
*/
function dispatch()
{
$document = JFactory::getDocument();
switch ($document->getType()) {
case 'html':
$document->addScript(JURI::root(true) . '/media/system/js/legacy.js');
JHTML::_('behavior.mootools');
}
$document->setTitle(htmlspecialchars_decode($this->getCfg('sitename')) . ' - ' . JText::_('Administration'));
if (JFactory::getUser()->get('guest')) {
$option = 'com_users';
} else {
$option = strtolower(JRequest::getCmd('option', 'com_dashboard'));
}
JRequest::setVar('option', $option);
$contents = JComponentHelper::renderComponent($option);
$document->setBuffer($contents, 'component');
}
示例15: dispatch
/**
* Dispatch the application.
*
* Dispatching is the process of pulling the option from the request object and
* mapping them to a component. If the component does not exist, it handles
* determining a default component to dispatch.
*
* @param string $component The component to dispatch.
*
* @return void
*
* @since 11.1
*/
public function dispatch($component = null)
{
$document = JFactory::getDocument();
$document->setTitle($this->getCfg('sitename') . ' - ' . JText::_('JADMINISTRATION'));
$document->setDescription($this->getCfg('MetaDesc'));
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('system');
$this->triggerEvent('onAfterDispatch');
}