Magento Adminhtml Grid - 无效的块类型
Magento Adminhtml Grid - Invalid block type
exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Cybercon_Certificationverification_Block_Adminhtml_Certificationverificationbackend_Grid' in /home/sbm19/domains/sbm19.saistudy.com/public_html/app/Mage.php:595
Stack trace:
#0 /home/sbm19/domains/sbm19.saistudy.com/public_html/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /home/sbm19/domains/sbm19.saistudy.com/public_html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('cybercon_certif...', Array)
#2 /home/sbm19/domains/sbm19.saistudy.com/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php(66): Mage_Core_Model_Layout->createBlock('cybercon_certif...', 'adminhtml_certi...')
Cybercon/Certificationverification/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Cybercon_Certificationverification>
<version>0.1.0</version>
</Cybercon_Certificationverification>
</modules>
<global>
<helpers>
<certificationverification>
<class>Cybercon_Certificationverification_Helper</class>
</certificationverification>
</helpers>
<models>
<certificationverification>
<class>Cybercon_Certificationverification_Model</class>
<resourceModel>certificationverification_mysql4</resourceModel>
</certificationverification>
<certificationverification_mysql4>
<class>Cybercon_Certificationverification_Model_Mysql4</class>
<entities>
<certification>
<table>cybercon_certificationverification</table>
</certification>
</entities>
</certificationverification_mysql4>
</models>
<blocks>
<certificationverification>
<class>Cybercon_Certificationverification_Block</class>
</certificationverification>
</blocks>
</global>
<admin>
<routers>
<certificationverification>
<use>admin</use>
<args>
<module>Cybercon_Certificationverification</module>
<frontName>admin_certificationverification</frontName>
</args>
</certificationverification>
</routers>
</admin>
<adminhtml>
<layout>
<updates>
<certificationverification>
<file>certificationverification.xml</file>
</certificationverification>
</updates>
</layout>
</adminhtml>
</config>
Cybercon/Certificationverification/Block/Adminhtml/Certificationverificationbackend.php
<?php
class Cybercon_Certificationverification_Block_Adminhtml_Certificationverificationbackend extends Mage_Adminhtml_Block_Widget_Grid_Container {
public function __construct()
{
$this->_blockGroup = 'cybercon_certificationverification';
$this->_controller = 'adminhtml_certificationverificationbackend';
$this->_headerText = Mage::helper('certificationverification')->__('Certifications');
parent::__construct();
$this->_removeButton('add');
}
}
Cybercon/Certificationverification/controllers/Adminhtml/CertificationverificationbackendController.php
<?php
class Cybercon_Certificationverification_Adminhtml_CertificationverificationbackendController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
$this->loadLayout();
$this->_title($this->__("Certification Verification"));
$this->getResponse()->setBody($this->getLayout()->createBlock('certificationverification/adminhtml_certificationverificationbackend')->toHtml());
$this->renderLayout();
}
}
layout/certificationverification.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<adminhtml_certificationverificationbackend_index>
<reference name="content">
<block type="certificationverification/adminhtml_certificationverificationbackend" name="certificationverification" />
</reference>
</adminhtml_certificationverificationbackend_index>
</layout>
Cybercon_Certificationverification_Block_Adminhtml_Certificationverificationbackend->_blockGroup
必须与 etc/config.xml
中的 config/global/blocks
中的标识符相匹配
exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Cybercon_Certificationverification_Block_Adminhtml_Certificationverificationbackend_Grid' in /home/sbm19/domains/sbm19.saistudy.com/public_html/app/Mage.php:595
Stack trace:
#0 /home/sbm19/domains/sbm19.saistudy.com/public_html/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /home/sbm19/domains/sbm19.saistudy.com/public_html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('cybercon_certif...', Array)
#2 /home/sbm19/domains/sbm19.saistudy.com/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php(66): Mage_Core_Model_Layout->createBlock('cybercon_certif...', 'adminhtml_certi...')
Cybercon/Certificationverification/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Cybercon_Certificationverification>
<version>0.1.0</version>
</Cybercon_Certificationverification>
</modules>
<global>
<helpers>
<certificationverification>
<class>Cybercon_Certificationverification_Helper</class>
</certificationverification>
</helpers>
<models>
<certificationverification>
<class>Cybercon_Certificationverification_Model</class>
<resourceModel>certificationverification_mysql4</resourceModel>
</certificationverification>
<certificationverification_mysql4>
<class>Cybercon_Certificationverification_Model_Mysql4</class>
<entities>
<certification>
<table>cybercon_certificationverification</table>
</certification>
</entities>
</certificationverification_mysql4>
</models>
<blocks>
<certificationverification>
<class>Cybercon_Certificationverification_Block</class>
</certificationverification>
</blocks>
</global>
<admin>
<routers>
<certificationverification>
<use>admin</use>
<args>
<module>Cybercon_Certificationverification</module>
<frontName>admin_certificationverification</frontName>
</args>
</certificationverification>
</routers>
</admin>
<adminhtml>
<layout>
<updates>
<certificationverification>
<file>certificationverification.xml</file>
</certificationverification>
</updates>
</layout>
</adminhtml>
</config>
Cybercon/Certificationverification/Block/Adminhtml/Certificationverificationbackend.php
<?php
class Cybercon_Certificationverification_Block_Adminhtml_Certificationverificationbackend extends Mage_Adminhtml_Block_Widget_Grid_Container {
public function __construct()
{
$this->_blockGroup = 'cybercon_certificationverification';
$this->_controller = 'adminhtml_certificationverificationbackend';
$this->_headerText = Mage::helper('certificationverification')->__('Certifications');
parent::__construct();
$this->_removeButton('add');
}
}
Cybercon/Certificationverification/controllers/Adminhtml/CertificationverificationbackendController.php
<?php
class Cybercon_Certificationverification_Adminhtml_CertificationverificationbackendController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
$this->loadLayout();
$this->_title($this->__("Certification Verification"));
$this->getResponse()->setBody($this->getLayout()->createBlock('certificationverification/adminhtml_certificationverificationbackend')->toHtml());
$this->renderLayout();
}
}
layout/certificationverification.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<adminhtml_certificationverificationbackend_index>
<reference name="content">
<block type="certificationverification/adminhtml_certificationverificationbackend" name="certificationverification" />
</reference>
</adminhtml_certificationverificationbackend_index>
</layout>
Cybercon_Certificationverification_Block_Adminhtml_Certificationverificationbackend->_blockGroup
必须与 etc/config.xml
config/global/blocks
中的标识符相匹配