views for shell scripts
Hi, I created a shell script to produce statistics. Works fine. Now I want to create a nicely formated HTML page with the results and this leads me to my problem: how can I create this HTML file from within my shell script. I thought of using the render function and writing it to the harddisk like so: $htmlReport = $this-render( VIEWS.'/elements/shells/report.ctp' ); and then use php fwrite to write it to the harddisk. Yet I get the message that ReportShell::render() is not defined. What do I have to import? Or is there a better way to make use of views in shell scripts? thx Juergen --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: views for shell scripts
Hi Juergen, I created a shell script to produce statistics. Works fine. Now I want to create a nicely formated HTML page with the results and this leads me to my problem: how can I create this HTML file from within my shell script. I thought of using the render function and writing it to the harddisk like so: $htmlReport = $this-render( VIEWS.'/elements/shells/report.ctp' ); and then use php fwrite to write it to the harddisk. Yet I get the message that ReportShell::render() is not defined. What do I have to import? Or is there a better way to make use of views in shell scripts? You could try something like: App::import('Core', array('View', 'Controller')); $view = new View(new Controller()); $viewContent = $view-render('/elements/view_name'); Hope that helps! -- Daniel Hofstetter http://cakebaker.42dh.com --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: views for shell scripts
Super, thanks Daniel for pointing me the Core *g* works like a charm now! App::import('Core', array('View', 'Controller')); $view = new View(new Controller()); $viewContent = $view-render('/elements/view_name'); --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---