示例#1
0
文件: 2.0.php 项目: runt18/phploader
// ("DEBUG") are currently the only valid options.  The former will
// try to get the non-minimized, non-debug version, and the latter
// will get the debug version.
$loader->filter = YUI_DEBUG;
// Set allowRollups to false to prevent automatic rollup.
// $loader->allowRollups = false;
// A list of modules to apply the filter to.  If not supplied, all
// modules will have any defined filters applied.  This can be useful
// when debugging, limiting the amount of noise YUI generates.
// $loader->filterList = array(
// "dragdrop" => true
// );
// If the version is set, a querystring parameter is appended to the
// end of all generated URLs.  This is a cache busting hack for environments
// that always use the same path for the current version of the library.
// $loader->version = "2.4.0";
encoded_out($loader->tags());
// Alternatively, separate calls for css and js
// encoded_out($loader->css());
// print_r('<p>-----------------------------------------------------</p>');
// encoded_out($loader->script());
// JSON output
// encoded_out($loader->json()); // new data struct, bug 1567133
// Just get the data (same struct that json() outputs) as an array
// encoded_out(var_export($loader->data(), true));
print_r('<p>-----------------------------------------------------</p>');
encoded_out($loader->getLoadedModulesAsJSON());
// new data struct, bug 1567133
print_r('<p>-----------------------------------------------------</p>');
encoded_out(var_export($loader->getLoadedModules(), true));
// bug 1512927
<?php

include "./inc/config.inc";
include "../phploader/loader.php";
$loader = new YAHOO_util_Loader($yuiCurrentVersion);
//$customModules
//Specify YUI components to load
$loader->load("calendar");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>YUI PHP Loader Utility Basic Example: Loading YUI Calendar with the YUI PHP Loader Utility</title>
	<?php 
//Output the CSS and JavaScript tags
echo $loader->tags();
?>
</head>

<body class="yui-skin-sam">

<h1>YUI PHP Loader Utility Basic 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="http://developer.yahoo.com/yui/phploader/">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.</p>

<div id="calendar_container"></div>

<script type="text/javascript">
    YAHOO.util.Event.onAvailable("calendar_container", function() {
		var myCal = new YAHOO.widget.Calendar("mycal_id", "calendar_container");
		myCal.render();
示例#3
0
文件: test.php 项目: runt18/phploader
encoded_out("<!-- css -->\n");
encoded_out($l8->css());
encoded_out("<!-- js -->\n");
encoded_out($l8->script());
/* separate css and js output */
//////////////////////////////////////////////////////////////////////////
encoded_out("\n\nTest 9:\n\n");
$l9 = new YAHOO_util_Loader(YUI_VERSION_TO_TEST);
$l9->load("calendar");
encoded_out($l9->json());
/* json */
//////////////////////////////////////////////////////////////////////////
encoded_out("\n\nTest 10:\n\n");
$l10 = new YAHOO_util_Loader(YUI_VERSION_TO_TEST);
$l10->load("calendar");
encoded_out($l10->embed());
///////////////////////////////////////////
encoded_out("\n\nTest 11:\n\n");
//$yui_config->configDebug(array(
//"menu" => true
//));
$l11 = new YAHOO_util_Loader(YUI_VERSION_TO_TEST);
$l11->base = "../../build/";
$l11->filter = YUI_DEBUG;
$l11->load("menu");
encoded_out($l11->tags());
encoded_out($l11->getLoadedModulesAsJSON());
/* embed */
?>