plugins-intro.xml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="learning.plugins.intro">
  4. <title>Introduction</title>
  5. <para>
  6. Zend Framework makes heavy use of plugin architectures. Plugins allow for easy extensibility
  7. and customization of the framework while keeping your code separate from the Zend Framework
  8. code.
  9. </para>
  10. <para>
  11. Typically, plugins in Zend Framework work as follows:
  12. </para>
  13. <itemizedlist>
  14. <listitem>
  15. <para>
  16. Plugins are classes. The actual class definition will vary based on the component --
  17. you may need to extend an abstract class or implement an interface, but the fact
  18. remains that the plugin is itself a class.
  19. </para>
  20. </listitem>
  21. <listitem>
  22. <para>
  23. Related plugins will share a common class prefix. For instance, if you have created
  24. a number of view helpers, they might all share the class prefix "Foo_View_Helper_".
  25. </para>
  26. </listitem>
  27. <listitem>
  28. <para>
  29. Everything after the common prefix will be considered the <emphasis>plugin
  30. name</emphasis> or <emphasis>short name</emphasis> (versus the "long name",
  31. which is the full classname). For example, if the plugin prefix is
  32. "Foo_View_Helper_", and the class name is "Foo_View_Helper_Bar", the plugin name
  33. will be simply "Bar".
  34. </para>
  35. </listitem>
  36. <listitem>
  37. <para>
  38. Plugin names are typically case sensitive. The one caveat is that the initial letter
  39. can often be either lower or uppercase; in our previous example, both "bar" and
  40. "Bar" would refer to the same plugin.
  41. </para>
  42. </listitem>
  43. </itemizedlist>
  44. <para>
  45. Now let's turn to using plugins.
  46. </para>
  47. </sect1>