summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Advanced/es
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-10-21 14:00:46 +0000
committerctrlaltca@gmail.com <>2011-10-21 14:00:46 +0000
commit615c15d9a2001c58b2030c23b44f655b57dd21d0 (patch)
treedbfabc8ed347e6214472df6a0c54060e34fd24b5 /demos/quickstart/protected/pages/Advanced/es
parentad678bcd067deafcaa9984b179471fd980465cd8 (diff)
removed TClientScriptLoader missed in r3039. Updated documentation
Diffstat (limited to 'demos/quickstart/protected/pages/Advanced/es')
-rw-r--r--demos/quickstart/protected/pages/Advanced/es/Scripts3.page52
1 files changed, 0 insertions, 52 deletions
diff --git a/demos/quickstart/protected/pages/Advanced/es/Scripts3.page b/demos/quickstart/protected/pages/Advanced/es/Scripts3.page
index 416df4f8..37885abb 100644
--- a/demos/quickstart/protected/pages/Advanced/es/Scripts3.page
+++ b/demos/quickstart/protected/pages/Advanced/es/Scripts3.page
@@ -36,56 +36,4 @@ and its dependencies will be automatically included on the page.</p>
<p id="850762" class="block-content">See <a href="?page=Controls.ClientScript">TClientScript</a> for options of adding
your custom Javascript code to the page.</p>
-<h2 id="176028">Publishing Javascript Libraries as Assets</h2>
-<com:SinceVersion Version="3.1b" />
-<p class="block-content">Use <a href="?page=Controls.ClientScriptLoader">TClientScriptLoader</a> to publish and combine multiple existing javascript files (e.g. javascript libraries distributed with Prado or otherwise)
-as packages.</p> For greater control on what and when to publish, use the
-<tt>registerJavascriptPackages($base, $packages, $debug=null, $gzip=true)</tt>
-method in the <tt>TClientScriptManager</tt> class, which an instance can be obtained
-using <tt>$this->getPage()->getClientScript()</tt> or its equivalents.
-For example, if multiple controls will use the same set of javascript libraries,
-write a class to handle the registration of packages required by those controls.
-</p>
-<com:TTextHighlighter Language="php" CssClass="source block-content">
-class MyJavascriptLib extends TComponent
-{
- private $_packages=array(); //keep track of all registrations
-
- private $_manager;
-
- protected function __construct(TPage $owner)
- {
- $this->_manager = $owner->getClientScript();
- $owner->onPreRenderComplete = array($this, 'registerScriptLoader');
- }
-
- public static function registerPackage(TControl $control, $name)
- {
- static $instance;
- if($instance===null)
- $instance=new self($control->getPage());
- $instance->_packages[$name]=true;
- }
-
- protected function registerScriptLoader()
- {
- $dir = dirname(__FILE__).'/myscripts'; //contains my javascript files
- $scripts = array_keys($this->_packages);
- $url = $this->_manager->registerJavascriptPackages($dir, $scripts);
- $this->_manager->registerScriptFile($url,$url);
- }
-}
-
-// example control class using the javascript packages
-class TestComp extends TControl
-{
- public function onPreRender($param)
- {
- parent::onPreRender($param);
- MyJavascriptLib::registerPackage($this,'package1');
- }
-}
-</com:TTextHighlighter>
-
-
</com:TContent>