This shows you the differences between two versions of the page.
|
php:loota_view_helper_phpyuiloader [2009/11/28 20:17] kodmasin |
php:loota_view_helper_phpyuiloader [2010/04/29 13:39] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Loota_View_Helper_PhpYuiLoader ====== | ||
| + | |||
| + | Here is very simple way how to use Zend Framework and Yui Php Loader Utility. | ||
| + | |||
| + | Below is code. This helper returns YAHOO_util_Loader object so check docs at http://developer.yahoo.com/yui/phploader/ | ||
| + | <code php> | ||
| + | require_once 'phploader/phploader/loader.php'; | ||
| + | require_once 'Zend/View/Helper/Abstract.php'; | ||
| + | |||
| + | class Loota_View_Helper_PhpYuiLoader extends Zend_View_Helper_Abstract{ | ||
| + | static private $loader; | ||
| + | public function __construct(){ | ||
| + | if(Loota_View_Helper_phpYuiLoader::$loader === null){ | ||
| + | Loota_View_Helper_phpYuiLoader::$loader = new YAHOO_util_Loader("2.8.0"); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | public function phpYuiLoader(){ | ||
| + | return Loota_View_Helper_phpYuiLoader::$loader; | ||
| + | } | ||
| + | |||
| + | } | ||
| + | </code> | ||