History
Diff
| f9e789 | 8fb69e | a/CHANGELOG |
|---|---|---|
| 32 | 32 | following. |
| 33 | 33 | * Fixed parsing of function/constants that start with an underscore, |
| 34 | 34 | thanks to Dominik del Bondio for the patch |
| 35 | +* Adapters: Agavi: Added support for multiple plugin directories in the | |
| 36 | + config, thanks to Mike Seth for the patch | |
| 35 | 37 | |
| 36 | 38 | [2010-02-07] 1.1.1 |
| 37 | 39 | + Added {optional} plugin that just prints an optional var without any |
| f9e789 | 8fb69e | a/lib/Dwoo/Adapters/Agavi/DwooRenderer.php |
| 17 | 17 | * <parameter name="request_data">rd</parameter> |
| 18 | 18 | * </parameter> |
| 19 | 19 | * <parameter name="extract_vars">true</parameter> |
| 20 | - * <parameter name="plugin_dir">%core.lib_dir%/dwoo_plugins</parameter> | |
| 20 | + * <parameters name="plugin_dir"> | |
| 21 | + * <parameter>%core.lib_dir%/dwoo_plugins</parameter> | |
| 22 | + * <parameter>%core.lib_dir%/other_dwoo_plugins</parameter> | |
| 23 | + * </parameters> | |
| 21 | 24 | * </renderer> |
| 22 | 25 | * |
| 23 | 26 | * - add dwoo's directory to your include path or include dwooAutoload.php yourself |
| 28 | 31 | * lib directory, or change the plugin_dir parameter in the output_types.xml file. |
| 29 | 32 | * these plugins are agavi-specific helpers that shortens the syntax to call common |
| 30 | 33 | * agavi helpers (i18n, routing, ..) |
| 34 | + * - in the previous versions of this adapter, only a single value could be passed to | |
| 35 | + * plugin_dir parameter; now you can pass several plugin directories (see example) | |
| 31 | 36 | * |
| 32 | 37 | * This software is provided 'as-is', without any express or implied warranty. |
| 33 | 38 | * In no event will the authors be held liable for any damages arising from the |
| 37 | 42 | * @copyright Copyright (c) 2008, Jordi Boggiano |
| 38 | 43 | * @license http://dwoo.org/LICENSE Modified BSD License |
| 39 | 44 | * @link http://dwoo.org/ |
| 40 | - * @version 1.1.0 | |
| 41 | - * @date 2009-07-18 | |
| 45 | + * @version 1.1.1 | |
| 46 | + * @date 2010-04-06 | |
| 42 | 47 | * @package Dwoo |
| 43 | 48 | */ |
| 44 | 49 | class DwooRenderer extends AgaviRenderer implements AgaviIReusableRenderer |
| 73 | 78 | protected $defaultExtension = '.html'; |
| 74 | 79 | |
| 75 | 80 | /** |
| 76 | - * stores the (optional) plugin directory to add to the Dwoo_Loader | |
| 81 | + * stores the (optional) plugin directories to add to the Dwoo_Loader | |
| 77 | 82 | */ |
| 78 | 83 | protected $plugin_dir = null; |
| 79 | 84 | |
| 129 | 134 | return $this->dwoo; |
| 130 | 135 | } |
| 131 | 136 | |
| 137 | + // this triggers Agavi autoload | |
| 132 | 138 | if(!class_exists('Dwoo')) { |
| 133 | 139 | if (file_exists(dirname(__FILE__).'/../../../dwooAutoload.php')) { |
| 134 | 140 | // file was dropped with the entire dwoo package |
| 150 | 156 | $this->dwoo = new Dwoo_Core($compileDir, $cacheDir); |
| 151 | 157 | |
| 152 | 158 | if (!empty($this->plugin_dir)) { |
| 153 | - $this->dwoo->getLoader()->addDirectory($this->plugin_dir); | |
| 159 | + foreach ((array) $this->plugin_dir as $dir) { | |
| 160 | + $this->dwoo->getLoader()->addDirectory($dir); | |
| 161 | + } | |
| 154 | 162 | } |
| 155 | 163 | |
| 156 | 164 | $this->dwoo->setDefaultCompilerFactory('file', array($this, 'compilerFactory')); |
| 182 | 190 | $data[$this->slotsVarName] =& $slots; |
| 183 | 191 | |
| 184 | 192 | foreach($this->assigns as $key => $getter) { |
| 185 | - $data[$key] = $this->context->$getter(); | |
| 193 | + $data[$key] = $this->getContext()->$getter(); | |
| 186 | 194 | } |
| 187 | 195 | |
| 188 | 196 | foreach($moreAssigns as $key => &$value) { |