[ Index ]

PHP Cross Reference of Akelos Framework

title

Body

[close]

/AkActionView/helpers/ -> asset_tag_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: 250 lines (11 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 3 files
 AkActionView/AkActionViewHelper.php
 AkActionView/helpers/url_helper.php
 AkActionView/helpers/tag_helper.php

Defines 1 class

AssetTagHelper:: (14 methods):
  setController()
  auto_discovery_link_tag()
  javascript_path()
  javascript_include_tag()
  _get_javascript_included_defaults()
  register_javascript_include_default()
  reset_javascript_include_default()
  stylesheet_path()
  stylesheet_link_tag()
  image_path()
  image_tag()
  _compute_public_path()
  stylesheet_for_current_controller()
  javascript_for_current_controller()


Class: AssetTagHelper  - X-Ref

Provides methods for linking a HTML page together with other assets, such as javascripts, stylesheets, and feeds.

setController(&$controller)   X-Ref
No description

auto_discovery_link_tag($type = 'rss', $url_options = array()   X-Ref
Returns a link tag that browsers and news readers can use to auto-detect a RSS or ATOM feed for this page. The +type+ can
either be <tt>'rss'</tt> (default) or <tt>'atom'</tt> and the +options+ follow the $controller->urlFor style of declaring a link target.

Examples:
$asset_tag_helper->auto_discovery_link_tag(); # =>
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.curenthost.com/controller/action" />
$asset_tag_helper->auto_discovery_link_tag('atom'); # =>
<link rel="alternate" type="application/atom+xml" title="ATOM" href="http://www.curenthost.com/controller/action" />
$asset_tag_helper->auto_discovery_link_tag('rss', array('action' => 'feed')); # =>
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.curenthost.com/controller/feed" />
$asset_tag_helper->auto_discovery_link_tag('rss', array('action'=>'feed'), array('title'=>'My RSS')); # =>
<link rel="alternate" type="application/rss+xml" title="My RSS" href="http://www.curenthost.com/controller/feed" />

javascript_path($source)   X-Ref
Returns path to a javascript asset. Example:

$asset_tag_helper->javascript_path('xmlhr'); # => /javascripts/xmlhr.js

javascript_include_tag()   X-Ref
Returns a script include tag per source given as argument. Examples:

$asset_tag_helper->javascript_include_tag ("xmlhr"); # =>
<script type="text/javascript" src="/javascripts/xmlhr.js"></script>

$asset_tag_helper->javascript_include_tag('common.javascript', '/elsewhere/cools'); # =>
<script type="text/javascript" src="/javascripts/common.javascript"></script>
<script type="text/javascript" src="/elsewhere/cools.js"></script>

$asset_tag_helper->javascript_include_tag('defaults'); # =>
<script type="text/javascript" src="/javascripts/prototype.js"></script>
<script type="text/javascript" src="/javascripts/effects.js"></script>
...
<script type="text/javascript" src="/javascripts/application.js"></script> *see below

If there's an <tt>application.js</tt> file in your <tt>public/javascripts</tt> directory,
<tt>$asset_tag_helper->javascript_include_tag('defaults')</tt> will automatically include it. This file
facilitates the inclusion of small snippets of JavaScript code, along the lines of
<tt>controllers/application.php</tt> and <tt>helpers/application_helper.php</tt>.

_get_javascript_included_defaults()   X-Ref
No description

register_javascript_include_default($sources)   X-Ref
Register one or more additional JavaScript files to be included when

javascript_include_tag :defaults

is called. This method is intended to be called only from plugin initialization
to register extra .js files the plugin installed in <tt>public/javascripts</tt>.

reset_javascript_include_default()   X-Ref
No description

stylesheet_path($source)   X-Ref
Returns path to a stylesheet asset. Example:

$asset_tag_helper->stylesheet_path('style'); # => /stylesheets/style.css

stylesheet_link_tag()   X-Ref
Returns a css link tag per source given as argument. Examples:

$asset_tag_helper->stylesheet_link_tag('style'); # =>
<link href="/stylesheets/style.css" media="screen" rel="Stylesheet" type="text/css" />

$asset_tag_helper->stylesheet_link_tag('style', array('media'=>'all')); # =>
<link href="/stylesheets/style.css" media="all" rel="Stylesheet" type="text/css" />

$asset_tag_helper->stylesheet_link_tag('random.styles', '/css/stylish'); # =>
<link href="/stylesheets/random.styles" media="screen" rel="Stylesheet" type="text/css" />
<link href="/css/stylish.css" media="screen" rel="Stylesheet" type="text/css" />

image_path($source)   X-Ref
Returns path to an image asset. Example:

The +src+ can be supplied as a...
* full path, like "/my_images/image.gif"
* file name, like "rss.gif", that gets expanded to "/images/rss.gif"
* file name without extension, like "logo", that gets expanded to "/images/logo.png"

image_tag($source, $options = array()   X-Ref
Returns an image tag converting the +options+ into html options on the tag, but with these special cases:

* <tt>alt</tt>  - If no alt text is given, the file name part of the +src+ is used (capitalized and without the extension)
* <tt>size</tt> - Supplied as "XxY", so "30x45" becomes width="30" and height="45"

The +src+ can be supplied as a...
* full path, like "/my_images/image.gif"
* file name, like "rss.gif", that gets expanded to "/images/rss.gif"
* file name without extension, like "logo", that gets expanded to "/images/logo.png"

_compute_public_path($source, $dir = '', $ext = '')   X-Ref
No description

stylesheet_for_current_controller()   X-Ref
No description

javascript_for_current_controller()   X-Ref
No description



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