Exemple #1
0
 /**
  * Render the Form for this module (in.ctp).
  *
  * @return string
  */
 public function renderForm()
 {
     $template = $this->path() . DS . 'in.ctp';
     if (!file_exists($template)) {
         user_error(__d('wasabi_cms', 'Template "{0}" for module {1} not found.', $template, $this->name()));
     }
     $viewClass = WasabiCms::getTheme()->getClassNameForInitialization();
     /** @var View $view */
     $view = new $viewClass();
     $output = $view->element('Wasabi/Cms.module', ['template' => $template, 'form' => $this]);
     return $output;
 }
Exemple #2
0
 public function attributes($id)
 {
     $layout = $this->request->query['layout'];
     $layout = WasabiCms::getTheme()->getLayout($layout);
     $attributes = $layout->attributes();
     $page = $this->Pages->get($id, ['contain' => ['Attributes']]);
     $this->set(['page' => $page, 'attributes' => $attributes]);
     $this->viewBuilder()->layout(false);
 }