Add Content In Magento Controller

If you want to add content to the rendered page inside a controller action, you can do it like that:

$message =  $this->getLayout()
            ->createBlock('core/text', 'ready-block')
            ->setText('<h1>Testaction for Controller:</h1>');


Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.