コード例 #1
0
ファイル: Form.php プロジェクト: aiesh/magento2
 /**
  * Initialize cache management form
  *
  * @return $this
  */
 public function initForm()
 {
     /** @var \Magento\Framework\Data\Form $form */
     $form = $this->_formFactory->create();
     $fieldset = $form->addFieldset('cache_enable', array('legend' => __('Cache Control')));
     $fieldset->addField('all_cache', 'select', array('name' => 'all_cache', 'label' => '<strong>' . __('All Cache') . '</strong>', 'value' => 1, 'options' => array('' => __('No change'), 'refresh' => __('Refresh'), 'disable' => __('Disable'), 'enable' => __('Enable'))));
     foreach ($this->_coreData->getCacheTypes() as $type => $label) {
         $fieldset->addField('enable_' . $type, 'checkbox', array('name' => 'enable[' . $type . ']', 'label' => __($label), 'value' => 1, 'checked' => (int) $this->_cacheState->isEnabled($type)));
     }
     $this->setForm($form);
     return $this;
 }