[Catalyst] Doc patch..
Allen S. Rout
asr at ufl.edu
Sat Nov 19 23:28:43 CET 2005
For
http://dev.catalyst.perl.org/repos/Catalyst/trunk/Catalyst-Plugin-Prototype/lib/Catalyst/Plugin/Prototype.pm
I followed the plugin docs to start using Prototype functions, and was
thinking about how to arrange for including the js by script tag, when I
stumbled on the docs in HTML::Prototype discussing the helper. So I added
similar notation in Catalyst::Plugin::Prototype.
--- Prototype-orig.pm Sat Nov 19 16:52:51 2005
+++ Prototype.pm Sat Nov 19 17:22:50 2005
@@ -24,8 +24,25 @@
# use it
use Catalyst qw/Prototype/;
+=head2 INLINE USE
+
# ...add this to your tt2 template...
[% c.prototype.define_javascript_functions %]
+
+=head2 REFERENCE USE
+
+If you don't want to include the entire prototype library inline
+on every hit, you can use "script/myapp_create.pl Prototype"
+to generate static JavaScript files which then can be included
+via remote "script" tags.
+
+ # ...add this to your template...
+ <script LANGUAGE="JavaScript1.2" type="text/javascript"
+ src="/prototype.js"></script>
+ <script LANGUAGE="JavaScript1.2" type="text/javascript"
+ src="/effects.js"></script>
+ <!-- .... -->
+
# ...and use the helper methods...
<div id="view"></div>
More information about the Catalyst
mailing list