Hi all. I'd like to change the default action to render so as to check
if a customized one exists (so as to render page.eng.ctp instead of
page.ctp. So, if that file exists, I want to render it on
beforeRender(), like so:

        function beforeRender() {
                $locale = $this->Session->read('Config.language');
                $file_path = VIEWS . $this->viewPath . DS . 
$this->passedArgs[0] . ".
$locale.ctp";
                if (file_exists($file_path)) {
                        $this->render($file_path);
                }
        }

Te problem is that render() calls beforeRender, and I begin an
infinite loop. Is there another way to replicate the behavior I want?
If not, should we have a render() which doesn't call beforeRender
(again), or an option so as to avoid it?

My quick-and-dirty fix consisted in a duplicated render() function
without that call, but I think a better fix would be great for
CakePHP.

Kind regards,

Eugenio.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to