本文整理汇总了PHP中Renderer::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP Renderer::setData方法的具体用法?PHP Renderer::setData怎么用?PHP Renderer::setData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Renderer
的用法示例。
在下文中一共展示了Renderer::setData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAuthoring
/**
* @deprecated
* @see taoTests_models_classes_TestModel::getAuthoring()
*/
public function getAuthoring(core_kernel_classes_Resource $test)
{
$process = $test->getUniquePropertyValue(new core_kernel_classes_Property(TEST_TESTCONTENT_PROP));
$ext = common_ext_ExtensionsManager::singleton()->getExtensionById('taoWfAdvTest');
$widget = new Renderer($ext->getConstant('DIR_VIEWS') . 'templates' . DIRECTORY_SEPARATOR . 'authoring.tpl');
$widget->setData('processUri', $process->getUri());
$widget->setData('label', __('Authoring %s', $test->getLabel()));
return $widget->render();
}
示例2: getAuthoring
/**
* (non-PHPdoc)
*
* @see taoTests_models_classes_TestModel::getAuthoring()
*/
public function getAuthoring(core_kernel_classes_Resource $content)
{
common_Logger::i('Generating form for delivery content ' . $content->getUri());
$widget = new Renderer($this->extension->getConstant('DIR_VIEWS') . 'templates' . DIRECTORY_SEPARATOR . 'authoring.tpl');
$form = new taoSimpleDelivery_actions_form_ContentForm($this->getClass(), $content);
$widget->setData('formContent', $form->getForm()->render());
$widget->setData('saveUrl', _url('save', 'Authoring', 'taoSimpleDelivery'));
$widget->setData('formId', $form->getForm()->getName());
return $widget->render();
}
示例3: getAuthoring
/**
* @deprecated
* @see taoTests_models_classes_TestModel::getAuthoring()
*/
public function getAuthoring(core_kernel_classes_Resource $test)
{
$testService = taoTests_models_classes_TestsService::singleton();
$class = new core_kernel_classes_Class(CLASS_LTI_TESTCONTENT);
$content = $test->getOnePropertyValue(new core_kernel_classes_Property(TEST_TESTCONTENT_PROP));
common_Logger::i('Generating form for ' . $content->getUri());
$form = new ltiTestConsumer_actions_form_LtiLinkForm($content);
$form->getForm()->setActions(array());
$widget = new Renderer($this->extension->getConstant('DIR_VIEWS') . 'templates' . DIRECTORY_SEPARATOR . 'authoring.tpl');
$widget->setData('formContent', $form->getForm()->render());
$widget->setData('saveUrl', _url('save', 'Authoring', 'ltiTestConsumer'));
$widget->setData('formName', $form->getForm()->getName());
return $widget->render();
}
示例4: getAuthoring
/**
* @deprecated
* @see taoTests_models_classes_TestModel::getAuthoring()
*/
public function getAuthoring(core_kernel_classes_Resource $test)
{
$ext = common_ext_ExtensionsManager::singleton()->getExtensionById('taoWfTest');
$testService = taoTests_models_classes_TestsService::singleton();
$itemSequence = array();
$itemUris = array();
$i = 1;
foreach ($testService->getTestItems($test) as $item) {
$itemUris[] = $item->getUri();
$itemSequence[$i] = array('uri' => tao_helpers_Uri::encode($item->getUri()), 'label' => $item->getLabel());
$i++;
}
// data for item sequence, terrible solution
// @todo implement an ajax request for labels or pass from tree to sequence
$allItems = array();
foreach ($testService->getAllItems() as $itemUri => $itemLabel) {
$allItems['item_' . tao_helpers_Uri::encode($itemUri)] = $itemLabel;
}
$widget = new Renderer($ext->getConstant('DIR_VIEWS') . 'templates' . DIRECTORY_SEPARATOR . 'authoring.tpl');
$widget->setData('uri', $test->getUri());
$widget->setData('allItems', json_encode($allItems));
$widget->setData('itemSequence', $itemSequence);
// data for generis tree form
$widget->setData('relatedItems', json_encode(tao_helpers_Uri::encodeArray($itemUris)));
$openNodes = tao_models_classes_GenerisTreeFactory::getNodesToOpen($itemUris, new core_kernel_classes_Class(TAO_ITEM_CLASS));
$widget->setData('itemRootNode', TAO_ITEM_CLASS);
$widget->setData('itemOpenNodes', $openNodes);
$widget->setData('saveUrl', _url('saveItems', 'Authoring', 'taoWfTest'));
return $widget->render();
}
示例5: index
/**
* Set a view with the list of process instances (both started or finished) and available process definitions
*
* @access public
* @author CRP Henri Tudor - TAO Team - {@link http://www.tao.lu}
* @param processDefinitionUri
* @return void
*/
public function index()
{
$user = common_session_SessionManager::getSession()->getUser();
/**
* Retrieve resumable deliveries (via delivery execution)
*/
$resumableData = array();
foreach ($this->service->getResumableDeliveries($user) as $de) {
$resumableData[] = DeliveryHelper::buildFromDeliveryExecution($de);
}
$this->setData('resumableDeliveries', $resumableData);
$assignmentService = $this->getServiceManager()->get(AssignmentService::CONFIG_ID);
$deliveryData = array();
foreach ($assignmentService->getAssignments($user) as $delivery) {
$deliveryData[] = DeliveryHelper::buildFromAssembly($delivery, $user);
}
$this->setData('availableDeliveries', $deliveryData);
/**
* Header & footer info
*/
$this->setData('showControls', $this->showControls());
$this->setData('userLabel', common_session_SessionManager::getSession()->getUserLabel());
// Require JS config
$this->setData('client_config_url', $this->getClientConfigUrl());
$this->setData('client_timeout', $this->getClientTimeout());
$loaderRenderer = new \Renderer(Template::getTemplate('DeliveryServer/blocks/loader.tpl', 'taoDelivery'));
$loaderRenderer->setData('client_config_url', $this->getClientConfigUrl());
$loaderParams = [];
if ($this->getRequest()->hasParameter('warning') && !empty($this->getRequest()->getParameter('warning'))) {
$loaderParams['message'] = ['level' => 'danger', 'content' => $this->getRequest()->getParameter('warning'), 'timeout' => -1];
}
$loaderRenderer->setData('parameters', $loaderParams);
/**
* Layout template + real template inclusion
*/
$this->setData('additional-header', $loaderRenderer);
$this->setData('content-template', 'DeliveryServer/index.tpl');
$this->setData('content-extension', 'taoDelivery');
$this->setView('DeliveryServer/layout.tpl', 'taoDelivery');
}
示例6: getMailContent
/**
* Function generates password recovery email message content
* May be used in the following way:
* <pre>
* $this->getMailContent(array(
* 'user_name'=>'John Doe',
* 'link'=>$this->getPasswordRecoveryLink($user)
* ));
* </pre>
*
* @author Aleh Hutnikau <hutnikau@1pt.com>
* @param array $messageData
* @return string Message content
*/
private function getMailContent($messageData)
{
$renderer = new \Renderer();
$renderer->setTemplate(Template::getTemplate('passwordRecovery/password-recovery-message.tpl', 'tao'));
foreach ($messageData as $key => $value) {
$renderer->setData($key, $value);
}
return $renderer->render();
}