/** * Rendering component * * @param string $moduleName Module name * @param string $componentName Component name * @param array $params Component params * @return string Rendered component content */ public function renderComponent($moduleName, $componentName, $params) { $actionName = '_' . $componentName; $view = new dinThemePartialView($this->context, $moduleName, $actionName, ''); $view->setPartialVars($params); if ($retval = $view->getCache()) { return $retval; } $allVars = $this->callComponent($moduleName, $componentName, $params); if (!is_null($allVars)) { // render $view->getAttributeHolder()->add($allVars); return $view->render(); } }
/** * Get component * * @param string $module Module name * @param string $component Component name * @param array $vars Variables to be made accessible to the component * @return string Rendered component */ public static function component($module, $component, $vars = array()) { $view = new dinThemePartialView(sfContext::getInstance(), $module, '_' . $component, ''); return $view->renderComponent($module, $component, $vars); }