Developers

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Possible uses

Installation

sfUFOPlugin has a dependency on sfUJSPlugin. If this last plugin is not installed, the plugin-install command will install it for you. You will also have to follow the supplementary installation steps described in the sfUJSPlugin helper installation page

Alternatively, if you don't have PEAR installed, you can download the latest package attached to this plugin's wiki page and extract it under your project's plugins/ directory

Basic syntax

Declaring the helper in templates

The UFO plugin provides a set of helpers to be used within templates. As for other helpers, you must declare the related helper group to make the helper functions available in the template.

Adding a Flash movie without DOM reference

The first example presented above uses an existing <div> tag to locate the place to put the Flash movie. If you don't have a placeholder to refer to, call the UJS_write() helper where you want the movie to appear, the helper will put a placeholder of its own and add the Flash movie unobtrusively.

Notice that users witout JavaScript and Flash support will not see anything.

Transforming a link to a Flash movie into an embedded Flash object

The correct, unobtrusive way of profiding Flash content is to propose a link to the Flash object to everybody, and to replace the link by an embedded Flash object to those who can support it. This is simply done by the UFO_flashify() helper:

The first argument of the helper is a jQuery selector, the second (optional) is the same options argument as for the UFO() helper. The resulting DOM after execution on the server and on the client side looks as follows:

This is much more easy to use and code. The next step, as you could guess, is to store these pseudo-CSS rules in a reusable CSS file under your project's web root, and telling symfony to use it for UFO-styling. So, an alternatice to the solution presented above would be with two files. In css/flash.css: