Location: PHPKode > projects > PHP on Trax > johnpipi-trax-f599562/trax/doc/__filesource/fsource_PHPonTrax__vendortraxaction_viewhelpersasset_tag_helper.php.html
<html>
<head>
<title>File Source for asset_tag_helper.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">PHPonTrax</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
  		  [ <a href="../classtrees_PHPonTrax.html" class="menu">class tree: PHPonTrax</a> ]
		  [ <a href="../elementindex_PHPonTrax.html" class="menu">index: PHPonTrax</a> ]
		  [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
      <b>Packages:</b><br />
              <a href="../li_PHPonTrax.html">PHPonTrax</a><br />
              <a href="../li_PHPonTraxTest.html">PHPonTraxTest</a><br />
            <br /><br />
                  
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file asset_tag_helper.php</h1>
<p>Documentation is available at <a href="../PHPonTrax/_vendor_trax_action_view_helpers_asset_tag_helper_php.html">asset_tag_helper.php</a></p>
<div class="php">
<div class="listing"><pre><ol><li><a name="a1"></a><span class="src-php">&lt;?php</span></li>
<li><a name="a2"></a><span class="src-doc">/**</span></li>
<li><a name="a3"></a><span class="src-doc"> *  File containing the AssetTagHelper class and support functions</span></li>
<li><a name="a4"></a><span class="src-doc"> *</span></li>
<li><a name="a5"></a><span class="src-doc"> *  (PHP 5)</span></li>
<li><a name="a6"></a><span class="src-doc"> *</span></li>
<li><a name="a7"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@package</span><span class="src-doc"> PHPonTrax</span></li>
<li><a name="a8"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@version</span><span class="src-doc"> $Id$</span></li>
<li><a name="a9"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@copyright</span><span class="src-doc"> (c) 2005 John Peterson</span></li>
<li><a name="a10"></a><span class="src-doc"> *</span></li>
<li><a name="a11"></a><span class="src-doc"> *   Permission is hereby granted, free of charge, to any person obtaining</span></li>
<li><a name="a12"></a><span class="src-doc"> *   a copy of this software and associated documentation files (the</span></li>
<li><a name="a13"></a><span class="src-doc"> *   &quot;Software&quot;), to deal in the Software without restriction, including</span></li>
<li><a name="a14"></a><span class="src-doc"> *   without limitation the rights to use, copy, modify, merge, publish,</span></li>
<li><a name="a15"></a><span class="src-doc"> *   distribute, sublicense, and/or sell copies of the Software, and to</span></li>
<li><a name="a16"></a><span class="src-doc"> *   permit persons to whom the Software is furnished to do so, subject to</span></li>
<li><a name="a17"></a><span class="src-doc"> *   the following conditions:</span></li>
<li><a name="a18"></a><span class="src-doc"> *</span></li>
<li><a name="a19"></a><span class="src-doc"> *   The above copyright notice and this permission notice shall be</span></li>
<li><a name="a20"></a><span class="src-doc"> *   included in all copies or substantial portions of the Software.</span></li>
<li><a name="a21"></a><span class="src-doc"> *</span></li>
<li><a name="a22"></a><span class="src-doc"> *   THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span></li>
<li><a name="a23"></a><span class="src-doc"> *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span></li>
<li><a name="a24"></a><span class="src-doc"> *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span></li>
<li><a name="a25"></a><span class="src-doc"> *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE</span></li>
<li><a name="a26"></a><span class="src-doc"> *   LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION</span></li>
<li><a name="a27"></a><span class="src-doc"> *   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</span></li>
<li><a name="a28"></a><span class="src-doc"> *   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span></li>
<li><a name="a29"></a><span class="src-doc"> */</span></li>
<li><a name="a30"></a>&nbsp;</li>
<li><a name="a31"></a><span class="src-doc">/**</span></li>
<li><a name="a32"></a><span class="src-doc"> *  Utility to help build HTML/XML link tags for public assets</span></li>
<li><a name="a33"></a><span class="src-doc"> */</span></li>
<li><a name="a34"></a><span class="src-key">class </span><a href="../PHPonTrax/AssetTagHelper.html">AssetTagHelper</a> <span class="src-key">extends </span><a href="../PHPonTrax/Helpers.html">Helpers</a> <span class="src-sym">{</span></li>
<li><a name="a35"></a>&nbsp;</li>
<li><a name="a36"></a>    <span class="src-doc">/**</span></li>
<li><a name="a37"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string[] </span></li>
<li><a name="a38"></a><span class="src-doc">     */</span></li>
<li><a name="a39"></a>    <span class="src-key">var </span><a href="../PHPonTrax/AssetTagHelper.html#var$javascript_default_sources">$javascript_default_sources</a> = <span class="src-id">null</span><span class="src-sym">;</span></li>
<li><a name="a40"></a>&nbsp;</li>
<li><a name="a41"></a>    <span class="src-doc">/**</span></li>
<li><a name="a42"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> Document this method</span></li>
<li><a name="a43"></a><span class="src-doc">     *</span></li>
<li><a name="a44"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> javascript_default_sources</span></li>
<li><a name="a45"></a><span class="src-doc">     */</span></li>
<li><a name="a46"></a>    <span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a47"></a>        <span class="src-id">parent</span><span class="src-sym">::</span><a href="../PHPonTrax/Helpers.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a48"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/AssetTagHelper.html#var$javascript_default_sources">javascript_default_sources</a> =</li>
<li><a name="a49"></a>            <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'JAVASCRIPT_DEFAULT_SOURCES'</span><span class="src-sym">,</span><span class="src-var">$GLOBALS</span><span class="src-sym">)</span></li>
<li><a name="a50"></a>            ? <span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'JAVASCRIPT_DEFAULT_SOURCES'</span><span class="src-sym">]</span></li>
<li><a name="a51"></a>            : <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'prototype'</span><span class="src-sym">, </span><span class="src-str">'effects'</span><span class="src-sym">, </span><span class="src-str">'dragdrop'</span><span class="src-sym">, </span><span class="src-str">'controls'</span><span class="src-sym">)</span><span class="src-sym">;    </span></li>
<li><a name="a52"></a>    <span class="src-sym">}</span></li>
<li><a name="a53"></a>    </li>
<li><a name="a54"></a>    <span class="src-doc">/**</span></li>
<li><a name="a55"></a><span class="src-doc">     *  Compute public path to an asset</span></li>
<li><a name="a56"></a><span class="src-doc">     *</span></li>
<li><a name="a57"></a><span class="src-doc">     *  Build the public path, suitable for inclusion in a URL, to an</span></li>
<li><a name="a58"></a><span class="src-doc">     *  asset.  Arguments are the filename, directory and extension of</span></li>
<li><a name="a59"></a><span class="src-doc">     *  the asset.</span></li>
<li><a name="a60"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc"> Filename of asset</span></li>
<li><a name="a61"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc"> Default directory name, if none in $source</span></li>
<li><a name="a62"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc"> Default file extension, if none in $source</span></li>
<li><a name="a63"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">Public path to the asset</span></li>
<li><a name="a64"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> controller_object</span></li>
<li><a name="a65"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> ActionController::asset_host</span></li>
<li><a name="a66"></a><span class="src-doc">     */</span></li>
<li><a name="a67"></a>    <span class="src-key">private </span><span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#methodcompute_public_path">compute_public_path</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">, </span><span class="src-var">$dir</span><span class="src-sym">, </span><span class="src-var">$ext</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a68"></a> </li>
<li><a name="a69"></a>        <span class="src-comm">//  Test whether source is a URL, ie. starts something://</span></li>
<li><a name="a70"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/^[-a-z]+:\/\//'</span><span class="src-sym">, </span><span class="src-var">$source</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a71"></a>&nbsp;</li>
<li><a name="a72"></a>            <span class="src-comm">//  Source is not a URL.</span></li>
<li><a name="a73"></a>            <span class="src-comm">//  If path doesn't start with '/', prefix /$dir/</span></li>
<li><a name="a74"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">{</span><span class="src-num">0</span><span class="src-sym">} </span>!= <span class="src-str">'/'</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a75"></a>                <span class="src-var">$source </span>= <span class="src-str">&quot;</span><span class="src-str">/{<span class="src-var">$dir</span><span class="src-sym">}</span>/{<span class="src-var">$source</span><span class="src-sym">}</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a76"></a>            <span class="src-sym">}</span></li>
<li><a name="a77"></a>&nbsp;</li>
<li><a name="a78"></a>            <span class="src-comm">//  If no '.' in source file name, add '.ext'</span></li>
<li><a name="a79"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">, </span><span class="src-str">'.'</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a80"></a>                <span class="src-var">$source </span>= <span class="src-str">&quot;</span>{<span class="src-var">$source</span><span class="src-str"></span><span class="src-sym">}</span>.{<span class="src-var">$ext</span><span class="src-sym">}</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a81"></a>            <span class="src-sym">}</span></li>
<li><a name="a82"></a>&nbsp;</li>
<li><a name="a83"></a>            <span class="src-comm">//  If TRAX_URL_PREFIX non-null, prefix it to path</span></li>
<li><a name="a84"></a>            <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_URL_PREFIX">TRAX_URL_PREFIX</a></span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a85"></a>                <span class="src-var">$prefix </span>= <span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_URL_PREFIX">TRAX_URL_PREFIX</a></span><span class="src-sym">;</span></li>
<li><a name="a86"></a>                <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$prefix</span><span class="src-sym">{</span><span class="src-num">0</span><span class="src-sym">} </span>!= <span class="src-str">&quot;/&quot;</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a87"></a>                    <span class="src-var">$prefix </span>= <span class="src-str">&quot;</span><span class="src-str">/<span class="src-var">$prefix</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a88"></a>                <span class="src-sym">}</span></li>
<li><a name="a89"></a>                <span class="src-var">$source </span>= <span class="src-var">$prefix </span>. <span class="src-sym">((</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$prefix</span><span class="src-sym">, </span>-<span class="src-num">1</span><span class="src-sym">) </span>== <span class="src-str">&quot;/&quot;</span><span class="src-sym">)</span></li>
<li><a name="a90"></a>                                     ? <a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">, </span><span class="src-num">1</span><span class="src-sym">) </span>: <span class="src-var">$source</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a91"></a>            <span class="src-sym">}            </span></li>
<li><a name="a92"></a>        <span class="src-sym">}</span></li>
<li><a name="a93"></a>&nbsp;</li>
<li><a name="a94"></a>        <span class="src-comm">//  If controller defined and has asset_host value</span></li>
<li><a name="a95"></a>        <span class="src-comm">//  prefix that to path</span></li>
<li><a name="a96"></a>        <span class="src-comm">//  FIXME: won't this cause a problem if $source was http://...?</span></li>
<li><a name="a97"></a>        <span class="src-key">if </span><span class="src-sym">( </span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$controller_object">controller_object</a><span class="src-sym">)</span></li>
<li><a name="a98"></a>             &amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$controller_object">controller_object</a><span class="src-sym">-&gt;</span><span class="src-id">asset_host</span><span class="src-sym">) ) </span><span class="src-sym">{</span></li>
<li><a name="a99"></a>            <span class="src-var">$source </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$controller_object">controller_object</a><span class="src-sym">-&gt;</span><span class="src-id">asset_host </span>. <span class="src-var">$source</span><span class="src-sym">;</span></li>
<li><a name="a100"></a>        <span class="src-sym">}</span></li>
<li><a name="a101"></a>        <span class="src-key">return </span><span class="src-var">$source</span><span class="src-sym">;</span></li>
<li><a name="a102"></a>    <span class="src-sym">}</span></li>
<li><a name="a103"></a>    </li>
<li><a name="a104"></a>    <span class="src-doc">/**</span></li>
<li><a name="a105"></a><span class="src-doc">     *  Compute public path to a javascript asset</span></li>
<li><a name="a106"></a><span class="src-doc">     *</span></li>
<li><a name="a107"></a><span class="src-doc">     *  Build the public path, suitable for inclusion in a URL, to a</span></li>
<li><a name="a108"></a><span class="src-doc">     *  javascript asset.  Argument is the filename of the asset.</span></li>
<li><a name="a109"></a><span class="src-doc">     *  Default directory to 'javascripts', extension to '.js'</span></li>
<li><a name="a110"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc"> Filename of asset, in one of the formats</span></li>
<li><a name="a111"></a><span class="src-doc">     *                  accepted as the $filename argument of</span></li>
<li><a name="a112"></a><span class="src-doc">     *                  </span><span class="src-doc-inlinetag">{@link compute_public_path()}</span></li>
<li><a name="a113"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">Public path to the javascript asset</span></li>
<li><a name="a114"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> compute_public_path()</span></li>
<li><a name="a115"></a><span class="src-doc">     */</span></li>
<li><a name="a116"></a>    <span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#methodjavascript_path">javascript_path</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a117"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/AssetTagHelper.html#methodcompute_public_path">compute_public_path</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">, </span><span class="src-str">'javascripts'</span><span class="src-sym">, </span><span class="src-str">'js'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a118"></a>    <span class="src-sym">}</span></li>
<li><a name="a119"></a>    </li>
<li><a name="a120"></a>    <span class="src-doc">/**</span></li>
<li><a name="a121"></a><span class="src-doc">     *  Return script include tag for one or more javascript assets</span></li>
<li><a name="a122"></a><span class="src-doc">     *</span></li>
<li><a name="a123"></a><span class="src-doc">     *  javascript_include_tag(&quot;xmlhr&quot;); =&gt;</span></li>
<li><a name="a124"></a><span class="src-doc">     *   &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/xmlhr.js&quot;&gt;&lt;/script&gt;</span></li>
<li><a name="a125"></a><span class="src-doc">     *</span></li>
<li><a name="a126"></a><span class="src-doc">     *  javascript_include_tag(&quot;common.javascript&quot;, &quot;/elsewhere/cools&quot;); =&gt;</span></li>
<li><a name="a127"></a><span class="src-doc">     *   &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/common.javascript&quot;&gt;&lt;/script&gt;</span></li>
<li><a name="a128"></a><span class="src-doc">     *   &lt;script type=&quot;text/javascript&quot; src=&quot;/elsewhere/cools.js&quot;&gt;&lt;/script&gt;</span></li>
<li><a name="a129"></a><span class="src-doc">     *</span></li>
<li><a name="a130"></a><span class="src-doc">     *  javascript_include_tag(&quot;defaults&quot;); =&gt;</span></li>
<li><a name="a131"></a><span class="src-doc">     *   &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/prototype.js&quot;&gt;&lt;/script&gt;</span></li>
<li><a name="a132"></a><span class="src-doc">     *   &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/effects.js&quot;&gt;&lt;/script&gt;</span></li>
<li><a name="a133"></a><span class="src-doc">     *   &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/controls.js&quot;&gt;&lt;/script&gt;</span></li>
<li><a name="a134"></a><span class="src-doc">     *   &lt;script type=&quot;text/javascript&quot; src=&quot;/javascripts/dragdrop.js&quot;&gt;&lt;/script&gt;</span></li>
<li><a name="a135"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc"> The arguments are zero or more strings, followed</span></li>
<li><a name="a136"></a><span class="src-doc">     *                 by an optional array containing options</span></li>
<li><a name="a137"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span></li>
<li><a name="a138"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> content_tag()</span></li>
<li><a name="a139"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> javascript_default_sources</span></li>
<li><a name="a140"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> javascript_path()</span></li>
<li><a name="a141"></a><span class="src-doc">     */</span></li>
<li><a name="a142"></a>    <span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#methodjavascript_include_tag">javascript_include_tag</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a143"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/func_num_args">func_num_args</a><span class="src-sym">(</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a144"></a>            <span class="src-var">$sources </span>= <a href="http://www.php.net/func_get_args">func_get_args</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;     </span></li>
<li><a name="a145"></a>            <span class="src-var">$options </span>= <span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><a href="http://www.php.net/end">end</a><span class="src-sym">(</span><span class="src-var">$sources</span><span class="src-sym">))</span></li>
<li><a name="a146"></a>                        ? <a href="http://www.php.net/array_pop">array_pop</a><span class="src-sym">(</span><span class="src-var">$sources</span><span class="src-sym">) </span>: <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;          </span></li>
<li><a name="a147"></a>            <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-str">'defaults'</span><span class="src-sym">, </span><span class="src-var">$sources</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a148"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/AssetTagHelper.html#var$javascript_default_sources">javascript_default_sources</a><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a149"></a>                    <span class="src-var">$sources </span>= <a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/AssetTagHelper.html#var$javascript_default_sources">javascript_default_sources</a><span class="src-sym">,</span></li>
<li><a name="a150"></a>                                           <span class="src-var">$sources</span><span class="src-sym">)</span><span class="src-sym">;    </span></li>
<li><a name="a151"></a>                <span class="src-sym">}                  </span></li>
<li><a name="a152"></a>                <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_PUBLIC">TRAX_PUBLIC</a></span>. <span class="src-str">&quot;/javascripts/application.js&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a153"></a>                    <span class="src-var">$sources</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-str">'application'</span><span class="src-sym">;</span></li>
<li><a name="a154"></a>                <span class="src-sym">}</span></li>
<li><a name="a155"></a>                <span class="src-comm"># remove defaults from array</span></li>
<li><a name="a156"></a>                unset<span class="src-sym">(</span><span class="src-var">$sources</span><span class="src-sym">[</span><a href="http://www.php.net/array_search">array_search</a><span class="src-sym">(</span><span class="src-str">'defaults'</span><span class="src-sym">, </span><span class="src-var">$sources</span><span class="src-sym">)</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;  </span></li>
<li><a name="a157"></a>            <span class="src-sym">}</span></li>
<li><a name="a158"></a>            <span class="src-var">$contents </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a159"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$sources </span><span class="src-key">as </span><span class="src-var">$source</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a160"></a>                <span class="src-var">$source </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/AssetTagHelper.html#methodjavascript_path">javascript_path</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a161"></a>                <span class="src-var">$contents</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodcontent_tag">content_tag</a><span class="src-sym">(</span><span class="src-str">&quot;script&quot;</span><span class="src-sym">, </span><span class="src-str">&quot;&quot;</span><span class="src-sym">,</span></li>
<li><a name="a162"></a>                     <a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">&quot;type&quot; </span>=&gt; <span class="src-str">&quot;text/javascript&quot;</span><span class="src-sym">,</span></li>
<li><a name="a163"></a>                                       <span class="src-str">&quot;src&quot; </span>=&gt; <span class="src-var">$source</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a164"></a>            <span class="src-sym">}</span></li>
<li><a name="a165"></a>            <span class="src-key">return </span><a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">&quot;&quot;</span><span class="src-sym">, </span><span class="src-var">$contents</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a166"></a>        <span class="src-sym">}</span></li>
<li><a name="a167"></a>    <span class="src-sym">}</span></li>
<li><a name="a168"></a>    </li>
<li><a name="a169"></a>    <span class="src-doc">/**</span></li>
<li><a name="a170"></a><span class="src-doc">     *  Compute public path to a stylesheet asset</span></li>
<li><a name="a171"></a><span class="src-doc">     *</span></li>
<li><a name="a172"></a><span class="src-doc">     *  Build the public path, suitable for inclusion in a URL, to a</span></li>
<li><a name="a173"></a><span class="src-doc">     *  stylesheet asset.  Argument is the filename of the asset.</span></li>
<li><a name="a174"></a><span class="src-doc">     *  Default directory to 'stylesheets', extension to '.css'</span></li>
<li><a name="a175"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc"> Filename of asset, in one of the formats</span></li>
<li><a name="a176"></a><span class="src-doc">     *                  accepted as the $filename argument of</span></li>
<li><a name="a177"></a><span class="src-doc">     *                  </span><span class="src-doc-inlinetag">{@link compute_public_path()}</span></li>
<li><a name="a178"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">Public path to the stylesheet asset</span></li>
<li><a name="a179"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> compute_public_path()</span></li>
<li><a name="a180"></a><span class="src-doc">     */</span></li>
<li><a name="a181"></a>    <span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#methodstylesheet_path">stylesheet_path</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a182"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/AssetTagHelper.html#methodcompute_public_path">compute_public_path</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">, </span><span class="src-str">'stylesheets'</span><span class="src-sym">, </span><span class="src-str">'css'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a183"></a>    <span class="src-sym">}</span></li>
<li><a name="a184"></a>    </li>
<li><a name="a185"></a>    <span class="src-doc">/**</span></li>
<li><a name="a186"></a><span class="src-doc">     *  Build link tags to one or more stylesheet assets</span></li>
<li><a name="a187"></a><span class="src-doc">     *</span></li>
<li><a name="a188"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc"> One or more assets, optionally followed by an</span></li>
<li><a name="a189"></a><span class="src-doc">     *                 array describing options to apply to the tags</span></li>
<li><a name="a190"></a><span class="src-doc">     *                 generated for these assets.&lt;br&gt;  Each asset is a</span></li>
<li><a name="a191"></a><span class="src-doc">     *                 string in one of the formats accepted as value</span></li>
<li><a name="a192"></a><span class="src-doc">     *                 of the $source argument of</span></li>
<li><a name="a193"></a><span class="src-doc">     *                 </span><span class="src-doc-inlinetag">{@link stylesheet_path()}</span><span class="src-doc">.&lt;br&gt;  The optional last</span></li>
<li><a name="a194"></a><span class="src-doc">     *                 argument is an array whose keys are names of</span></li>
<li><a name="a195"></a><span class="src-doc">     *                 attributes of the link tag and whose corresponding</span></li>
<li><a name="a196"></a><span class="src-doc">     *                 values are the values assigned to each</span></li>
<li><a name="a197"></a><span class="src-doc">     *                 attribute.  If omitted, options default to:</span></li>
<li><a name="a198"></a><span class="src-doc">     *                 &lt;ul&gt;</span></li>
<li><a name="a199"></a><span class="src-doc">     *                   &lt;li&gt;&quot;rel&quot; =&gt; &quot;Stylesheet&quot;&lt;/li&gt;</span></li>
<li><a name="a200"></a><span class="src-doc">     *                   &lt;li&gt;&quot;type&quot; =&gt; &quot;text/css&quot;&lt;/li&gt;</span></li>
<li><a name="a201"></a><span class="src-doc">     *                   &lt;li&gt;&quot;media&quot; =&gt; &quot;screen&quot;&lt;/li&gt;</span></li>
<li><a name="a202"></a><span class="src-doc">     *                   &lt;li&gt;&quot;href&quot; =&gt; &lt;i&gt;path-to-source&lt;/i&gt;&lt;/li&gt;</span></li>
<li><a name="a203"></a><span class="src-doc">     *                 &lt;/ul&gt;</span></li>
<li><a name="a204"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> A link tag for each asset in the argument list</span></li>
<li><a name="a205"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> stylesheet_path()</span></li>
<li><a name="a206"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> tag()</span></li>
<li><a name="a207"></a><span class="src-doc">     */</span></li>
<li><a name="a208"></a>    <span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#methodstylesheet_link_tag">stylesheet_link_tag</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a209"></a>        <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/func_num_args">func_num_args</a><span class="src-sym">(</span><span class="src-sym">) </span>&gt; <span class="src-num">0</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a210"></a>            <span class="src-var">$sources </span>= <a href="http://www.php.net/func_get_args">func_get_args</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;     </span></li>
<li><a name="a211"></a>            <span class="src-var">$options </span>= <span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><a href="http://www.php.net/end">end</a><span class="src-sym">(</span><span class="src-var">$sources</span><span class="src-sym">))</span></li>
<li><a name="a212"></a>                        ? <a href="http://www.php.net/array_pop">array_pop</a><span class="src-sym">(</span><span class="src-var">$sources</span><span class="src-sym">) </span>: <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a213"></a>            <span class="src-var">$contents </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a214"></a>            <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$sources </span><span class="src-key">as </span><span class="src-var">$source</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a215"></a>                <span class="src-var">$source </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/AssetTagHelper.html#methodstylesheet_path">stylesheet_path</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a216"></a>                <span class="src-var">$contents</span><span class="src-sym">[</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodtag">tag</a><span class="src-sym">(</span><span class="src-str">&quot;link&quot;</span><span class="src-sym">,</span></li>
<li><a name="a217"></a>                   <a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">&quot;rel&quot; </span>=&gt; <span class="src-str">&quot;Stylesheet&quot;</span><span class="src-sym">,</span></li>
<li><a name="a218"></a>                                     <span class="src-str">&quot;type&quot; </span>=&gt; <span class="src-str">&quot;text/css&quot;</span><span class="src-sym">,</span></li>
<li><a name="a219"></a>                                     <span class="src-str">&quot;media&quot; </span>=&gt; <span class="src-str">&quot;screen&quot;</span><span class="src-sym">,</span></li>
<li><a name="a220"></a>                                     <span class="src-str">&quot;href&quot; </span>=&gt; <span class="src-var">$source</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a221"></a>            <span class="src-sym">}</span></li>
<li><a name="a222"></a>            <span class="src-key">return </span><a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">&quot;&quot;</span><span class="src-sym">, </span><span class="src-var">$contents</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a223"></a>        <span class="src-sym">}</span></li>
<li><a name="a224"></a>    <span class="src-sym">}</span></li>
<li><a name="a225"></a>    </li>
<li><a name="a226"></a>    <span class="src-doc">/**</span></li>
<li><a name="a227"></a><span class="src-doc">     *  Compute public path to a image asset</span></li>
<li><a name="a228"></a><span class="src-doc">     *</span></li>
<li><a name="a229"></a><span class="src-doc">     *  Build the public path, suitable for inclusion in a URL, to a</span></li>
<li><a name="a230"></a><span class="src-doc">     *  image asset.  Argument is the filename of the asset.</span></li>
<li><a name="a231"></a><span class="src-doc">     *  Default directory to 'images', extension to '.png'</span></li>
<li><a name="a232"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc"> Filename of asset, in one of the formats</span></li>
<li><a name="a233"></a><span class="src-doc">     *                  accepted as the $filename argument of</span></li>
<li><a name="a234"></a><span class="src-doc">     *                  </span><span class="src-doc-inlinetag">{@link compute_public_path()}</span></li>
<li><a name="a235"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc">Public path to the image asset</span></li>
<li><a name="a236"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> compute_public_path()</span></li>
<li><a name="a237"></a><span class="src-doc">     */</span></li>
<li><a name="a238"></a>    <span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#methodimage_path">image_path</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a239"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/AssetTagHelper.html#methodcompute_public_path">compute_public_path</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">, </span><span class="src-str">'images'</span><span class="src-sym">, </span><span class="src-str">'png'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a240"></a>    <span class="src-sym">}</span></li>
<li><a name="a241"></a>    </li>
<li><a name="a242"></a>    <span class="src-doc">/**</span></li>
<li><a name="a243"></a><span class="src-doc">     *  Build image tags to an image asset</span></li>
<li><a name="a244"></a><span class="src-doc">     *</span></li>
<li><a name="a245"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">mixed </span><span class="src-doc"> An image asset optionally followed by an</span></li>
<li><a name="a246"></a><span class="src-doc">     *                 array describing options to apply to the tag</span></li>
<li><a name="a247"></a><span class="src-doc">     *                 generated for this asset.&lt;br&gt;The asset is a</span></li>
<li><a name="a248"></a><span class="src-doc">     *                 string in one of the formats accepted as value</span></li>
<li><a name="a249"></a><span class="src-doc">     *                 of the $source argument of</span></li>
<li><a name="a250"></a><span class="src-doc">     *                 </span><span class="src-doc-inlinetag">{@link image_path()}</span><span class="src-doc">.&lt;br&gt;  The optional second</span></li>
<li><a name="a251"></a><span class="src-doc">     *                 argument is an array whose keys are names of</span></li>
<li><a name="a252"></a><span class="src-doc">     *                 attributes of the image tag and whose corresponding</span></li>
<li><a name="a253"></a><span class="src-doc">     *                 values are the values assigned to each</span></li>
<li><a name="a254"></a><span class="src-doc">     *                 attribute.  The image size can be specified in</span></li>
<li><a name="a255"></a><span class="src-doc">     *                 two ways: by specifying option values &quot;width&quot; =&gt;</span></li>
<li><a name="a256"></a><span class="src-doc">     *                 &lt;i&gt;width&lt;/i&gt; and &quot;height&quot; =&gt; &lt;i&gt;height&lt;/i&gt;, or</span></li>
<li><a name="a257"></a><span class="src-doc">     *                 by specifying option &quot;size&quot; =&gt; &quot;&lt;i&gt;width&lt;/i&gt;</span></li>
<li><a name="a258"></a><span class="src-doc">     *                 x &lt;i&gt;height&lt;/i&gt;&quot;.  If omitted, options default to:</span></li>
<li><a name="a259"></a><span class="src-doc">     *                 &lt;ul&gt;</span></li>
<li><a name="a260"></a><span class="src-doc">     *                   &lt;li&gt;&quot;alt&quot; =&gt; &lt;i&gt;humanized filename&lt;/i&gt;&lt;/li&gt;</span></li>
<li><a name="a261"></a><span class="src-doc">     *                   &lt;li&gt;&quot;width&quot; and &quot;height&quot; value computed from</span></li>
<li><a name="a262"></a><span class="src-doc">     *                        value of &quot;size&quot;&lt;/li&gt;</span></li>
<li><a name="a263"></a><span class="src-doc">     *                 &lt;/ul&gt;</span></li>
<li><a name="a264"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@return </span><span class="src-doc-type">string </span><span class="src-doc"> A image tag for each asset in the argument list</span></li>
<li><a name="a265"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> image_path()</span></li>
<li><a name="a266"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> tag()</span></li>
<li><a name="a267"></a><span class="src-doc">     */</span></li>
<li><a name="a268"></a>    <span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#methodimage_tag">image_tag</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a269"></a>        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'src'</span><span class="src-sym">] </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/AssetTagHelper.html#methodimage_path">image_path</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a270"></a>        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'alt'</span><span class="src-sym">] </span>= <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'alt'</span><span class="src-sym">,</span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a271"></a>            ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'alt'</span><span class="src-sym">]</span></li>
<li><a name="a272"></a>            : <span class="src-id"><a href="../PHPonTrax/Inflector.html">Inflector</a></span><span class="src-sym">::</span><a href="../PHPonTrax/Inflector.html#methodcapitalize">capitalize</a><span class="src-sym">(</span><a href="http://www.php.net/reset">reset</a><span class="src-sym">(</span><span class="src-var">$file_array </span>=</li>
<li><a name="a273"></a>                             <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'.'</span><span class="src-sym">, </span><a href="http://www.php.net/basename">basename</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'src'</span><span class="src-sym">]</span><span class="src-sym">))))</span><span class="src-sym">;</span></li>
<li><a name="a274"></a>        <span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'size'</span><span class="src-sym">]</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a275"></a>            <span class="src-var">$size </span>= <a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'x'</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;size&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;         </span></li>
<li><a name="a276"></a>            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'width'</span><span class="src-sym">] </span>= <a href="http://www.php.net/reset">reset</a><span class="src-sym">(</span><span class="src-var">$size</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a277"></a>            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'height'</span><span class="src-sym">] </span>= <a href="http://www.php.net/end">end</a><span class="src-sym">(</span><span class="src-var">$size</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a278"></a>            unset<span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">'size'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a279"></a>        <span class="src-sym">}</span></li>
<li><a name="a280"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodtag">tag</a><span class="src-sym">(</span><span class="src-str">&quot;img&quot;</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a281"></a>    <span class="src-sym">}</span></li>
<li><a name="a282"></a>    </li>
<li><a name="a283"></a>    <span class="src-doc">/**</span></li>
<li><a name="a284"></a><span class="src-doc">     *  Returns a link tag that browsers and news readers can use to</span></li>
<li><a name="a285"></a><span class="src-doc">     *  auto-detect a RSS or ATOM feed for this page. The $type can</span></li>
<li><a name="a286"></a><span class="src-doc">     *  either be &lt;tt&gt;:rss&lt;/tt&gt; (default) or &lt;tt&gt;:atom&lt;/tt&gt; and the</span></li>
<li><a name="a287"></a><span class="src-doc">     *  $options follow the url_for() style of declaring a link</span></li>
<li><a name="a288"></a><span class="src-doc">     *  target.</span></li>
<li><a name="a289"></a><span class="src-doc">     *</span></li>
<li><a name="a290"></a><span class="src-doc">     *  Examples:</span></li>
<li><a name="a291"></a><span class="src-doc">     *  auto_discovery_link_tag  =&gt;</span></li>
<li><a name="a292"></a><span class="src-doc">     *   &lt;link rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;RSS&quot;</span></li>
<li><a name="a293"></a><span class="src-doc">     *  href=&quot;http://www.curenthost.com/controller/action&quot; /&gt;</span></li>
<li><a name="a294"></a><span class="src-doc">     *  auto_discovery_link_tag(:atom) =&gt;</span></li>
<li><a name="a295"></a><span class="src-doc">     *   &lt;link rel=&quot;alternate&quot; type=&quot;application/atom+xml&quot;</span></li>
<li><a name="a296"></a><span class="src-doc">     *  title=&quot;ATOM&quot;</span></li>
<li><a name="a297"></a><span class="src-doc">     *  href=&quot;http://www.curenthost.com/controller/action&quot; /&gt;</span></li>
<li><a name="a298"></a><span class="src-doc">     *  auto_discovery_link_tag(:rss, {:action =&gt; &quot;feed&quot;}) =&gt;</span></li>
<li><a name="a299"></a><span class="src-doc">     *   &lt;link rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;RSS&quot;</span></li>
<li><a name="a300"></a><span class="src-doc">     *  href=&quot;http://www.curenthost.com/controller/feed&quot; /&gt;</span></li>
<li><a name="a301"></a><span class="src-doc">     *  auto_discovery_link_tag(:rss, {:action =&gt; &quot;feed&quot;}, {:title =&gt;</span></li>
<li><a name="a302"></a><span class="src-doc">     *  &quot;My RSS&quot;})  =&gt;</span></li>
<li><a name="a303"></a><span class="src-doc">     *   &lt;link rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;My</span></li>
<li><a name="a304"></a><span class="src-doc">     *  RSS&quot; href=&quot;http://www.curenthost.com/controller/feed&quot; /&gt;</span></li>
<li><a name="a305"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> tag()</span></li>
<li><a name="a306"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> url_for()</span></li>
<li><a name="a307"></a><span class="src-doc">     */</span></li>
<li><a name="a308"></a>    <span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#methodauto_discovery_link_tag">auto_discovery_link_tag</a><span class="src-sym">(</span><span class="src-var">$type </span>= <span class="src-str">'rss'</span><span class="src-sym">, </span><span class="src-var">$options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a309"></a>                                     <span class="src-var">$tag_options </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a310"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodtag">tag</a><span class="src-sym">(</span></li>
<li><a name="a311"></a>          <span class="src-str">&quot;link&quot;</span><span class="src-sym">, </span><span class="src-key">array</span><span class="src-sym">(</span></li>
<li><a name="a312"></a>                        <span class="src-str">&quot;rel&quot; </span>=&gt; <span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'rel'</span><span class="src-sym">,</span><span class="src-var">$tag_options</span><span class="src-sym">)</span></li>
<li><a name="a313"></a>                                  ? <span class="src-var">$tag_options</span><span class="src-sym">[</span><span class="src-str">'rel'</span><span class="src-sym">] </span>: <span class="src-str">&quot;alternate&quot;</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a314"></a>                        <span class="src-str">&quot;type&quot; </span>=&gt; <span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'type'</span><span class="src-sym">,</span><span class="src-var">$tag_options</span><span class="src-sym">)</span></li>
<li><a name="a315"></a>                                   ? <span class="src-var">$tag_options</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span></li>
<li><a name="a316"></a>                                   : <span class="src-str">&quot;</span><span class="src-str"><span class="src-id">application</span>/{<span class="src-var">$type</span><span class="src-sym">}</span>+<span class="src-id">xml</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a317"></a>                        <span class="src-str">&quot;title&quot; </span>=&gt; <span class="src-sym">(</span><a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'title'</span><span class="src-sym">,</span><span class="src-var">$tag_options</span><span class="src-sym">)</span></li>
<li><a name="a318"></a>                                    ? <span class="src-var">$tag_options</span><span class="src-sym">[</span><span class="src-str">'title'</span><span class="src-sym">]</span></li>
<li><a name="a319"></a>                                    : <a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">))</span><span class="src-sym">,</span></li>
<li><a name="a320"></a>                        <span class="src-str">&quot;href&quot; </span>=&gt; <a href="../PHPonTrax/_vendor_trax_action_view_helpers_url_helper_php.html#functionurl_for">url_for</a><span class="src-sym">(</span><a href="http://www.php.net/array_merge">array_merge</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">,</span></li>
<li><a name="a321"></a>                                         <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'only_path' </span>=&gt; <span class="src-id">false</span><span class="src-sym">))))</span></li>
<li><a name="a322"></a>          <span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a323"></a>    <span class="src-sym">}    </span></li>
<li><a name="a324"></a><span class="src-sym">}</span></li>
<li><a name="a325"></a>&nbsp;</li>
<li><a name="a326"></a><span class="src-doc">/**</span></li>
<li><a name="a327"></a><span class="src-doc"> *  Make a new AssetTagHelper object and call its auto_discovery_link_tag() method</span></li>
<li><a name="a328"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> AssetTagHelper::auto_discovery_link_tag()</span></li>
<li><a name="a329"></a><span class="src-doc"> */</span></li>
<li><a name="a330"></a><span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#methodauto_discovery_link_tag">auto_discovery_link_tag</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a331"></a>    <span class="src-var">$asset_helper </span>= <span class="src-key">new </span><span class="src-id"><a href="../PHPonTrax/AssetTagHelper.html">AssetTagHelper</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a332"></a>    <span class="src-var">$args </span>= <a href="http://www.php.net/func_get_args">func_get_args</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a333"></a>    <span class="src-key">return </span><a href="http://www.php.net/call_user_func_array">call_user_func_array</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$asset_helper</span><span class="src-sym">,</span></li>
<li><a name="a334"></a>                                      <span class="src-str">'auto_discovery_link_tag'</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a335"></a><span class="src-sym">}</span></li>
<li><a name="a336"></a>&nbsp;</li>
<li><a name="a337"></a><span class="src-doc">/**</span></li>
<li><a name="a338"></a><span class="src-doc"> *  Make a new AssetTagHelper object and call its image_tag() method</span></li>
<li><a name="a339"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> AssetTagHelper::image_tag()</span></li>
<li><a name="a340"></a><span class="src-doc"> */</span></li>
<li><a name="a341"></a><span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#methodimage_tag">image_tag</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a342"></a>    <span class="src-var">$asset_helper </span>= <span class="src-key">new </span><span class="src-id"><a href="../PHPonTrax/AssetTagHelper.html">AssetTagHelper</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a343"></a>    <span class="src-var">$args </span>= <a href="http://www.php.net/func_get_args">func_get_args</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a344"></a>    <span class="src-key">return </span><a href="http://www.php.net/call_user_func_array">call_user_func_array</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$asset_helper</span><span class="src-sym">, </span><span class="src-str">'image_tag'</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a345"></a><span class="src-sym">}</span></li>
<li><a name="a346"></a>&nbsp;</li>
<li><a name="a347"></a><span class="src-doc">/**</span></li>
<li><a name="a348"></a><span class="src-doc"> *  Make a new AssetTagHelper object and call its stylesheet_link_tag() method</span></li>
<li><a name="a349"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> AssetTagHelper::stylesheet_link_tag()</span></li>
<li><a name="a350"></a><span class="src-doc"> */</span></li>
<li><a name="a351"></a><span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#methodstylesheet_link_tag">stylesheet_link_tag</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a352"></a>    <span class="src-var">$asset_helper </span>= <span class="src-key">new </span><span class="src-id"><a href="../PHPonTrax/AssetTagHelper.html">AssetTagHelper</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a353"></a>    <span class="src-var">$args </span>= <a href="http://www.php.net/func_get_args">func_get_args</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a354"></a>    <span class="src-key">return </span><a href="http://www.php.net/call_user_func_array">call_user_func_array</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$asset_helper</span><span class="src-sym">,</span></li>
<li><a name="a355"></a>                                      <span class="src-str">'stylesheet_link_tag'</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a356"></a><span class="src-sym">}</span></li>
<li><a name="a357"></a>&nbsp;</li>
<li><a name="a358"></a><span class="src-doc">/**</span></li>
<li><a name="a359"></a><span class="src-doc"> *  Make a new AssetTagHelper object and call its javascript_include_tag() method</span></li>
<li><a name="a360"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> AssetTagHelper::javascript_include_tag()</span></li>
<li><a name="a361"></a><span class="src-doc"> */</span></li>
<li><a name="a362"></a><span class="src-key">function </span><a href="../PHPonTrax/AssetTagHelper.html#methodjavascript_include_tag">javascript_include_tag</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a363"></a>    <span class="src-var">$asset_helper </span>= <span class="src-key">new </span><span class="src-id"><a href="../PHPonTrax/AssetTagHelper.html">AssetTagHelper</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a364"></a>    <span class="src-var">$args </span>= <a href="http://www.php.net/func_get_args">func_get_args</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a365"></a>    <span class="src-key">return </span><a href="http://www.php.net/call_user_func_array">call_user_func_array</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$asset_helper</span><span class="src-sym">,</span></li>
<li><a name="a366"></a>                                      <span class="src-str">'javascript_include_tag'</span><span class="src-sym">)</span><span class="src-sym">, </span><span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a367"></a><span class="src-sym">}</span></li>
<li><a name="a368"></a>&nbsp;</li>
<li><a name="a369"></a><span class="src-comm">// -- set Emacs parameters --</span></li>
<li><a name="a370"></a><span class="src-comm">// Local variables:</span></li>
<li><a name="a371"></a><span class="src-comm">// tab-width: 4</span></li>
<li><a name="a372"></a><span class="src-comm">// c-basic-offset: 4</span></li>
<li><a name="a373"></a><span class="src-comm">// c-hanging-comment-ender-p: nil</span></li>
<li><a name="a374"></a><span class="src-comm">// indent-tabs-mode: nil</span></li>
<li><a name="a375"></a><span class="src-comm">// End:</span></li>
<li><a name="a376"></a><span class="src-php">?&gt;</span></li>
</ol></pre></div>
</div>
        <div class="credit">
		    <hr />
		    Documentation generated on Thu, 04 May 2006 19:47:18 -0600 by <a href="http://www.phpdoc.org">phpDocumentor 1.3.0RC4</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>
Return current item: PHP on Trax