Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Zend Framework

6,341 views

Published on

This is my talk I gave at the International PHP Conference 2007 - Spring Edition in Ludwigsburg, Germany. The talk introduces the basic concepts of the Zend Framework. Additionally some components are shown in more detail and some advanced concepts are covered.

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Zend Framework

  1. 1. Das Zend Framework Hält der Name, was er verspricht?
  2. 2. Carsten Lucke Das Zend Framework Sprecher: Carsten Lucke • Sofware-Ingenieur bei der sd&m AG, München • Aktives Mitglied der sd&m Client- Community • PEAR und PECL Entwickler • Schreibt für Fachzeitschriften/-bücher über diverse PHP-Themen 2
  3. 3. Carsten Lucke Das Zend Framework Agenda • Einführung und Überblick über das ZF • Framework oder Komponentenbibliothek? • Fortgeschrittene Techniken • Bewertung 3
  4. 4. Carsten Lucke Das Zend Framework Agenda > Einführung und Überblick über das ZF Framework oder Komponentenbibliothek? Fortgeschrittene Techniken Bewertung 4
  5. 5. Carsten Lucke Das Zend Framework Was ist das ZF? • Teils Application Framework, teils Component Library • Open-Source • Basiert auf PHP 5, objektorientiert entwickelt • Liefert sauberen und stabilen Code mit sehr guter Dokumentation 5
  6. 6. Carsten Lucke Das Zend Framework Umfang des ZF 6
  7. 7. Carsten Lucke Das Zend Framework Umfang des ZF • Core Infrastructure: Zend_Cache, Zend_Config, Zend_Log, ... 6
  8. 8. Carsten Lucke Das Zend Framework Umfang des ZF • Core Infrastructure: Zend_Cache, Zend_Config, Zend_Log, ... • MVC: Zend_Controller, Zend_View, ... 6
  9. 9. Carsten Lucke Das Zend Framework Umfang des ZF • Core Infrastructure: Zend_Cache, Zend_Config, Zend_Log, ... • MVC: Zend_Controller, Zend_View, ... • Auth: Zend_Acl, Zend_Auth, Zend_Session 6
  10. 10. Carsten Lucke Das Zend Framework Umfang des ZF • Core Infrastructure: Zend_Cache, Zend_Config, Zend_Log, ... • MVC: Zend_Controller, Zend_View, ... • Auth: Zend_Acl, Zend_Auth, Zend_Session • Database: Zend_Db, Zend_Db_Adapter, ... 6
  11. 11. Carsten Lucke Das Zend Framework Umfang des ZF • Core Infrastructure: Zend_Cache, Zend_Config, Zend_Log, ... • MVC: Zend_Controller, Zend_View, ... • Auth: Zend_Acl, Zend_Auth, Zend_Session • Database: Zend_Db, Zend_Db_Adapter, ... • Mail, Formats & Search: Zend_Json, Zend_Mail, Zend_Search, ... 6
  12. 12. Carsten Lucke Das Zend Framework Umfang des ZF • Core Infrastructure: Zend_Cache, Zend_Config, Zend_Log, ... • MVC: Zend_Controller, Zend_View, ... • Auth: Zend_Acl, Zend_Auth, Zend_Session • Database: Zend_Db, Zend_Db_Adapter, ... • Mail, Formats & Search: Zend_Json, Zend_Mail, Zend_Search, ... • i18n/l10n: Zend_Date, Zend_Measure, Zend_Translate, ... 6
  13. 13. Carsten Lucke Das Zend Framework Umfang des ZF • Core Infrastructure: Zend_Cache, Zend_Config, Zend_Log, ... • MVC: Zend_Controller, Zend_View, ... • Auth: Zend_Acl, Zend_Auth, Zend_Session • Database: Zend_Db, Zend_Db_Adapter, ... • Mail, Formats & Search: Zend_Json, Zend_Mail, Zend_Search, ... • i18n/l10n: Zend_Date, Zend_Measure, Zend_Translate, ... • Web/Webservices: Zend_Http, Zend_XmlRpc, Zend_Rest, Zend_Feed, Zend_Service_*, ... 6
  14. 14. Carsten Lucke Das Zend Framework Agenda Einführung und Überblick über das ZF > Framework oder Komponentenbibliothek? Fortgeschrittene Techniken Bewertung 7
  15. 15. Carsten Lucke Das Zend Framework Was bietet das ZF? Framework-Teil: Komponenten-Teil: 8
  16. 16. Carsten Lucke Das Zend Framework Was bietet das ZF? Framework-Teil: Komponenten-Teil: • MVC-Komponenten 8
  17. 17. Carsten Lucke Das Zend Framework Was bietet das ZF? Framework-Teil: Komponenten-Teil: • MVC-Komponenten • Front-Controller basierte MVC-Implementierung 8
  18. 18. Carsten Lucke Das Zend Framework Was bietet das ZF? Framework-Teil: Komponenten-Teil: • MVC-Komponenten • Front-Controller basierte MVC-Implementierung • Requestverarbeitung: Controller/Action 8
  19. 19. Carsten Lucke Das Zend Framework Was bietet das ZF? Framework-Teil: Komponenten-Teil: • MVC-Komponenten • Authentication & Authorization • Front-Controller basierte MVC-Implementierung • Requestverarbeitung: Controller/Action 8
  20. 20. Carsten Lucke Das Zend Framework Was bietet das ZF? Framework-Teil: Komponenten-Teil: • MVC-Komponenten • Authentication & Authorization • Front-Controller basierte MVC-Implementierung • Database • Requestverarbeitung: Controller/Action 8
  21. 21. Carsten Lucke Das Zend Framework Was bietet das ZF? Framework-Teil: Komponenten-Teil: • MVC-Komponenten • Authentication & Authorization • Front-Controller basierte MVC-Implementierung • Database • Requestverarbeitung: • Mail, Formats & Search Controller/Action 8
  22. 22. Carsten Lucke Das Zend Framework Was bietet das ZF? Framework-Teil: Komponenten-Teil: • MVC-Komponenten • Authentication & Authorization • Front-Controller basierte MVC-Implementierung • Database • Requestverarbeitung: • Mail, Formats & Search Controller/Action • Internationalisierung 8
  23. 23. Carsten Lucke Das Zend Framework Was bietet das ZF? Framework-Teil: Komponenten-Teil: • MVC-Komponenten • Authentication & Authorization • Front-Controller basierte MVC-Implementierung • Database • Requestverarbeitung: • Mail, Formats & Search Controller/Action • Internationalisierung • Web / Webservices 8
  24. 24. Carsten Lucke Das Zend Framework Der „Framework-Anteil“ des Zend Framework 9
  25. 25. Carsten Lucke Das Zend Framework Requestverarbeitung des ZF 10
  26. 26. Carsten Lucke Das Zend Framework Requestverarbeitung des ZF Hostname 10
  27. 27. Carsten Lucke Das Zend Framework Requestverarbeitung des ZF Controller 10
  28. 28. Carsten Lucke Das Zend Framework Requestverarbeitung des ZF Action 10
  29. 29. Carsten Lucke Das Zend Framework Requestverarbeitung des ZF Requestparameter 10
  30. 30. Carsten Lucke Das Zend Framework Requestverarbeitung des ZF http://myhost.com/ IndexController :: indexAction 10
  31. 31. Carsten Lucke Das Zend Framework Requestverarbeitung des ZF http://myhost.com/ IndexController :: indexAction http://myhost.com/projects/ ProjectsController :: indexAction 10
  32. 32. Carsten Lucke Das Zend Framework Requestverarbeitung des ZF http://myhost.com/ IndexController :: indexAction http://myhost.com/projects/ ProjectsController :: indexAction http://myhost.com/projects/detail/ ProjectsController :: detailAction 10
  33. 33. Carsten Lucke Das Zend Framework Requestlebenszyklus des ZF 11
  34. 34. Carsten Lucke Das Zend Framework Requestlebenszyklus des ZF Front-Controller Request: http://host/index/bar/ 11
  35. 35. Carsten Lucke Das Zend Framework Requestlebenszyklus des ZF Router Front-Controller Request: http://host/index/bar/ Routing 11
  36. 36. Carsten Lucke Das Zend Framework Requestlebenszyklus des ZF Router Dispatcher Front-Controller Request: http://host/index/bar/ Routing Dispatching 11
  37. 37. Carsten Lucke Das Zend Framework Requestlebenszyklus des ZF Router Dispatcher IndexController Front-Controller Request: http://host/index/bar/ Routing Dispatching barAction() 11
  38. 38. Carsten Lucke Das Zend Framework Requestlebenszyklus des ZF Router Dispatcher IndexController Front-Controller Request: http://host/index/bar/ Routing Dispatching barAction() Wiederholung bis Request dispatched ist 11
  39. 39. Carsten Lucke Das Zend Framework Requestlebenszyklus des ZF Router Dispatcher IndexController Front-Controller Request: http://host/index/bar/ Routing Dispatching barAction() Wiederholung bis Request dispatched ist Response 11
  40. 40. Carsten Lucke Das Zend Framework Typische Verzeichnisstruktur 12
  41. 41. Carsten Lucke Das Zend Framework Typische Verzeichnisstruktur RewriteEngine on RewriteRule .* index.php 12
  42. 42. Carsten Lucke Das Zend Framework Typische Verzeichnisstruktur RewriteEngine on RewriteRule .* index.php deny from all 12
  43. 43. Carsten Lucke Das Zend Framework Typische Verzeichnisstruktur RewriteEngine on RewriteRule .* index.php deny from all deny from all 12
  44. 44. Carsten Lucke Das Zend Framework Typische Verzeichnisstruktur RewriteEngine on RewriteRule .* index.php deny from all deny from all RewriteEngine off 12
  45. 45. Carsten Lucke Das Zend Framework Action-Controller für die Dialog/ Client-Logik • Fachliche Verarbeitung eines Requests • Usecase-Aufrufe • Lesen anzuzeigender Daten aus DB etc. • Speichern eingegebener Daten • Rendern der anzuzeigenden Seite mit Hilfe von Views 13
  46. 46. Carsten Lucke Das Zend Framework Action-Controller für die Dialog/Client-Logik class IndexController extends Zend_Controller_Action { protected $_view = null; public function init() { parent::init(); $this->_view = $this->getInvokeArg('view'); } public function indexAction() { $this->_view->title = 'Road-racing riders list'; $this->_view->riders = array('Lance Armstrong', 'Erik Zabel', 'Tom Boonen'); $this->_response->appendBody( $this->_view->render('riderslist.phtml') ); } } 14
  47. 47. Carsten Lucke Das Zend Framework Views für die Präsentation • Separation von Präsentation und Logik bzw. Datenhaltung • Ausschließlich Wissen über die Präsentation • Eigene View-Datenhaltung möglich • Rendering der anzuzeigenden Webseite (oder Teilen davon) 15
  48. 48. Carsten Lucke Das Zend Framework Views für die Präsentation <html> <head> <meta http-equiv=quot;Content-typequot; content=quot;text/html; charset=utf-8quot;> <title><?php echo $this->escape($this->title); ?></title> </head> <body> <table border=quot;0quot; cellspacing=quot;5quot; cellpadding=quot;5quot;> <tr><th>Name</th></tr> <?php foreach ($this->riders as $rider) { echo quot;<tr><td>{$this->escape($rider)}</td></tr>quot;; } ?> </table> </body> </html> 16
  49. 49. Carsten Lucke Das Zend Framework Der „Komponenten-Anteil“ des Zend Framework 17
  50. 50. Carsten Lucke Das Zend Framework Komponentenüberblick ZF • Hohe Anzahl an Komponenten • Abdeckung vieler Bereiche: • Auth, I18N, Webservices, Database, etc. • Gute Dokumentation und viele Beispiele 18
  51. 51. Carsten Lucke Das Zend Framework Demonstration: ZF-Komponenten zur Abfrage eines RSS-Feed Anforderungen: 19
  52. 52. Carsten Lucke Das Zend Framework Demonstration: ZF-Komponenten zur Abfrage eines RSS-Feed Anforderungen: • Abfrage der Feed-Informationen 19
  53. 53. Carsten Lucke Das Zend Framework Demonstration: ZF-Komponenten zur Abfrage eines RSS-Feed Anforderungen: • Abfrage der Feed-Informationen • Fehlerbehandlung bei Nichterreichbarkeit 19
  54. 54. Carsten Lucke Das Zend Framework Demonstration: ZF-Komponenten zur Abfrage eines RSS-Feed Anforderungen: • Abfrage der Feed-Informationen • Fehlerbehandlung bei Nichterreichbarkeit • Caching der Ergebnisse 19
  55. 55. Carsten Lucke Das Zend Framework Demonstration: ZF-Komponenten zur Abfrage eines RSS-Feed Anforderungen: • Abfrage der Feed-Informationen • Fehlerbehandlung bei Nichterreichbarkeit • Caching der Ergebnisse Eingesetzte Komponenten: 19
  56. 56. Carsten Lucke Das Zend Framework Demonstration: ZF-Komponenten zur Abfrage eines RSS-Feed Anforderungen: • Abfrage der Feed-Informationen • Fehlerbehandlung bei Nichterreichbarkeit • Caching der Ergebnisse Eingesetzte Komponenten: • Zend_Feed & Zend_Cache 19
  57. 57. Carsten Lucke Das Zend Framework Demonstration: Zend_Feed try { $feed = Zend_Feed::import('http://blog.lucke.info/feed'); $channel = array( 'title' => $feed->title(), 'link' => $feed->link(), 'description' => $feed->description(), 'items' => array()); foreach ($feed as $item) { $channel['items'][] = array( 'title' => $item->title(), 'link' => $item->link(), 'description' => $item->description()); } print_r($channel); } catch (Zend_Feed_Exception $e) { // Exception-Handling (Timeout, 404, etc.) } 20
  58. 58. Carsten Lucke Das Zend Framework Demonstration: Zend_Cache • 4 Parameter zur Erzeugung einer Cache-Instanz: • Frontend, Backend, Frontend-Options, Backend-Options • Frontends (Was wird gecached?): • Core, Output, Function, Class, File, Page • Backends (Wohin wird gecached?): • File, Sqlite, Memcached, APC, ZendPlatform 21
  59. 59. Carsten Lucke Das Zend Framework Demonstration: Zend_Cache $frontendOpt = array( 'lifetime' => 300, // cache lifetime in seconds 'automaticSerialization' => true); $backendOpt = array( 'cacheDir' => './cache' ); $cache = Zend_Cache::factory('Core', 'File', $frontendOpt, $backendOpt); $cacheId = 'feed_blog_lucke_info'; $feedInfo = $cache->load($cacheId); if (! $feedInfo) { // cache-miss $feedInfo = getFeedInfo('http://blog.lucke.info/feed'); $cache->save($feedInfo, $cacheId); } else { // cache-hit, Feed-Info bereits verfügbar } print_r($feedInfo); 22
  60. 60. Carsten Lucke Das Zend Framework Agenda Einführung und Überblick über das ZF Framework oder Komponentenbibliothek? > Fortgeschrittene Techniken Bewertung 23
  61. 61. Carsten Lucke Das Zend Framework Projektstruktur für größere Projekte • Projektstruktur erlaubt Subprojekte • Zend_Controller_Front :: setControllerDirectory() • Zend_Controller_Front :: addControllerDirectory() • Zend_View :: setScriptPath() • Zend_View :: addScriptPath() 24
  62. 62. Carsten Lucke Das Zend Framework Projektstruktur für größere Projekte [...] $controller = Zend_Controller_Front::getInstance(); $controller->setControllerDirectory( 'application/controllers'); $controller->addControllerDirectory( 'application/subproject1/controllers', 'sub1'); $controller->returnResponse(true); $controller->throwExceptions(true); $view = new Zend_View(); $view->setScriptPath('application/views'); $view->addScriptPath('application/subproject1/views'); $controller->setParam('view', $view); [...] 24
  63. 63. Carsten Lucke Das Zend Framework Projektstruktur für größere Projekte [...] $controller = Zend_Controller_Front::getInstance(); $controller->setControllerDirectory( 'application/controllers'); http://myhost/sub1/myctrl/myaction $controller->addControllerDirectory( 'application/subproject1/controllers', 'sub1'); $controller->returnResponse(true); $controller->throwExceptions(true); $view = new Zend_View(); $view->setScriptPath('application/views'); $view->addScriptPath('application/subproject1/views'); $controller->setParam('view', $view); [...] 24
  64. 64. Carsten Lucke Das Zend Framework Template-basierte Views • Zend_View_Interface als Schnittstelle • Template-Engine Ihrer Wahl anstelle von PHP/HTML Views • Rahmentemplate mit Platzhaltern anstelle von Includes innerhalb von Views 25
  65. 65. Carsten Lucke Das Zend Framework Mehrere Actions zur Request- abarbeitung • Aufteilung der fachlichen Abarbeitung eines Request auf mehrere Controller • Dispatch-Zyklus erlaubt Einsatz mehrerer Controller/Actions zur Requestabarbeitung • „Forwarding“: $this->_forward() • Problem: Controller haben dadurch Kenntnis von einander 26
  66. 66. Carsten Lucke Das Zend Framework Mehrere Actions zur Request- abarbeitung :: Lösungsansatz • Abstrakte Action-Basisklasse zur Verwaltung eines Navigation-Stack • init() zur Initialisierung des Stack • myForward() statt _forward() • postDispatch() für „Forwarding“ mit mod. Navigation-Stack als Kontextparameter 27
  67. 67. Carsten Lucke Das Zend Framework Agenda Einführung und Überblick über das ZF Framework oder Komponentenbibliothek? Fortgeschrittene Techniken > Bewertung 28
  68. 68. Carsten Lucke Das Zend Framework Bewertung des Zend Framework Pro: Contra: 29
  69. 69. Carsten Lucke Das Zend Framework Bewertung des Zend Framework Pro: Contra: • Durchdachte MVC- Umsetzung 29
  70. 70. Carsten Lucke Das Zend Framework Bewertung des Zend Framework Pro: Contra: • Durchdachte MVC- Umsetzung • Viele Komponenten für Querschnitts- und Spezialaufgaben 29
  71. 71. Carsten Lucke Das Zend Framework Bewertung des Zend Framework Pro: Contra: • Durchdachte MVC- Umsetzung • Viele Komponenten für Querschnitts- und Spezialaufgaben • Hohe Qualität 29
  72. 72. Carsten Lucke Das Zend Framework Bewertung des Zend Framework Pro: Contra: • Durchdachte MVC- Umsetzung • Viele Komponenten für Querschnitts- und Spezialaufgaben • Hohe Qualität • Gute Dokumentation 29
  73. 73. Carsten Lucke Das Zend Framework Bewertung des Zend Framework Pro: Contra: • Durchdachte MVC- • Einsatz von Zend_View in Umsetzung größeren Projekten / kompl. Views zu überdenken • Viele Komponenten für Querschnitts- und Spezialaufgaben • Hohe Qualität • Gute Dokumentation 29
  74. 74. Carsten Lucke Das Zend Framework Bewertung des Zend Framework Pro: Contra: • Durchdachte MVC- • Einsatz von Zend_View in Umsetzung größeren Projekten / kompl. Views zu überdenken • Viele Komponenten für Querschnitts- und • Für größere Projekte evtl. Spezialaufgaben noch „Framework-Arbeit“ notwendig • Hohe Qualität • Gute Dokumentation 29
  75. 75. Carsten Lucke Das Zend Framework Bewertung des Zend Framework Pro: Contra: • Durchdachte MVC- • Einsatz von Zend_View in Umsetzung größeren Projekten / kompl. Views zu überdenken • Viele Komponenten für Querschnitts- und • Für größere Projekte evtl. Spezialaufgaben noch „Framework-Arbeit“ notwendig • Hohe Qualität • Framework für stark • Gute Dokumentation dialogbasierte Systeme evtl. nicht der richtige Ansatz 29
  76. 76. Carsten Lucke Das Zend Framework Vielen Dank für Ihre Aufmerksamkeit! Haben Sie Fragen? http://lucke.info 30

×