2. AutoloadConfigHandler Tags (autoload.xml)

The AutoloadConfigHandler allows you to define classes and their files to be automatically loaded by PHP when the class is first accessed (not in advance so there's no performance hit). This frees you from manually including it in your files.

Example 5.1. autoload.xml

<configurations parent="%core.system_config_dir%/autoload.xml">
 <configuration>

  <autoloads>
   <autoload name="AgaviSampleAppCookieLoginFilter">%core.lib_dir%/filter/AgaviSampleAppCookieLoginFilter.class.php</autoload>
   <autoload name="AgaviSampleAppLanguageRoutingCallback">%core.lib_dir%/routing/AgaviSampleAppLanguageRoutingCallback.class.php</autoload>
   <autoload name="AgaviSampleAppUser">%core.lib_dir%/user/AgaviSampleAppUser.class.php</autoload>
  </autoloads>

 </configuration>
</configurations>


2.1. <autoloads>

Parent element for <autoload>.

Content

  • 0-n <autoload>

2.2. <autoload>

Defines an autoload for a class.

Attributes

name

The name of the class.

Content

The full path to the file to be loaded when the class is needed. You can use keywords here.