1

In magento 2.1.X, I am trying to append some text in my template file using a block within my custom controller. But i receive an error when doing so (my html markup is working just fine).

error stack

My block extends \Magento\Framework\View\Element\Template and my controller is kept basic for the moment as I will build a form with it.

in my template .phtml file, this is what i try to do

<section id="careers-section">
    <?php echo $this->__('test'); ?>
</section>

What have I done wrong?

8

Instead of <?php echo $this->__('test'); ?>.. Use <?php echo __('test'); ?>

hope this helps you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.