/**
  * @param null $data
  * @return TagControl
  */
 public function create($data = null)
 {
     $this->initCountOfItems();
     $control = new TagControl();
     $control->setItems($this->tagFacade->getLastTags($this->countOfItems));
     return $control;
 }
 /**
  * @param \Flame\CMS\PostBundle\Forms\IPostFormFactory $postFormFactory
  * @return \Flame\CMS\PostBundle\Forms\PostForm
  */
 protected function createComponentPostForm(\Flame\CMS\PostBundle\Forms\IPostFormFactory $postFormFactory)
 {
     $default = array();
     if ($this->post instanceof \Flame\CMS\PostBundle\Model\Post) {
         $default = $this->post->toArray();
     }
     $form = $postFormFactory->create($default);
     $form->setCategories($this->categoryFacade->getLastCategories());
     $form->setTags($this->tagFacade->getLastTags());
     if ($this->post) {
         $form->onSuccess[] = $this->lazyLink('this');
     } else {
         $form->onSuccess[] = $this->lazyLink('default');
     }
     return $form;
 }
 public function renderDefault()
 {
     $this->template->tags = $this->tagFacade->getLastTags();
 }