Re: [fw-general] Demo application?
Here's my newbie approach to integrating zend framework v1.0.1 and Smarty: http://beach-blogger.blogspot.com/2007/08/zend-framework-and-smarty-integration.html#links That blog entry also includes pointers to 2 other similar solutions that I found after stuggling with mine... :working: Dennis Ludovic André wrote: > > >> One more thing. >> I was wondering how you would incorporate Smarty support in that little >> example. >> >> I'm thinking about using the Smarty class shown on this page: >> http://framework.zend.com/manual/en/zend.view.scripts.html#zend.view.scripts.templates >> >> I do wonder where I would put the "Zend_View_Smarty" class, how to load >> it >> etc. >> > As I was looking for the same info (ie: where to place our custom files > in the tree), and as I did not find any relevant answer, I created a > directory called "classes" inside the "application" folder. My structure > is as follow: > - application > --- classes > -- Smarty // containing the whole Smarty app > -- Zend > - View > Smarty.php // containing the code in the url you mention > above > > * I added this new "classes" folder to my include_path, then I load the > Smarty stuff via the index.php, using > Zend_Loader::loadClass( 'Zend_View_Smarty', array( 'classes' ) ); > > * Make sure that the automated render is not anymore entering into action: > $yourFrontController->setParam("noViewRenderer",true); > > * You then have to deal with the view, to make sure it's a Smary view. > Not being sure if it's the finest way to do this, and based on my little > knowledge of the ZF, I did this in the index.php: > $view = new Zend_View_Smarty( ); > $registry->set( 'view', $view ); > > * Then, inside the init() method of a controller, I can get back the > Smarty view instanciated above: > $registry = Zend_Registry::getInstance(); > $this->view = $registry->get( 'view' ); > > * After that, I can assign you variables to your view, inide a > Controller method: > $this->view->foo = "bar"; > > * Finally, I render the view inside a Controller method: > echo $this->view->render( 'mytemplate.tpl' ); > > BTW do not forget to configure your Smarty (template_dir) to point to > the directory where the views are stored. > > There should be a nicer way to do this, I'm wide open to suggestions as > well :) > > -- > Ludo > >> Thank you. >> >> >> Rob Allen-3 wrote: >> >>> I've updated the source file download for the tutorial and have tested >>> it on ZF 1.0.1: >>> http://akrabat.com/wp-content/uploads/zf_tutorial-140.zip >>> >>> If you want the ZF included: >>> http://akrabat.com/wp-content/uploads/zf_tutorial-140-with-zf.zip >>> >>> Regards, >>> >>> Rob... >>> >>> >>> >> >> > > > -- View this message in context: http://www.nabble.com/Demo-application--tf4254279s16154.html#a12445625 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Demo application?
On 8/11/07, Andries Seutens <[EMAIL PROTECTED]> wrote: > appel schreef: > > That being said. I can't be arsed with reading some half cooked tutorials on > > some blogs. > > > > I just want to get started, I don't want to read for many days to get simple > > things going. > > Check: http://andries.systray.be/zf-demos/feed-reader/ Andries, too bad no one commented earlier - very nice demo app. :) Just one suggestion, is $this->_request->isPost() instead of $_SERVER['REQUEST_METHOD'] Aside from that you use a recent version of the ZF (huge plus) and your app works very well - out of the box, so to speak. A big plus with all the tutorials/demos out there. Cheers, Till
Re: [fw-general] Demo application?
-- Rob Allen <[EMAIL PROTECTED]> wrote (on Tuesday, 21 August 2007, 09:41 PM +0100): > appel wrote: > > One more thing. > > I was wondering how you would incorporate Smarty support in that little > > example. > > > > I'm thinking about using the Smarty class shown on this page: > > http://framework.zend.com/manual/en/zend.view.scripts.html#zend.view.scripts.templates > > > > I do wonder where I would put the "Zend_View_Smarty" class, how to load it > > etc. > > > > I would call the class View_Smarty and have a directory called > "app/classes" on the path. Hence View_Smarty would live in > app/classes/View/Smarty.php. > > Another alternative is to pick a prefix, e.g. "Appel" for your classes > and create a directory under lib. In this case, you would have > Appel_View_Smarty living in lib/Appel/View/Smarty.php I *HIGHLY* recommend choosing a prefix, as it makes your code more portable. -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] Demo application?
appel wrote: > Thank you, I have gotten it to work. > > > One more thing. > I was wondering how you would incorporate Smarty support in that little > example. > > I'm thinking about using the Smarty class shown on this page: > http://framework.zend.com/manual/en/zend.view.scripts.html#zend.view.scripts.templates > > I do wonder where I would put the "Zend_View_Smarty" class, how to load it > etc. > I would call the class View_Smarty and have a directory called "app/classes" on the path. Hence View_Smarty would live in app/classes/View/Smarty.php. Another alternative is to pick a prefix, e.g. "Appel" for your classes and create a directory under lib. In this case, you would have Appel_View_Smarty living in lib/Appel/View/Smarty.php Regards, Rob...
Re: [fw-general] Demo application?
One more thing. I was wondering how you would incorporate Smarty support in that little example. I'm thinking about using the Smarty class shown on this page: http://framework.zend.com/manual/en/zend.view.scripts.html#zend.view.scripts.templates I do wonder where I would put the "Zend_View_Smarty" class, how to load it etc. As I was looking for the same info (ie: where to place our custom files in the tree), and as I did not find any relevant answer, I created a directory called "classes" inside the "application" folder. My structure is as follow: - application --- classes -- Smarty // containing the whole Smarty app -- Zend - View Smarty.php // containing the code in the url you mention above * I added this new "classes" folder to my include_path, then I load the Smarty stuff via the index.php, using Zend_Loader::loadClass( 'Zend_View_Smarty', array( 'classes' ) ); * Make sure that the automated render is not anymore entering into action: $yourFrontController->setParam("noViewRenderer",true); * You then have to deal with the view, to make sure it's a Smary view. Not being sure if it's the finest way to do this, and based on my little knowledge of the ZF, I did this in the index.php: $view = new Zend_View_Smarty( ); $registry->set( 'view', $view ); * Then, inside the init() method of a controller, I can get back the Smarty view instanciated above: $registry = Zend_Registry::getInstance(); $this->view = $registry->get( 'view' ); * After that, I can assign you variables to your view, inide a Controller method: $this->view->foo = "bar"; * Finally, I render the view inside a Controller method: echo $this->view->render( 'mytemplate.tpl' ); BTW do not forget to configure your Smarty (template_dir) to point to the directory where the views are stored. There should be a nicer way to do this, I'm wide open to suggestions as well :) -- Ludo Thank you. Rob Allen-3 wrote: I've updated the source file download for the tutorial and have tested it on ZF 1.0.1: http://akrabat.com/wp-content/uploads/zf_tutorial-140.zip If you want the ZF included: http://akrabat.com/wp-content/uploads/zf_tutorial-140-with-zf.zip Regards, Rob...
Re: [fw-general] Demo application?
Thank you, I have gotten it to work. One more thing. I was wondering how you would incorporate Smarty support in that little example. I'm thinking about using the Smarty class shown on this page: http://framework.zend.com/manual/en/zend.view.scripts.html#zend.view.scripts.templates I do wonder where I would put the "Zend_View_Smarty" class, how to load it etc. Thank you. Rob Allen-3 wrote: > > I've updated the source file download for the tutorial and have tested > it on ZF 1.0.1: > http://akrabat.com/wp-content/uploads/zf_tutorial-140.zip > > If you want the ZF included: > http://akrabat.com/wp-content/uploads/zf_tutorial-140-with-zf.zip > > Regards, > > Rob... > > -- View this message in context: http://www.nabble.com/Demo-application--tf4254279s16154.html#a12172858 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Demo application?
appel wrote: > > Nick Howell-2 wrote: >> Have a look at http://akrabat.com/zend-framework-tutorial/ > > Can't get that tutorial to run, just blank page, no errors. > Turn on display_errors in your php.ini file. I've updated the source file download for the tutorial and have tested it on ZF 1.0.1: http://akrabat.com/wp-content/uploads/zf_tutorial-140.zip If you want the ZF included: http://akrabat.com/wp-content/uploads/zf_tutorial-140-with-zf.zip Regards, Rob...
Re: [fw-general] Demo application?
Nick Howell-2 wrote: > > Have a look at http://akrabat.com/zend-framework-tutorial/ > > Can't get that tutorial to run, just blank page, no errors. -- View this message in context: http://www.nabble.com/Demo-application--tf4254279s16154.html#a12109018 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Demo application?
appel schreef: That being said. I can't be arsed with reading some half cooked tutorials on some blogs. I just want to get started, I don't want to read for many days to get simple things going. Check: http://andries.systray.be/zf-demos/feed-reader/ Best, Andriesss
Re: [fw-general] Demo application?
Have a look at http://akrabat.com/zend-framework-tutorial/ and then http://akrabat.com/zend-auth-tutorial/
Re: [fw-general] Demo application?
That being said. I can't be arsed with reading some half cooked tutorials on some blogs. I just want to get started, I don't want to read for many days to get simple things going. -- View this message in context: http://www.nabble.com/Demo-application--tf4254279s16154.html#a12107996 Sent from the Zend Framework mailing list archive at Nabble.com.