Пример #1
0
 /**
  * Renders the given content within the layout
  *
  * @param string $content
  * @return string
  */
 public function renderLayout($content)
 {
     $layout = new View();
     $layout->setScriptPath($this->auth->getLayoutScriptPath());
     $layout->assign(array('content' => $content, 'title' => $this->auth->getTitle(), 'view' => $this->view));
     return $layout->render($this->auth->getLayoutScript());
 }
Пример #2
0
 /**
  * Create a new page with a reference to its component and the file in which
  * it is defined.
  *
  * Also, by default, the page will be configured to look for view scripts
  * in the view-scripts sub-folder of its component.
  *
  * @param ComponentAbstract $component
  * @param Request $request
  * @param string $viewScriptPath
  */
 public function __construct(ComponentAbstract $component, Request $request, $viewScriptPath = null)
 {
     $this->component = $component;
     $this->view = Pimple::getResource('view');
     $this->request = $request ?: $this->application['dewdrop-request'];
     if (null === $viewScriptPath) {
         $viewScriptPath = $this->component->getPath() . '/view-scripts';
     }
     $this->view->setScriptPath($viewScriptPath)->helper('AdminUrl')->setPage($this);
 }
 public function getExamples()
 {
     $view = new View();
     $view->setScriptPath(__DIR__ . '/view-scripts');
     return $view->render('group-column-not-set-examples.phtml');
 }
Пример #4
0
 /**
  * Render a partial view.  By default, the same script path used by this
  * view is passed along.  This escaper from this view is also passed to
  * the partial.
  *
  * @param string $template
  * @param array $data
  * @param string $scriptPath
  * @return string
  */
 public function partial($template, array $data, $scriptPath = null)
 {
     $partial = new View($this->escaper);
     $partial->assignInstance('headscript', $this->headScript());
     $partial->assignInstance('headlink', $this->headLink());
     // Pass along any custom helper class assignments to the newly created partial
     foreach ($this->helperClasses as $name => $className) {
         $partial->registerHelper($name, $className);
     }
     foreach ($this->helpers as $name => $helper) {
         if ($helper instanceof PageDelegateInterface) {
             /* @var $partialHelper PageDelegateInterface */
             $partialHelper = $partial->helper($name);
             $partialHelper->setPage($helper->getPage());
         }
     }
     $partial->setScriptPath($scriptPath ?: $this->scriptPath)->assign($data);
     return $partial->render($template);
 }
 public function getExamples()
 {
     $view = new View();
     $view->setScriptPath(__DIR__ . '/view-scripts');
     return $view->render('group-key-not-present-in-resultset-examples.phtml');
 }