Hey, sorry for the late reply.
Thank you very, very much for this contribution. I read about the gen () plugin on your blog, nice work! Don't you think we should simply allow setting _all_ smarty options listed in http://smarty.php.net/manual/en/api.variables.php? I could do it in a dynamic way so they can all be configured using an array parameter. Also, we could maybe allow mechanisms to automatically register functions, blocks, modifiers and so on. I think I'll sit down and improve this whereever I can for 1.0, it's something I wanted to do for a long time. I haven't used Smarty in a long time though, so your suggestions would be very appreciated. Many kudos for the effort, it's very nice to have such a talented and active Agavi user in Japan! I also haven't forgotten about your japanese documentation efforts; right now it looks like I can start working on the manual in the coming weeks. I'll get back to you once I have something ready for translation ;) Greetings from Munich, Germany, David P.S: is "mugeso" your real name? :) Am 08.10.2007 um 16:56 schrieb mugeso: > oops!! > > I forget to attach files :$ > > mugeso > Index: AgaviSmartyRenderer.class.php > =================================================================== > --- AgaviSmartyRenderer.class.php (rev 2114) > +++ AgaviSmartyRenderer.class.php (working copy) > @@ -79,6 +79,7 @@ > * @return Smarty A Smarty instance. > * > * @author David Zülke <[EMAIL PROTECTED]> > + * @author MugeSo <[EMAIL PROTECTED]> > * @since 0.9.0 > */ > protected function getEngine() > @@ -114,8 +115,12 @@ > AgaviToolkit::mkdir($cacheDir, $parentMode, true); > $this->smarty->cache_dir = $cacheDir; > > - $this->smarty->plugins_dir = array("plugins","plugins_local"); > + $this->smarty->plugins_dir = array_merge(array > ("plugins","plugins_local"), $this->getParameter('plugins_dir', > array())); > > + $this->smarty->left_delimiter = $this->getParameter > ('left_delimiter', $this->smarty->left_delimiter); > + $this->smarty->right_delimiter = $this->getParameter > ('right_delimiter', $this->smarty->right_delimiter); > + $this->smarty->default_modifiers = $this->getParameter > ('default_modifiers', $this->smarty->default_modifiers); > + > if(AgaviConfig::get('core.debug', false)) { > $this->smarty->debugging = true; > } > */ function smarty_function_routing_gen($args, $smarty) { if(empty > ($args['route'])) { $smarty->trriger_error("routing_gen: parameter > 'route' is required."); return; } $params = array(); $options = > array(); foreach($args AS $key=>$value) { if(preg_match('/(params| > options)_(.+)/', $key, $matches)) { ${$matches[1]}[$matches[2]] = > $value; } } if(isset($args['options'])) { $options = $args > ['options']; } $url = $smarty->get_template_vars(isset($args > ['routing']) ? $args['routing'] : 'ro') ->gen($args['route'], > $params, $options); if(empty($args['assign'])) { return $url; } > else { $smarty->assign($args['assign'], $url); } } > _______________________________________________ > Agavi Dev Mailing List > [email protected] > http://lists.agavi.org/mailman/listinfo/dev _______________________________________________ Agavi Dev Mailing List [email protected] http://lists.agavi.org/mailman/listinfo/dev
