[ Index ]

PHP Cross Reference of Akelos Framework

title

Body

[close]

/AkActionView/helpers/ -> javascript_helper.php (summary)

(no description)

Author: Bermi Ferrer
Copyright: Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
License: GNU Lesser General Public License
File Size: 161 lines (6 kb)
Included or required: 3 times
Referenced: 0 times
Includes or requires: 2 files
 AkActionView/AkActionViewHelper.php
 AkActionView/helpers/tag_helper.php

Defines 1 class

JavascriptHelper:: (8 methods):
  link_to_function()
  button_to_function()
  escape_javascript()
  javascript_tag()
  javascript_cdata_section()
  _options_for_javascript()
  _array_or_string_for_javascript()
  define_javascript_functions()


Class: JavascriptHelper  - X-Ref

link_to_function($name, $function, $html_options = array()   X-Ref
Returns a link that'll trigger a JavaScript +function+ using the
onclick handler and return false after the fact.

Examples:
$javascript_helper->link_to_function("Greeting", "alert('Hello world!')");
$javascript_helper->link_to_function($tag->image_tag("delete"), "if confirm('Really?'){ do_delete(); }");

button_to_function($name, $function, $html_options = array()   X-Ref
Returns a link that'll trigger a JavaScript +function+ using the
onclick handler.

Examples:
$javascript_helper->button_to_function("Greeting", "alert('Hello world!')");
$javascript_helper->button_to_function("Delete", "if confirm('Really?'){ do_delete(); }"));

escape_javascript($javascript)   X-Ref
Escape carrier returns and single and double quotes for JavaScript segments.


javascript_tag($content)   X-Ref
Returns a JavaScript tag with the +content+ inside. Example:
javascript_tag("alert('All is good')") => <script type="text/javascript">alert('All is good')</script>


javascript_cdata_section($content)   X-Ref
No description

_options_for_javascript($options)   X-Ref
No description

_array_or_string_for_javascript($option)   X-Ref
No description

define_javascript_functions()   X-Ref
Includes the Action Pack JavaScript libraries inside a single <script>
tag. The function first includes prototype.js and then its core extensions,
(determined by filenames starting with "prototype").
Afterwards, any additional scripts will be included in undefined order.

Note: The recommended approach is to copy the contents of
lib/action_view/helpers/javascripts/ into your application's
public/javascripts/ directory, and use +javascript_include_tag+ to
create
remote <script> links.



Generated: Mon Oct 27 12:43:49 2008 Cross-referenced by PHPXref 0.6