Enriching your Views


Published on

When creating the view-part of MVC, you are always using different components to build up the view. This session will show you two components of the Zend Framework to enrich your views, including Zend_ProgressBar and Zend_Tag_Cloud. You will learn about what these components can do and how to use all their features.

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Enriching your Views

  1. Enriching your Views Ben Scholzen Game Developer Gameforge Productions
  2. What we will cover <ul><li>Zend_ProgressBar </li><ul><li>Applications
  3. Structure
  4. Usage in the Web and on the Console </li></ul><li>Zend_Tag_Cloud </li><ul><li>Definition of Tags and Tagclouds
  5. Advantages of Zend_Tag_Cloud
  6. Basic usage </li></ul></ul>
  7. Zend_ProgressBar
  8. What Zend_ProgressBar does <ul><li>Takes absolute progress data
  9. Calculates relative progress data
  10. Display the progress </li><ul><li>Sort of ... </li></ul></ul>
  11. Sample output for end-users <ul><li>Web
  12. Console </li></ul>
  13. Where you can use progress bars <ul><li>Sending newsletters
  14. Upload
  15. Download
  16. Processing files
  17. Any other long-running tasks </li></ul>
  18. Structure of Zend_ProgressBar <ul><li>Zend_ProgressBar </li><ul><li>Managing absolute values
  19. Session management </li></ul><li>Zend_ProgressBar adapters </li><ul><li>Receiving relative calculated values
  20. Output of the data </li></ul></ul>
  21. Incremental example <ul><li>Useful for fixed-growing values </li></ul>
  22. Differential example <ul><li>Useful for variable-growing values </li></ul>
  23. The three standard adapters <ul><li>Zend_ProgressBar_Adapter_Console </li><ul><li>For output on the console </li></ul><li>Zend_ProgressBar_Adapter_JsPush </li><ul><li>For sending data in a single connection </li></ul><li>Zend_ProgressBar_Adapter_JsPull </li><ul><li>For sending data in multiple connections </li></ul></ul>
  24. The console adapter <ul><li>Style of the output can be completly customized
  25. Elements can be arranged </li><ul><li>Bar
  26. Percent
  27. ETA
  28. Text </li></ul><li>Output stream can be changed
  29. Finish action can be choosen </li><ul><li>Newline
  30. Remove progressbar
  31. Do nothing </li></ul></ul>
  32. The JavaScript Push adapter <ul><li>Only requires a single connection </li><ul><li>A separate one when doing uploads
  33. A combined one when sending e-mails </li></ul><li>Used with either <iframe/> or <object/>
  34. Drawbacks </li><ul><li>Some antivirus software blocks the receiving until the connection was closed </li></ul></ul>
  35. The JavaScript Pull adapter <ul><li>Runs in multiple separated connections
  36. New data are received via JSON
  37. Update interval can be freely choosen
  38. Drawbacks </li><ul><li>Depending on the update interval, many connections can slow down the server </li></ul></ul>
  39. On the browser side <ul><li>Calculated data are received by the browser </li><ul><li>Current
  40. Max
  41. Percent
  42. TimeTaken
  43. TimeRemaining
  44. Text </li></ul><li>Output is created with HTML / CSS / JavaScript </li><ul><li>JavaScript Frameworks (jQuery, Dojo, etc.)
  45. Manually </li></ul></ul>
  46. Zend_Tag_Cloud <ul><li>Zend_ProgressBar
  47. Zend_Tag_Cloud </li><ul><li>Was sind Tags
  48. Vorteile von Zend_Tag_Cloud
  49. Benutzung </li></ul><li>Fragen & Antworten </li></ul>
  50. What are tags and tag clouds? <ul><li>Tags </li><ul><li>Catchwords / Notes </li></ul><li>Tag clouds </li><ul><li>Visualization of information
  51. Collection of tags
  52. Alphabetically sorted
  53. Tags are visualized according to their weight </li></ul></ul>
  54. How a tag cloud looks like
  55. Why should I use Zend_Tag_Cloud? <ul><li>Interface / class for single tags </li><ul><li>Setting and getting the title
  56. Defining custom parameters </li></ul><li>Class for collections of tags </li><ul><li>Simple iteration through all tags
  57. Automatic callculation of logarithmical weight </li></ul><li>Class for output of tag clouds </li><ul><li>Comes with a standard decorator for HTML </li><ul><li>Can be completly customized </li></ul><li>Allows output on any media </li></ul><li>Decorators and tags can be added either via configuration or programtically </li></ul>
  58. A simple example
  59. And what you get
  60. What we got so far <ul><li>Within a few minutes we created: </li><ul><li>Multiple tags with weight and links
  61. HTML output </li></ul></ul>
  62. Style the nasty list
  63. The final result
  64. Summary — Questions? <ul><li>Zend_ProgressBar
  65. Zend_Tag_Cloud </li><ul><li>Was sind Tags
  66. Vorteile von Zend_Tag_Cloud
  67. Benutzung </li></ul><li>Fragen & Antworten </li></ul>
  68. Where to go from here <ul><li>Zend Framework documentation http://framework.zend.com/manual/en/zend.progressbar.html http://framework.zend.com/manual/en/zend.tag.html
  69. Follow me Blog: http://www.dasprids.de
  70. Twitter: dasprid
  71. Rate this talk http://joind.in/talk/view/634 </li></ul>
  72. Thank you!