Lyman | Pro Zend Framework Techniques | E-Book | www2.sack.de
E-Book

E-Book, Englisch, 500 Seiten

Lyman Pro Zend Framework Techniques

Build a Full CMS Project
1. ed
ISBN: 978-1-4302-1880-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark

Build a Full CMS Project

E-Book, Englisch, 500 Seiten

ISBN: 978-1-4302-1880-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark



The Zend Framework is a truly amazing PHP-based web application development framework and platform that is breathing new life into PHP development. One of the most common uses for a framework such as this is to build content-driven web sites. Pro Zend Framework Techniques offers: A structured guide for PHP developers, ultimately helping you to create more flexible software much more quickly Clear guidance through the entire process of building a custom content management system (CMS) with the Zend Framework The ideal example project, building a CMS, to illustrate how to use the many different aspects of the framework

Forrest Lyman is a passionate PHP developer who concentrates on content management systems (CMS) development. He developed the Digitalus CMS on the Zend Framework, progressing from version 0.1 through 1.5. Once Zend Framework reached its production release (1.0), Forrest released Digitalus as an open source project. Over the course of the project, he developed a wide range of sites based on the CMS, from small business sites to international non-profit and university systems. Working hands-on developing these sites with the Zend Framework has given Forrest a unique perspective into building extensible CMS systems with Zend Framework.

Lyman Pro Zend Framework Techniques jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


1;Dedication Page;4
2;Contents at a Glance;5
3;Table of Contents;6
4;Preface;15
5;About the Author;16
6;About the Technical Reviewers;17
7;Acknowledgments;18
8;Introduction;19
8.1;Who This Book Is For;19
8.2;Prerequisites;19
9;Chapter 1: Getting Started;20
9.1;Introducing Zend Framework MVC Implementation;20
9.1.1;The Controller: Zend_Controller_Front;21
9.1.2;The Model: Zend_Db;21
9.1.3;The View: Zend_View;22
9.2;Setting Up Your Development Environment;22
9.2.1;Installing Zend Server CE;22
9.2.2;Doing Rapid Application Development with the Zend Command- Line Tool;24
9.3;Creating Your Project;25
9.3.1;Building a Project with the Zend Tool Framework;25
9.3.2;Testing Your New Project;26
9.4;Exploring the Anatomy of Your Project;27
9.4.1;The public Folder;28
9.4.1.1;Redirecting the Request with .htaccess;28
9.4.1.2;The Index File;28
9.4.1.3;Additional Public Folders;29
9.4.2;The library Folder;29
9.4.3;The application Folder;29
9.4.3.1;Zend_Application;29
9.4.3.2;The Bootstrap Class;30
9.4.3.3;Application Configuration;30
9.4.3.4;Action Controllers;31
9.4.3.5;Views;31
9.4.3.6;Error Handling;32
9.5;Summary;35
10;Chapter 2: Designing Your Site;36
10.1;Rendering the Presentation Layer with Zend_View;36
10.1.1;View Scripts;36
10.1.2;View Helpers;36
10.2;Rendering the Presentation Layer with Zend_Layout;37
10.2.1;Using Zend_Layout on Its Own;37
10.2.2;Zend_Layout MVC;37
10.3;Three-Step Views;37
10.4;Designing the Interface;38
10.4.1;Organizing the Interface Components;38
10.4.2;Mocking It Up;40
10.4.3;Creating the Base HTML Page;41
10.4.4;Testing Your Design;44
10.5;Creating the Layout;45
10.5.1;Creating the Layout;45
10.5.2;Adding the Dynamic Head with Zend_View’s Placeholders;46
10.5.3;Adding the Dynamic Content to Your Layout;47
10.5.4;Rendering the Controller Response with Zend_Layout;47
10.5.5;Configuring Your Application to Use the Layout;48
10.5.6;Testing Your New Layout;48
10.6;Implementing the Skin;49
10.6.1;What Goes in a Skin?;49
10.6.2;Creating the Blues Skin;50
10.6.2.1;The skin.xml File;50
10.6.2.2;The Style Sheets;50
10.6.3;Building a View Helper to Render the Skin;52
10.6.4;Using the loadSkin Helper;53
10.6.5;Testing the Skin;54
10.7;Summary;55
11;Chapter 3: Building and Processing Web Forms with Zend_Form;56
11.1;The Anatomy of a Zend Framework Form;56
11.1.1;Rendering Forms;57
11.1.2;Processing a Form;57
11.2;Form Elements;57
11.2.1;Initial Elements;57
11.2.1.1;Zend_Form_Element_Button;57
11.2.1.2;Zend_Form_Element_Captcha;58
11.2.1.3;Zend_Form_Element_Checkbox;58
11.2.1.4;Zend_Form_Element_File;58
11.2.1.5;Zend_Form_Element_Hidden;58
11.2.1.6;Zend_Form_Element_Hash;58
11.2.1.7;Zend_Form_Element_Image;58
11.2.1.8;Zend_Form_Element_MultiCheckbox;58
11.2.1.9;Zend_Form_Element_Multiselect;58
11.2.1.10;Zend_Form_Element_Password;58
11.2.1.11;Zend_Form_Element_Radio;59
11.2.1.12;Zend_Form_Element_Reset;59
11.2.1.13;Zend_Form_Element_Select;59
11.2.1.14;Zend_Form_Element_Submit;59
11.2.1.15;Zend_Form_Element_Text;59
11.2.1.16;Zend_Form_Element_Textarea;59
11.2.2;Custom Form Elements;59
11.3;Creating a Page Form;59
11.3.1;Getting Started;60
11.3.2;Creating the Form;60
11.3.3;Adding Controls to the Form;61
11.3.3.1;The Author Text Control;62
11.3.3.2;The E-mail Text Control;62
11.3.3.3;The Date Text Control;63
11.3.3.4;The URL Text Control;63
11.3.3.5;The Description Text Area Control;63
11.3.3.6;The Priority Select Control;64
11.3.3.7;The Status Select Control;64
11.3.3.8;The Submit Button;65
11.3.4;Rendering the Form;65
11.3.5;Processing the Form;67
11.3.6;Styling the Form;68
11.4;Summary;71
12;Chapter 4: Managing Data with Zend Framework;72
12.1;Setting Up the Database;72
12.1.1;Creating the CMS Database;72
12.1.2;Configuring the Database Connection;72
12.1.3;Creating the bugs Table;73
12.2;Exploring the Zend Framework Models;74
12.2.1;Learning About the Models;75
12.2.2;Creating the Bug Model;76
12.3;Working with Bugs;76
12.3.1;Submitting a New Bug;76
12.3.1.1;Creating the createBug() Method;76
12.3.1.2;Updating the Bug Controller’s Submit Action;77
12.3.2;Viewing All the Current Bugs;78
12.3.2.1;Creating the fetchBugs() Method;78
12.3.2.2;Adding the List Action to the Bug Controller;79
12.3.2.3;Creating the List View;79
12.3.3;Filtering and Sorting the Bug Reports;81
12.3.3.1;Updating the fetchBugs() Method;82
12.3.3.2;Creating the Form to Filter and Sort the Bugs;82
12.3.3.3;Loading and Rendering the Filter Form;83
12.3.3.4;Processing the Filters and Sort Criteria;84
12.3.4;Limiting and Paginating Bug Reports Using Zend_Paginator;85
12.3.4.1;Updating the fetchBugs() Method to Return a Zend_Paginator Adapter;85
12.3.4.2;Refactoring the Bug Controller listAction() to Load the Paginator;86
12.3.4.3;Rendering the Bug Reports Using the Paginator;87
12.3.5;Updating a Bug;90
12.3.5.1;Updating the Bug Report Form;90
12.3.5.2;Creating the Edit Action;90
12.3.5.3;Creating the Edit View;91
12.3.5.4;Updating the Bug Record;91
12.3.6;Deleting a Bug;92
12.3.6.1;Adding the Delete Method to the Bug Model;93
12.3.6.2;Creating the Bug Controller Delete Action;93
12.4;Summary;94
13;Chapter 5: Working with CMS Data;95
13.1;Exploring the Data Structure;95
13.1.1;Traditional CMS Data Structures;95
13.1.2;Abstract Data Structures;95
13.2;Designing a Database That Can Grow with Your System;96
13.3;Implementing the Data Management System;97
13.4;Managing Content Nodes;98
13.4.1;Creating the content_nodes Table;98
13.4.2;Creating the ContentNode Model Class;98
13.4.2.1;Creating and Updating Content Nodes;99
13.4.2.2;Deleting Nodes;100
13.5;Managing Pages;100
13.5.1;Creating the pages Table;100
13.5.2;Creating the Page Model Class;100
13.5.2.1;Creating Pages;101
13.5.2.2;Updating Existing Pages;101
13.5.2.3;Deleting a Page;102
13.6;Defining and Working with Table Relationships;103
13.6.1;Defining the Relationships;103
13.6.1.1;The ContentNode to Page Relationship;103
13.6.1.2;The Page to Parent Page Relationship;103
13.6.2;Working with Related Items;104
13.6.3;Cascading Updates and Deletes;105
13.7;Working with Content Items;105
13.7.1;Using the Abstract CMS Content_Item Class;105
13.7.1.1;Creating the Base Class;105
13.7.1.2;Loading Pages;106
13.7.1.3;Using Utility Methods;108
13.7.1.4;Manipulating Data;109
13.7.2;Extending the Base Content Item Class;110
13.8;Summary;111
14;Chapter 6: Managing Content;112
14.1;Creating and Updating Content Pages;112
14.1.1;Creating the Page Content Item Class;112
14.1.2;Creating the Page Controller;114
14.1.3;Creating the Page Form;114
14.1.3.1;Rendering the Page Form;115
14.1.3.2;Inserting the New Page;117
14.1.4;Managing Pages;118
14.1.5;Editing an Existing Page;120
14.1.5.1;Opening a Page to Edit;120
14.1.5.2;Updating the Page;121
14.1.6;Deleting Pages;122
14.2;Rendering Pages;122
14.2.1;The Home Page;122
14.2.1.1;Rendering the Most Recent Pages;123
14.2.1.2;Setting This Page As Your Site’s Home Page;127
14.2.2;Opening a Page;127
14.3;Summary;129
15;Chapter 7: Creating the Site Navigation;130
15.1;How CMSs Manage Menus;130
15.2;Managing Menu Data;130
15.3;Creating the Menu Controllers;132
15.4;Creating a New Menu;133
15.4.1;Creating the Menu Form;133
15.4.2;Rendering the Create Menu Form;134
15.4.3;Processing the Form;136
15.5;Listing Current Menus;137
15.6;Updating a Menu;140
15.6.1;Opening the Menu to Edit;141
15.6.2;Updating the Menu;141
15.7;Deleting Menus;143
15.8;Managing Menu Items;143
15.8.1;Listing the Menu Items;144
15.8.2;Adding New Menu Items;146
15.8.2.1;The Menu Item Form;146
15.8.2.2;Creating the Add Menu Item Action;147
15.8.2.3;Rendering the Menu Item Form;148
15.8.2.4;Processing the Form;148
15.8.3;Sorting Menu Items;149
15.8.4;Updating Menu Items;152
15.8.4.1;Loading the Update Item Form;152
15.8.4.2;Rendering the Update Item Form;153
15.8.4.3;Processing the Update Item Form;153
15.8.5;Deleting Menu Items;154
15.9;Rendering Menus;155
15.10;Creating the Main Site Menus;156
15.10.1;Creating the Main Menus;156
15.10.2;Setting the Main Menu GUIDs;156
15.10.3;Rendering the Main Menus;157
15.10.4;Rendering the Admin Menu;158
15.11;Creating SEO-Friendly URLs;159
15.12;Summary;161
16;Chapter 8: Handling Security in a Zend Framework Project;162
16.1;Managing CMS Users;162
16.1.1;User Data and Model;163
16.1.2;Creating a New User;163
16.1.2.1;Creating the User Controller;163
16.1.2.2;Creating the User Form;164
16.1.2.3;Rendering the Create User Form;165
16.1.2.4;Processing the Form;166
16.1.3;Managing Existing Users;168
16.1.4;Updating Users;171
16.1.5;Deleting Users;174
16.2;Authenticating Users with Zend_Auth;175
16.2.1;Creating the User Landing Page;176
16.2.2;Creating the User Login;176
16.2.3;Logging Users Out;178
16.2.4;Adding User Controls to the Main CMS Interface;179
16.3;Controlling Access with Zend_Acl;181
16.3.1;Using Zend_Acl;182
16.4;Securing Your CMS Project;182
16.5;Summary;186
17;Chapter 9: Searching and Sharing Content;187
17.1;Working with the Lucene Search Engine;187
17.1.1;Creating a Search Index;187
17.1.2;Documents and Fields;187
17.2;Implementing Site Search;188
17.2.1;Securing Site Search;188
17.2.2;Creating the Search Index;189
17.2.2.1;The Build Action;189
17.2.2.2;The Build Search View;190
17.2.3;Searching the Site;190
17.2.3.1;The Search Form;191
17.2.3.2;Adding the Search Form to the Site;191
17.2.3.3;Processing a Search Request;192
17.2.3.4;Rendering Search Results;192
17.2.3.5;Testing Site Search;193
17.3;Working with Zend Feed;193
17.3.1;Creating the What’s New Feed;194
17.3.2;Securing the Feeds;194
17.3.3;Building and Rendering the Feed;194
17.3.4;Adding the Feed to the Site;196
17.4;Web Services and Zend Framework;197
17.4.1;Working with Existing Services;197
17.4.2;Creating an API for your CMS with Zend REST;198
17.4.2.1;The Base Class;198
17.4.2.2;Securing the API;198
17.4.2.3;Searching Pages;199
17.4.2.4;Creating Pages;199
17.4.2.5;Updating Pages;200
17.4.2.6;Deleting Pages;201
17.4.3;Creating the API Server;201
17.4.4;Testing the API;202
17.4.4.1;Testing Searching;202
17.4.4.2;Testing Creating a Page;203
17.4.4.3;Updating the Page;203
17.4.4.4;Deleting the Page;204
17.5;Summary;204
18;Chapter 10: Extending Your CMS;205
18.1;Creating the Module;205
18.2;Configuring Your Application to Load Modules;206
18.3;Rendering the Contact Form;207
18.4;Processing the Contact Form;209
18.5;Sending Mail with Zend_Mail;210
18.5.1;Creating the Mail Template;210
18.5.2;Rendering and Sending the HTML Message;211
18.5.3;The Confirmation Message;212
18.6;Securing the Form with Captcha;213
18.7;Using SMTP Mail Transport;214
18.8;File Attachments;215
18.8.1;Uploading the File;215
18.8.2;Attaching the File to Your Message;217
18.9;Summary;218
19;Chapter 11: Advanced Topics;219
19.1;Performance Tuning;219
19.1.1;About Zend_Db_Profiler;219
19.1.2;Testing Your Application;219
19.1.2.1;Creating the Profiler View Script;220
19.1.2.2;Adding the Profiler Script to the Site;221
19.1.2.3;Optimizing the CMS_Content_Item_Page Class;222
19.2;Caching;224
19.2.1;Implementing Cache;224
19.2.1.1;Configuring the Cache;225
19.2.1.2;Creating the Cache Application Resource;225
19.2.2;Caching Menu Data;227
19.2.3;Updating the Cached Menus;229
19.2.4;Caching Content Items;231
19.3;Internationalization;232
19.3.1;Getting Started with Zend_Translate;232
19.3.2;Zend_Translate_Adapters;232
19.3.3;Integrating Zend_Translate with Your Project;232
19.4;Other Hidden Gems;234
19.5;Summary;234
20;Chapter 12: Installing and Managing a Site with Your CMS;236
20.1;Creating the Database;236
20.2;Installing the Application;238
20.2.1;Alternate Installations;239
20.2.2;Sharing One Common Library;239
20.2.3;Configuring Your CMS;239
20.3;Managing Users;239
20.3.1;Creating a User;240
20.3.2;Updating a User;241
20.3.3;Deleting a User;241
20.4;Managing Content;241
20.4.1;Creating a Page;242
20.4.2;Updating a Page;242
20.4.3;Deleting a Page;243
20.5;Navigating Between Pages;243
20.5.1;Adding a Menu Item;243
20.5.2;Sorting Menu Items;244
20.5.3;Updating Menu Items;245
20.5.4;Deleting Menu Items;245
20.6;The Next Steps;245
21;Index;246



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.