简体   繁体   中英

Block from controller in magento

I'm trying to display content in /index.php/pincel/payment/error/ and I have the next files:

Block/Error.php

<?php class PincelStudios_Pincel_Block_Error extends Mage_Core_Block_Template { } ?>

etc/config.xml

    <layout>
        <updates>
            <pincel>
                <file>pincel.xml</file>
            </pincel>
        </updates>
    </layout>

Controller/PaymentController.php

    public function errorAction()
{
    $this->loadLayout()->renderLayout();
}

But I'm getting a white layout without any error (neither in logs) http://i.stack.imgur.com/vzLkk.png

Any ideas? Thanks in advance

Looks like you have not given all necessary information and the file

/app/design/frontend/default/default/layout/pincel.xml

is missing.

<pincel_payment_error>
    <reference name="content"> <!-- Place were you want to display your content -->
        <block type="pincel/error" name="pincel" template="yourtemplate if necessary" />
    </reference>
</pincel_payment_error>

Do you have it?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM