Loading a YUI component
With CIwY you have gained another php class that helps to embed YUI in HTML page in a correct way. It is YUILoader.
YUILoader has two method to load YUI:
- The PHP method: PHP generates HTML code to embed YUI
- The JS method: Generation of JS code that will embed YUI
Note: Be careful using this class to prevent unpredictable behaviour.
YUILoader: The PHP method
The CIwY class has the $yuiloader_method property that tells ciwy which loader method use between 'php' and 'js'. Default is 'php'.
Note: This class is derived from YUI PHP Loader Utility [beta].
With the PHP method YUILoader will generate HTML code to embed YUI.YUILoader: The JS method
If you changed the default loader method in 'js', in that case YUILoader will generate JS code that will embed YUI in the page.
Load YUI components
To load one o more YUI component just use in your controller $this->yuiloader->load() function providing one component name for each function parameter
$this->yuiloader('calendar', 'autocomplete');
Embed YUI in the HTML page
To embed YUI the HTML page just use in your view $this->ciwy->yuiTags() o $this->yuiloader->tags() function
<?php echo $this->ciwy->yuiTags(); ?>
See the Render pages with YUI components page for more details.