Fetching contributors…
Cannot retrieve contributors at this time
39 lines (32 sloc) 1.81 KB
$loader = new YAHOO_util_Loader($yuiCurrentVersion);
//Specify YUI components to load
<title>YUI PHP Loader Utility Advanced Example: Loading YUI Calendar with the YUI PHP Loader Utility</title>
//Output the CSS link tags
echo $loader->css();
<body class="yui-skin-sam">
<h1>YUI PHP Loader Utility Advanced Example: Loading the YUI Calendar Control with the YUI PHP Loader Utility</h1>
<p>In this example, we bring a YUI component onto the page using the <a href="">YUI PHP Loader Utility</a>. This example implements YUI PHP Loader via a <code>YAHOO_util_Loader</code> instance. We include the YUI PHP Loader class file, then specify in configuration which component we want loaded on the page &mdash; and what we want to do once it <em>is</em> loaded. The main difference between this advanced example and the simple one show <a href="./phploader-basic.html">here</a> is that this one outputs the CSS and JavaScript files separately with two different method calls. The CSS files are included in the document head and the JavaScript files are included just before the closing body node. This is done in accordance with the best practice performance recommendations outlined <a href="">here</a>.</p>
<div id="calendar_container"></div>
//Output the script tags
echo $loader->script();
<script type="text/javascript">
YAHOO.util.Event.onAvailable("calendar_container", function() {
var myCal = new YAHOO.widget.Calendar("mycal_id", "calendar_container");