-2

how to i can get the assign value in phtml file.
i am using this code this to assign value but i don't know how to retrieve it in phtml file.

$this->loadLayout()->getLayout()->getBlock('blockname')
     ->assign('active', 'company');

i am getting by this but no value is showing.

<?php echo $this->Active;?>

any help will be appreciated. thanks

1 Answer 1

3

instead of assign you can use set and get method of Varient it is great features of OOP used by magento

use like this

$this->loadLayout()->getLayout()->getBlock('blockname')
     ->setActive('company');

and you can get this in phtml file

<?php echo $this->getActive();?> // will print company.

its the best you to assign value and get in to phtml files or any call.

hope this will sure help you.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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