2016-08-24 3 views
0

Я создал меню и его подменю в панели администратора (он отображает мне пустую страницу), поэтому я хочу добавить некоторый ввод, затем этот ввод Я хочу сделать некоторый SQL query (Сохранить текст в db), и этот текст я хочу отобразить на странице sms. Я не знаю, как это сделать.Как добавить некоторый контент в панель администратора admin Magento

Menu admin panel

Вт/Свидетельство/контроллеры/Adminhtml/TestimonyController.php

class W_Testimony_Adminhtml_TestimonyController extends Mage_Adminhtml_Controller_Action{ 


protected function _initAction() { 
    $this->_title($this->__('Paramétrage')) 
     ->_title($this->__('Témoignage')); 
    $this->loadLayout() 
     ->_setActiveMenu('testimony/parametrage') 
     ->_addBreadcrumb(Mage::helper('adminhtml')->__('testimony'), Mage::helper('adminhtml')->__('testimony')) 
     ->_addBreadcrumb(Mage::helper('adminhtml')->__('Paramétrage'), Mage::helper('adminhtml')->__('Paramétrage')); 
    return $this; 
} 

public function indexAction() { 
    $this->_initAction() 
     ->renderLayout(); 
} 
} 

Вт/Свидетельство/и т.д./adminhtml.xml

<config> 
<menu> 
    <testimony translate="title" module="testimony"> 
       <title>Témoignage</title> 
       <sort_order>100</sort_order> 
       <children> 
        <parametrage translate="title" module="testimony"> 
        <title>Paramétrage</title> 
        <sort_order>1</sort_order> 
        <action>adminhtml/testimony/index</action> 
        </parametrage> 
       </children> 
    </testimony> 
</menu> 

Вт/Свидетельство /etc/config.xml

<?xml version="1.0"?> 
<config> 
<modules> 
    <W_Testimony> 
     <version>0.0.1</version> 
    </W_Testimony> 
</modules> 
<adminhtml> 
    <layout> 
     <updates> 
      <testimony> 
       <file>testimony.xml</file> <!-- I dont know what is this file ?--> 
      </testimony> 
     </updates> 
    </layout> 

    <acl> 
     <resources> 
      <admin> 
       <children> 
        <testimony> 
         <title>testimony Menu Item</title> 
         <children> 
          <parametrage translate="title" module="testimony"> 
           <title>param Menu Item</title> 
          </parametrage> 
         </children> 
        </testimony> 
       </children> 
      </admin> 
     </resources> 
    </acl> 
</adminhtml> 
<global> 
<models> 
     <w_testimony> 
      <class>W_Testimony_Model</class> 
     </w_testimony> 
    </models> 

    <helpers> 
     <testimony> 
      <class>W_Testimony_Helper</class> 
     </testimony> 
    </helpers> 

    <blocks> 
     <w_testimony> 
      <class>W_Testimony_Block</class> 
     </w_testimony> 

     <w_testimony_adminhtml> 
      <class>W_Testimony_Block_Adminhtml</class> 
     </w_testimony_adminhtml> 
    </blocks> 

</global> 

<admin> 
    <routers> 
     <adminhtml> 
      <args> 
       <modules> 
        <w_testimony after="Mage_Adminhtml">W_Testimony_Adminhtml</w_testimony> 
       </modules> 
      </args> 
     </adminhtml> 
    </routers> 
</admin> 

W/Свидетельские/Helper/Data.php

class W_Testimony_Helper_Data extends Mage_Core_Helper_Abstract{ 

} 

W/Свидетельские/Модель/Testimony.php

class W_Testimony_Model_Testimony extends Mage_Core_Model_Abstract{ 


public function _construct() { 
    $this->_isPkAutoIncrement = false; 
    $this->_init('w_testimony/testimony'); 
} 

}

ответ

0

Вы можете следить эту инструкцию и создать страницу в admin.

Create Module