devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

The <action> instruction is deprecated

Open neirda opened this issue 11 years ago • 3 comments

There is an alert saying "The <action> instruction is deprecated. Do not use it." on the layout XML instructions page: http://devdocs.magento.com/guides/v1.0/frontend-dev-guide/layouts/xml-instructions.html#fedg_layout_xml-instruc_ex_act

Why is that and is it possible to accomplish that another way?

I found another use example on this page: http://devdocs.magento.com/guides/v1.0/frontend-dev-guide/layouts/xml-manage.html#layout_markup_block-properties

neirda avatar Jul 17 '15 15:07 neirda

Thanks for the comment! We'll be back with the reply soon.

almarchenko avatar Jul 17 '15 15:07 almarchenko

Hi again! "Why is that and is it possible to accomplish that another way?"

The <action> directive is marked as deprecated because we want to stop using imperative directives and switch to using declarative layout directives instead. The recommended way to avoid <action> is using <block><argument></argument></block> construction (will make it more clear in the doc). But, the refactoring is still in progress, and some block methods can still be called only using <action>. This is why we have described. @neirda please let us know this answers your question.

almarchenko avatar Jul 20 '15 13:07 almarchenko

Ok thanks for the explanation

neirda avatar Jul 20 '15 14:07 neirda