Magento 2 Developer's Guide by Branko Ajzele

Magento 2 Developer's Guide by Branko Ajzele

Author:Branko Ajzele [Ajzele, Branko]
Language: eng
Format: epub, azw3
Publisher: Packt Publishing
Published: 2015-12-23T23:00:00+00:00


This way, PhpStorm will know how to provide autocomplete while we type around XML files.

As an example, let's take a look at how we could use the css directive to add an external CSS file to our page. With an IDE that supports autocomplete as soon as we type the css directive within the page | head element, autocomplete might throw out something like the following:

A list of available attributes is shown, such as src, sizes, ie_condtion, src_type, and so on. IDEs like PhpStorm will allow us to right-click an element or its attribute and go to the definition. Looking into the definition for the src attribute gets us into the vendor/magento/framework/View/Layout/etc/head.xsd file that defines the css element as follows:

<xs:complexType name="linkType"> <xs:attribute name="src" type="xs:string" use="required"/> <xs:attribute name="defer" type="xs:string"/> <xs:attribute name="ie_condition" type="xs:string"/> <xs:attribute name="charset" type="xs:string"/> <xs:attribute name="hreflang" type="xs:string"/> <xs:attribute name="media" type="xs:string"/> <xs:attribute name="rel" type="xs:string"/> <xs:attribute name="rev" type="xs:string"/> <xs:attribute name="sizes" type="xs:string"/> <xs:attribute name="target" type="xs:string"/> <xs:attribute name="type" type="xs:string"/> <xs:attribute name="src_type" type="xs:string"/> </xs:complexType>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.