This plugin is currently in BETA stage.

Documentation is under construct and may have inacurate parts. Please help us improving it by reporting invalid content/broken links.

package

Description

A package tag describes a set of javascripts working altogether with optional stylesheets. In fact even javascripts are optionnal, but an empty package would be a pretty unuseful one.

If you define a «mypackage» package, you'll be able to include it in your PHP code with the following code:

sfDynamics::load('mypackage');

It will automatically load every needed files, taking care of dependances, i18n (if available), theme (if available), and will throw an sfDynamicsConflictException if any conflict is found. If you're not running your app in debug mode, it will also take care of {link:packing} all package files.

A package XML tag must have a "name" attribute, that may contain letters, digits and dots.

Example

Here is the simplest package definition.

[xml]
<package name="my.package">
  <javascript>myscript</javascript>
</package>

Children nodes

  • path: optional, any number
  • require: optional, any number
  • conflict: optional, any number
  • javascript: optional, any number
  • stylesheet: optional, any number
  • i18n: optional, one by language needing additional javascript/stylesheet tags
  • theme: optional, one by theme needing additional javascript/stylesheet tags

PHP definition

A package tag's content is handled by an sfDynamicsPackageDefinition instance.


Comments