PHPonTrax
[ class tree: PHPonTrax ] [ index: PHPonTrax ] [ all elements ]

Class: AssetTagHelper

Source Location: /vendor/trax/action_view/helpers/asset_tag_helper.php

Class Overview

Helpers
   |
   --AssetTagHelper

Utility to help build HTML/XML link tags for public assets


Variables

Methods


Inherited Variables

Inherited Methods

Class: Helpers

Helpers::__construct()
Construct a Helpers object
Helpers::boolean_attribute()
Convert an attribute to proper XML boolean form
Helpers::cdata_section()
Wrap CDATA begin and end tags around argument
Helpers::content_tag()
Generate an open/close pair of tags with optional attributes and content between
Helpers::convert_options()
Convert selected attributes to proper XML boolean form
Helpers::object()
Given the name of an ActiveRecord subclass, find an instance
Helpers::tag()
Generate an HTML or XML tag with optional attributes and self-ending
Helpers::tag_options()
Convert array of tag attribute names and values to string
Helpers::to_content_tag()
Helpers::value()
Get value of current attribute in the current ActiveRecord object

Class Details

[line 34]
Utility to help build HTML/XML link tags for public assets



[ Top ]


Class Variables

$javascript_default_sources =  null

[line 39]



Tags:


Type:   string[]


[ Top ]



Class Methods


constructor __construct [line 46]

AssetTagHelper __construct( )



Tags:

uses:  AssetTagHelper::$javascript_default_sources
todo:  Document this method


Overrides Helpers::__construct() (Construct a Helpers object)

[ Top ]

method auto_discovery_link_tag [line 308]

void auto_discovery_link_tag( [mixed $type = 'rss'], [mixed $options = array()], [mixed $tag_options = array()])

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 url_for() style of declaring a link target.

Examples: auto_discovery_link_tag => <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.curenthost.com/controller/action" /> auto_discovery_link_tag(:atom) => <link rel="alternate" type="application/atom+xml" title="ATOM" href="http://www.curenthost.com/controller/action" /> auto_discovery_link_tag(:rss, {:action => "feed"}) => <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.curenthost.com/controller/feed" /> auto_discovery_link_tag(:rss, {:action => "feed"}, {:title => "My RSS"}) => <link rel="alternate" type="application/rss+xml" title="My RSS" href="http://www.curenthost.com/controller/feed" />




Tags:

usedby:  auto_discovery_link_tag()
uses:  url_for()
uses:  Helpers::tag()


[ Top ]

method compute_public_path [line 67]

string compute_public_path( string $source, string $dir, string $ext)

Compute public path to an asset

Build the public path, suitable for inclusion in a URL, to an asset. Arguments are the filename, directory and extension of the asset.




Tags:

return:  Public path to the asset
usedby:  AssetTagHelper::stylesheet_path()
usedby:  AssetTagHelper::image_path()
usedby:  AssetTagHelper::javascript_path()
access:  private
uses:  ActionController::asset_host
uses:  Helpers::$controller_object


Parameters:

string   $source   Filename of asset
string   $dir   Default directory name, if none in $source
string   $ext   Default file extension, if none in $source

[ Top ]

method image_path [line 238]

string image_path( string $source)

Compute public path to a image asset

Build the public path, suitable for inclusion in a URL, to a image asset. Argument is the filename of the asset. Default directory to 'images', extension to '.png'




Tags:

return:  Public path to the image asset
usedby:  AssetTagHelper::image_tag()
uses:  AssetTagHelper::compute_public_path()


Parameters:

string   $source   Filename of asset, in one of the formats accepted as the $filename argument of compute_public_path()

[ Top ]

method image_tag [line 268]

string image_tag( mixed $source, [mixed $options = array()])

Build image tags to an image asset



Tags:

return:  A image tag for each asset in the argument list
usedby:  image_tag()
uses:  Helpers::tag()
uses:  AssetTagHelper::image_path()


Parameters:

mixed   $source   An image asset optionally followed by an array describing options to apply to the tag generated for this asset.
The asset is a string in one of the formats accepted as value of the $source argument of image_path().
The optional second argument is an array whose keys are names of attributes of the image tag and whose corresponding values are the values assigned to each attribute. The image size can be specified in two ways: by specifying option values "width" => width and "height" => height, or by specifying option "size" => "width x height". If omitted, options default to:
  • "alt" => humanized filename
  • "width" and "height" value computed from value of "size"

[ Top ]

method javascript_include_tag [line 142]

string javascript_include_tag( mixed 0)

Return script include tag for one or more javascript assets

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

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>

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/controls.js"></script> <script type="text/javascript" src="/javascripts/dragdrop.js"></script>




Tags:



Parameters:

mixed   0   The arguments are zero or more strings, followed by an optional array containing options

[ Top ]

method javascript_path [line 116]

string javascript_path( string $source)

Compute public path to a javascript asset

Build the public path, suitable for inclusion in a URL, to a javascript asset. Argument is the filename of the asset. Default directory to 'javascripts', extension to '.js'




Tags:

return:  Public path to the javascript asset
usedby:  AssetTagHelper::javascript_include_tag()
uses:  AssetTagHelper::compute_public_path()


Parameters:

string   $source   Filename of asset, in one of the formats accepted as the $filename argument of compute_public_path()

[ Top ]

method stylesheet_link_tag [line 208]

string stylesheet_link_tag( mixed 0)

Build link tags to one or more stylesheet assets



Tags:

return:  A link tag for each asset in the argument list
usedby:  stylesheet_link_tag()
uses:  Helpers::tag()
uses:  AssetTagHelper::stylesheet_path()


Parameters:

mixed   0   One or more assets, optionally followed by an array describing options to apply to the tags generated for these assets.
Each asset is a string in one of the formats accepted as value of the $source argument of stylesheet_path().
The optional last argument is an array whose keys are names of attributes of the link tag and whose corresponding values are the values assigned to each attribute. If omitted, options default to:
  • "rel" => "Stylesheet"
  • "type" => "text/css"
  • "media" => "screen"
  • "href" => path-to-source

[ Top ]

method stylesheet_path [line 181]

string stylesheet_path( string $source)

Compute public path to a stylesheet asset

Build the public path, suitable for inclusion in a URL, to a stylesheet asset. Argument is the filename of the asset. Default directory to 'stylesheets', extension to '.css'




Tags:

return:  Public path to the stylesheet asset
usedby:  AssetTagHelper::stylesheet_link_tag()
uses:  AssetTagHelper::compute_public_path()


Parameters:

string   $source   Filename of asset, in one of the formats accepted as the $filename argument of compute_public_path()

[ Top ]


Documentation generated on Thu, 04 May 2006 19:47:18 -0600 by phpDocumentor 1.3.0RC4