Search and Find

Book Title

Author/Publisher

Table of Contents

Show eBooks for my device only:

 

Pro Zend Framework Techniques - Build a Full CMS Project

Pro Zend Framework Techniques - Build a Full CMS Project

of: Forrest Lyman

Apress, 2010

ISBN: 9781430218807 , 500 Pages

Format: PDF, Read online

Copy protection: DRM

Windows PC,Mac OSX Apple iPad, Android Tablet PC's Read Online for: Windows PC,Mac OSX,Linux

Price: 39,99 EUR



More of the content

Pro Zend Framework Techniques - Build a Full CMS Project


 

Dedication Page

4

Contents at a Glance

5

Table of Contents

6

Preface

15

About the Author

16

About the Technical Reviewers

17

Acknowledgments

18

Introduction

19

Who This Book Is For

19

Prerequisites

19

Chapter 1: Getting Started

20

Introducing Zend Framework MVC Implementation

20

The Controller: Zend_Controller_Front

21

The Model: Zend_Db

21

The View: Zend_View

22

Setting Up Your Development Environment

22

Installing Zend Server CE

22

Doing Rapid Application Development with the Zend Command- Line Tool

24

Creating Your Project

25

Building a Project with the Zend Tool Framework

25

Testing Your New Project

26

Exploring the Anatomy of Your Project

27

The public Folder

28

Redirecting the Request with .htaccess

28

The Index File

28

Additional Public Folders

29

The library Folder

29

The application Folder

29

Zend_Application

29

The Bootstrap Class

30

Application Configuration

30

Action Controllers

31

Views

31

Error Handling

32

Summary

35

Chapter 2: Designing Your Site

36

Rendering the Presentation Layer with Zend_View

36

View Scripts

36

View Helpers

36

Rendering the Presentation Layer with Zend_Layout

37

Using Zend_Layout on Its Own

37

Zend_Layout MVC

37

Three-Step Views

37

Designing the Interface

38

Organizing the Interface Components

38

Mocking It Up

40

Creating the Base HTML Page

41

Testing Your Design

44

Creating the Layout

45

Creating the Layout

45

Adding the Dynamic Head with Zend_View’s Placeholders

46

Adding the Dynamic Content to Your Layout

47

Rendering the Controller Response with Zend_Layout

47

Configuring Your Application to Use the Layout

48

Testing Your New Layout

48

Implementing the Skin

49

What Goes in a Skin?

49

Creating the Blues Skin

50

The skin.xml File

50

The Style Sheets

50

Building a View Helper to Render the Skin

52

Using the loadSkin Helper

53

Testing the Skin

54

Summary

55

Chapter 3: Building and Processing Web Forms with Zend_Form

56

The Anatomy of a Zend Framework Form

56

Rendering Forms

57

Processing a Form

57

Form Elements

57

Initial Elements

57

Zend_Form_Element_Button

57

Zend_Form_Element_Captcha

58

Zend_Form_Element_Checkbox

58

Zend_Form_Element_File

58

Zend_Form_Element_Hidden

58

Zend_Form_Element_Hash

58

Zend_Form_Element_Image

58

Zend_Form_Element_MultiCheckbox

58

Zend_Form_Element_Multiselect

58

Zend_Form_Element_Password

58

Zend_Form_Element_Radio

59

Zend_Form_Element_Reset

59

Zend_Form_Element_Select

59

Zend_Form_Element_Submit

59

Zend_Form_Element_Text

59

Zend_Form_Element_Textarea

59

Custom Form Elements

59

Creating a Page Form

59

Getting Started

60

Creating the Form

60

Adding Controls to the Form

61

The Author Text Control

62

The E-mail Text Control

62

The Date Text Control

63

The URL Text Control

63

The Description Text Area Control

63

The Priority Select Control

64

The Status Select Control

64

The Submit Button

65

Rendering the Form

65

Processing the Form

67

Styling the Form

68

Summary

71

Chapter 4: Managing Data with Zend Framework

72

Setting Up the Database

72

Creating the CMS Database

72

Configuring the Database Connection

72

Creating the bugs Table

73

Exploring the Zend Framework Models

74

Learning About the Models

75

Creating the Bug Model

76

Working with Bugs

76

Submitting a New Bug

76

Creating the createBug() Method

76

Updating the Bug Controller’s Submit Action

77

Viewing All the Current Bugs

78

Creating the fetchBugs() Method

78

Adding the List Action to the Bug Controller

79

Creating the List View

79

Filtering and Sorting the Bug Reports

81

Updating the fetchBugs() Method

82

Creating the Form to Filter and Sort the Bugs

82

Loading and Rendering the Filter Form

83

Processing the Filters and Sort Criteria

84

Limiting and Paginating Bug Reports Using Zend_Paginator

85

Updating the fetchBugs() Method to Return a Zend_Paginator Adapter

85

Refactoring the Bug Controller listAction() to Load the Paginator

86

Rendering the Bug Reports Using the Paginator

87

Updating a Bug

90

Updating the Bug Report Form

90

Creating the Edit Action

90

Creating the Edit View

91

Updating the Bug Record

91

Deleting a Bug

92

Adding the Delete Method to the Bug Model

93

Creating the Bug Controller Delete Action

93

Summary

94

Chapter 5: Working with CMS Data

95

Exploring the Data Structure

95

Traditional CMS Data Structures

95

Abstract Data Structures

95

Designing a Database That Can Grow with Your System

96

Implementing the Data Management System

97

Managing Content Nodes

98

Creating the content_nodes Table

98

Creating the ContentNode Model Class

98

Creating and Updating Content Nodes

99

Deleting Nodes

100

Managing Pages

100

Creating the pages Table

100

Creating the Page Model Class

100

Creating Pages

101

Updating Existing Pages

101

Deleting a Page

102

Defining and Working with Table Relationships

103

Defining the Relationships

103

The ContentNode to Page Relationship

103

The Page to Parent Page Relationship

103

Working with Related Items

104

Cascading Updates and Deletes

105

Working with Content Items

105

Using the Abstract CMS Content_Item Class

105

Creating the Base Class

105

Loading Pages

106

Using Utility Methods

108

Manipulating Data

109

Extending the Base Content Item Class

110

Summary

111

Chapter 6: Managing Content

112

Creating and Updating Content Pages

112

Creating the Page Content Item Class

112

Creating the Page Controller

114

Creating the Page Form

114

Rendering the Page Form

115

Inserting the New Page

117

Managing Pages

118

Editing an Existing Page

120

Opening a Page to Edit

120

Updating the Page

121

Deleting Pages

122

Rendering Pages

122

The Home Page

122

Rendering the Most Recent Pages

123

Setting This Page As Your Site’s Home Page

127

Opening a Page

127

Summary

129

Chapter 7: Creating the Site Navigation

130

How CMSs Manage Menus

130

Managing Menu Data

130

Creating the Menu Controllers

132

Creating a New Menu

133

Creating the Menu Form

133

Rendering the Create Menu Form

134

Processing the Form

136

Listing Current Menus

137

Updating a Menu

140

Opening the Menu to Edit

141

Updating the Menu

141

Deleting Menus

143

Managing Menu Items

143

Listing the Menu Items

144

Adding New Menu Items

146

The Menu Item Form

146

Creating the Add Menu Item Action

147

Rendering the Menu Item Form

148

Processing the Form

148

Sorting Menu Items

149

Updating Menu Items

152

Loading the Update Item Form

152

Rendering the Update Item Form

153

Processing the Update Item Form

153

Deleting Menu Items

154

Rendering Menus

155

Creating the Main Site Menus

156

Creating the Main Menus

156

Setting the Main Menu GUIDs

156

Rendering the Main Menus

157

Rendering the Admin Menu

158

Creating SEO-Friendly URLs

159

Summary

161

Chapter 8: Handling Security in a Zend Framework Project

162

Managing CMS Users

162

User Data and Model

163

Creating a New User

163

Creating the User Controller

163

Creating the User Form

164

Rendering the Create User Form

165

Processing the Form

166

Managing Existing Users

168

Updating Users

171

Deleting Users

174

Authenticating Users with Zend_Auth

175

Creating the User Landing Page

176

Creating the User Login

176

Logging Users Out

178

Adding User Controls to the Main CMS Interface

179

Controlling Access with Zend_Acl

181

Using Zend_Acl

182

Securing Your CMS Project

182

Summary

186

Chapter 9: Searching and Sharing Content

187

Working with the Lucene Search Engine

187

Creating a Search Index

187

Documents and Fields

187

Implementing Site Search

188

Securing Site Search

188

Creating the Search Index

189

The Build Action

189

The Build Search View

190

Searching the Site

190

The Search Form

191

Adding the Search Form to the Site

191

Processing a Search Request

192

Rendering Search Results

192

Testing Site Search

193

Working with Zend Feed

193

Creating the What’s New Feed

194

Securing the Feeds

194

Building and Rendering the Feed

194

Adding the Feed to the Site

196

Web Services and Zend Framework

197

Working with Existing Services

197

Creating an API for your CMS with Zend REST

198

The Base Class

198

Securing the API

198

Searching Pages

199

Creating Pages

199

Updating Pages

200

Deleting Pages

201

Creating the API Server

201

Testing the API

202

Testing Searching

202

Testing Creating a Page

203

Updating the Page

203

Deleting the Page

204

Summary

204

Chapter 10: Extending Your CMS

205

Creating the Module

205

Configuring Your Application to Load Modules

206

Rendering the Contact Form

207

Processing the Contact Form

209

Sending Mail with Zend_Mail

210

Creating the Mail Template

210

Rendering and Sending the HTML Message

211

The Confirmation Message

212

Securing the Form with Captcha

213

Using SMTP Mail Transport

214

File Attachments

215

Uploading the File

215

Attaching the File to Your Message

217

Summary

218

Chapter 11: Advanced Topics

219

Performance Tuning

219

About Zend_Db_Profiler

219

Testing Your Application

219

Creating the Profiler View Script

220

Adding the Profiler Script to the Site

221

Optimizing the CMS_Content_Item_Page Class

222

Caching

224

Implementing Cache

224

Configuring the Cache

225

Creating the Cache Application Resource

225

Caching Menu Data

227

Updating the Cached Menus

229

Caching Content Items

231

Internationalization

232

Getting Started with Zend_Translate

232

Zend_Translate_Adapters

232

Integrating Zend_Translate with Your Project

232

Other Hidden Gems

234

Summary

234

Chapter 12: Installing and Managing a Site with Your CMS

236

Creating the Database

236

Installing the Application

238

Alternate Installations

239

Sharing One Common Library

239

Configuring Your CMS

239

Managing Users

239

Creating a User

240

Updating a User

241

Deleting a User

241

Managing Content

241

Creating a Page

242

Updating a Page

242

Deleting a Page

243

Navigating Between Pages

243

Adding a Menu Item

243

Sorting Menu Items

244

Updating Menu Items

245

Deleting Menu Items

245

The Next Steps

245

Index

246