Inheritance

HaQuery support inheritance both for pages and components.

To specify base page/component use <extends> tag in your config.xml.

src/components/test/b/config.xml file:

<config>
    <extends component="components.test.a" />
</config>

Code inheritance

Code work as with regular inheritance. Inherits your Server and Client classes from BaseServer and BaseClient (from same package) to autodetect base classes. Files BaseServer.hx and BaseClient.hx for each page/component will be autogenerated into the gen folder during compilation process.

Template inheritance

Template file content will be appended to the base template.

src/components/test/a/template.html file:

A

src/components/test/b/template.html file:

B

Rendering of b component (<haq:b />):

AB

Often you need not just append template with a new html piece, but insert it into middle of base html or even change html piece of base template to another. For that you can use placeholders.

version #129, modified 2013-01-26 22:09:08 by yar3333