本文整理汇总了PHP中XenForo_View::setParams方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_View::setParams方法的具体用法?PHP XenForo_View::setParams怎么用?PHP XenForo_View::setParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_View
的用法示例。
在下文中一共展示了XenForo_View::setParams方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTabs
public function getTabs()
{
$allContentKeys = array('resource' => array('resource_id', 'resource'), 'thread' => array('thread_id', 'thread'), 'conversation' => array('conversation_id', 'conversation'), 'project' => array('project_id', 'freeagent_project'), 'media' => array('media_id', 'xengallery_media'), 'product' => array('product_id', 'xenproduct_product'));
$contentKeys = array();
$params = $this->_view->getParams();
foreach ($allContentKeys as $contentKeyId => $contentTypeInfo) {
if (isset($params[$contentKeyId])) {
$contentTypes[] = $contentTypeInfo[1];
$contentIdKeys[] = $contentTypeInfo[0];
$contentKeys[] = $contentKeyId;
}
}
/* @var $tabModel Waindigo_Tabs_Model_Tab */
$tabModel = XenForo_Model::create('Waindigo_Tabs_Model_Tab');
$canAddExistingContentToTab = false;
for ($i = 0; $i < isset($contentKeys) ? count($contentKeys) : 0; $i++) {
$content = $params[$contentKeys[$i]];
if (!isset($content['tab_id']) || !$content['tab_id']) {
continue;
}
if (!$canAddExistingContentToTab) {
$canAddExistingContentToTab = $tabModel->canAddExistingContentToTab(array('tab_id' => $content['tab_id']));
}
$tabContents = $tabModel->getTabContentsByTabId($content['tab_id']);
$tabContents = $tabModel->prepareTabContents($tabContents, $contentTypes[$i], $content[$contentIdKeys[$i]], $content);
$this->_view->setParams(array('tabContents' => $tabContents));
break;
}
if (!$canAddExistingContentToTab) {
$canAddExistingContentToTab = $tabModel->canAddExistingContentToTab(array());
}
$this->_view->setParams(array('canAddExistingContentToTab' => $canAddExistingContentToTab));
}