4

I often see "at_call" in the tag of a layout like below, what is this for? what it functions as? Thank you.

<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.sku" template="product/view/attribute.phtml" after="product.info.type">
    <arguments>
        <argument name="at_call" xsi:type="string">getSku</argument>
        <argument name="at_code" xsi:type="string">sku</argument>
        <argument name="css_class" xsi:type="string">sku</argument>
        <argument name="at_label" xsi:type="string">default</argument>
        <argument name="add_attribute" xsi:type="string">itemprop="sku"</argument>
    </arguments>
</block>
5

it is used in the template to determine the function call to get the attribute. I think this is short for attribute_call

Here is the location in the template: https://github.com/magento/magento2/blob/develop/app/code/Magento/Catalog/view/frontend/templates/product/view/attribute.phtml#L18

The arguments from the layout are inserted into the data array of the Block. The getAtCall() Method in the template is internally translated to getData('at_call') which then retrieves the value from the layout file.

  • The link is invalid – Black Mar 24 '20 at 15:12

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.