Jelajahi Sumber

ZF-8007: resource autoloading

- Added note detailing usage of autoloaderNamespaces and pluginpaths
  configuration keys for discovering custom code during bootstrapping.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@22448 44c647ce-9c0f-0410-b52a-842ac1e357ba
matthew 15 tahun lalu
induk
melakukan
df0ea82dee

+ 19 - 0
documentation/manual/en/module_specs/Zend_Application-Examples.xml

@@ -21,14 +21,33 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
     <programlisting language="ini"><![CDATA[
 ; APPLICATION_PATH/configs/application.ini
 [production]
+autoloaderNamespaces[] = "My_"
 bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
 bootstrap.class = "Bootstrap"
+pluginpaths.My_Bootstrap_Resource = "My/Bootstrap/Resource"
 resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
 
 [testing : production]
 [development : production]
 ]]></programlisting>
 
+    <note>
+        <title>Autoloader namespaces</title>
+
+        <para>
+            Because these examples use custom code, we need to register the namespace prefixes for
+            that code with our configuration; this is done with the
+            <code>autoloaderNamespaces</code> configuration key, which is an array.
+        </para>
+
+        <para>
+            Additionally, to ensure that custom plugin resources are discovered, we need to register
+            a plugin prefix path with the bootstrap. This is done with the <code>pluginpaths</code>
+            configuration key, which is an associative array, with keys denoting the prefix to use,
+            and values denoting the path related to that prefix.
+        </para>
+    </note>
+
     <para>
         However, should custom initialization be necessary, you have two
         choices. First, you can write methods prefixed with <emphasis>_init</emphasis>