_post = $post; $this->_coreRegistry = $coreRegistry; $this->_filterProvider = $filterProvider; $this->_postFactory = $postFactory; $this->_url = $url; } /** * Retrieve post instance * * @return \Magefan\Blog\Model\Post */ public function getPost() { if (!$this->hasData('post')) { $this->setData('post', $this->_coreRegistry->registry('current_blog_post') ); } return $this->getData('post'); } /** * Retrieve post short content * * @return string */ public function getShorContent() { return $this->getPost()->getShortFilteredContent(); } /** * Retrieve post content * * @return string */ public function getContent() { return $this->getPost()->getFilteredContent(); } /** * Retrieve post info html * * @return string */ public function getInfoHtml() { return $this->getInfoBlock()->toHtml(); } /** * Retrieve post info block * * @return \Magefan\Blog\Block\Post\Info */ public function getInfoBlock() { $k = 'info_block'; if (!$this->hasData($k)) { $blockName = $this->getPostInfoBlockName(); if ($blockName) { $block = $this->getLayout()->getBlock($blockName); } if (empty($block)) { $block = $this->getLayout()->createBlock($this->_defaultPostInfoBlock, uniqid(microtime())); } $this->setData($k, $block); } return $this->getData($k)->setPost($this->getPost()); } }