Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CleanStaticFiles.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
11 
12 class CleanStaticFiles extends \Magento\Backend\Controller\Adminhtml\Cache implements HttpGetActionInterface
13 {
19  const ADMIN_RESOURCE = 'Magento_Backend::flush_static_files';
20 
26  public function execute()
27  {
28  $this->_objectManager->get(\Magento\Framework\App\State\CleanupFiles::class)->clearMaterializedViewFiles();
29  $this->_eventManager->dispatch('clean_static_files_cache_after');
30  $this->messageManager->addSuccessMessage(__('The static files cache has been cleaned.'));
31 
33  $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
34  return $resultRedirect->setPath('adminhtml/*');
35  }
36 }
__()
Definition: __.php:13