RelatedPosts.php 893 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Copyright © 2015 Ihor Vansach (ihor@magefan.com). All rights reserved.
  4. * See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
  5. *
  6. * Glory to Ukraine! Glory to the heroes!
  7. */
  8. namespace Magefan\Blog\Controller\Adminhtml\Post;
  9. /**
  10. * Blog post related posts controller
  11. */
  12. class RelatedPosts extends \Magefan\Blog\Controller\Adminhtml\Post
  13. {
  14. /**
  15. * View related posts action
  16. *
  17. * @return \Magento\Framework\Controller\ResultInterface
  18. */
  19. public function execute()
  20. {
  21. $model = $this->_getModel();
  22. $this->_getRegistry()->register('current_model', $model);
  23. $this->_view->loadLayout()
  24. ->getLayout()
  25. ->getBlock('blog.post.edit.tab.relatedposts')
  26. ->setPostsRelated($this->getRequest()->getPost('posts_related', null));
  27. $this->_view->renderLayout();
  28. }
  29. }