Bøger / faglitteratur

Web application development with Yii and PHP : fast-track your web application development using the new generation Yii PHP framework


Beskrivelse


Yii is probably one of the most underestimated PHP frameworks today. Unfortunately there are only few good books about it out there, and in my opinion this is the best introduction for beginners you can find. It is actually the second revision of the 2010 release "Agile Web Application Development with Yii 1.1 and PHP5".

Indhold

Seneste udgave,

Preface 1 Chapter 1: Meet Yii 7 Yii is easy 8 Yii is efficient 8 Yii is extensible 9 MVC architecture 9 The model 10 The view 10 The controller 10 Stitching these together: Yii request routing 11 Blog posting example 11 Object-relational mapping and Active Record 13 Active Record 14 The view and controller 14 Summary 15 Chapter 2: Getting Started 17 Installing Yii 17 Installing a database 19 Creating a new application 19 Hello, World! 22 Creating the controller 22 One final step 26 Reviewing our request routing 27 Adding dynamic content 28 Adding the date and time 28 Adding the date and time, a better approach 29 Moving the data creation to the controller 29 Have you been paying attention? 30 Linking pages together 31 Linking to a new page 31 Getting a little help from Yii CHtml 32 Summary 34 Chapter 3: The TrackStar Application 35 Introducing TrackStar 35 Creating user stories 36 Users 36 Projects 36 Issues 37 Navigation and page flow 38 Defining a data scheme 39 Defining our development methodology 41 Automated software testing 41 Unit and functional testing 41 Benefits of testing 42 Test-driven development 43 Testing in Yii 43 Unit tests 44 Installing PHPUnit 45 Functional tests 45 Installing Selenium 45 Running a quick example 46 Hello TDD! 47 Summary 52 Chapter 4: Iteration 1: Creating the Initial TrackStar Application 53 Iteration planning 53 Creating the new application 54 Connecting to the database 55 Testing the connection 55 Yii and databases 57 Adding a db connection as an application component 58 Summary 60 Chapter 5: Iteration 2: Project CRUD 61 Iteration planning 61 Running our test suite 62 Creating the project table 62 Naming conventions 63 Creating the AR model class 64 Configuring Gii 65 Using Gii to create our Project AR class 66 ; Testing out our newly generated code 68 Creating the unit test file 69 Testing create 69 Testing read 71 Testing update and delete 72 Was all that testing really necessary? 73 Enabling CRUD operations for users 73 Creating CRUD scaffolding for projects 74 Creating a new project 77 Adding a required field to our form 78 Reading the project 82 Updating and deleting projects 83 Managing projects in admin mode 83 More on testing—fixtures 85 Configuring the fixture manager 86 Creating a fixture 86 Configuring this fixture for use 88 Specifying a test database 89 Using fixtures 90 Summary 92 Chapter 6: Iteration 3: Adding Tasks 93 Iteration planning 93 Running the test suite 94 Designing the schema 95 Defining some relationships 95 Building the database and the relationships 96 Creating the Active Record model classes 98 Creating the Issue model class 98 Creating the User model class 101 Creating the Issue CRUD operations 101 Using the Issue CRUD operations 102 Creating a new Issue 103 Adding the types drop-down menu 104 Getting the test in the "Red" 105 Moving From "Red" To "Green" 105 Moving Back To "Red" 106 Getting back to "Green" once again 107 Adding the issue type dropdown 107 Adding the status drop-down menu: Do it yourself 111 Fixing the owner and requester fields 112 Enforcing a project context 112 Implementing a filter 113 ; Adding a filter 113 Specifying the filtered actions 114 Adding some filter logic 115 Adding the project ID 117 Altering the project details page 117 Removing the project input form field 118 Returning back to the owner and requester dropdowns 119 Generating the data to populate the drop-down menu 122 Adding User and ProjectUserAssignment fixtures 124 Making one last change 127 Finishing the rest of the CRUD 128 Listing the issues 129 Altering the ProjectController 129 Altering the project view file 130 Making some final tweaks 132 Getting the status and type text to display 132 Adding the text display to the form 136 Changing the issue detail view 137 Getting the owner and requester names to display 139 Using relational AR 139 Making some final navigation tweaks 141 Summary 145 Chapter 7: Iteration 4: User Management and Authentication 147 Iteration planning 147 Running the test suite 148 Creating our User CRUD 149 Updating our common audit history columns 150 Adding a password confirmation field 157 Adding password encryption 159 Authenticating users using the database 160 Introducing the Yii authentication model 160 Changing the authenticate implementation 165 Updating the user last login time 168 Displaying the last login time on the home page 169 Summary 170 Chapter 8: Iteration 5: User Access Control 171 Iteration planning 172 Running our existing test suite 173 accessControl filter 173 ; Role-based access control 178 Configuring the authorization manager 179 Creating the RBAC database tables 180 Creating the RBAC authorization hierarchy 181 Writing a console application command 182 Assigning users to roles 188 Adding RBAC roles to projects 189 Adding RBAC business rules 190 Implementing the new Project AR methods 191 Adding Users To Projects 202 Altering the Project model class 203 Adding the new form model class 205 Adding the new action method to the project controller 207 Adding the new view file to display the form 208 Putting it all together 210 Checking authorization level 211 Summary 213 Chapter 9: Iteration 6: Adding User Comments 215 Iteration planning 215 Creating the model 216 Creating the Comment CRUD 218 Altering the scaffolding to meet requirements 218 Adding a comment 220 Displaying the form 221 Creating a recent comments widget 224 Introducing CWidget 225 More on relational AR queries in Yii 227 Completing the test 229 Creating the widget 232 Summary 237 Chapter 10: Iteration 7: Adding an RSS Web Feed 239 Iteration planning 239 A little background: Content Syndication, RSS, and Zend Framework 240 Installing Zend Framework 241 Using Zend_Feed 241 Creating user friendly URLs 244 Using the URL manager 245 Configuring routing rules 246 Removing the entry script from the URL 247 Adding the feed links 249 Summary 251 ; Chapter 11: Iteration 8: Making it Pretty - Design, Layout, Themes, and Internationalization(i18n) 253 Iteration planning 253 Designing with layouts 254 Specifying a layout 255 Applying and using a layout 255 Deconstructing the main.php layout file 257 Introducing the Blueprint CSS framework 259 Understanding the Blueprint installation 260 Setting the page title 260 Defining a page header 261 Displaying menu navigation items 262 Creating a breadcrumb navigation 265 Specifying the content being decorated by the layout 266 Defining the footer 267 Nesting the layouts 267 Creating themes 270 Building themes in Yii 270 Creating a Yii theme 270 Configuring the application to use a theme 277 Translating the site to other languages 278 Defining locale and language 279 Performing language translation 280 Performing message translation 280 Performing file translation 283 Summary 285 Chapter 12: Iteration 9: Modules - Adding Administration 287 Iteration planning 288 Modules 288 Creating a module 288 Using a module 291 Theming a module 292 Applying a theme 293 Restricting admin access 295 Adding a system-wide message 298 Creating the database table 298 Creating our model and CRUD scaffolding 299 Adding a link to our new functionality 301 ; Displaying the message to users 303 Importing the new model class for application-wide access 303 Selecting the most recently updated message 304 Adding a little design tweak 305 Summary 307 Chapter 13: Iteration 10: Production Readiness 309 Iteration planning 309 Logging 309 Message logging 310 Categories and levels 311 Adding a login message log 312 Message routing 313 Handling errors 316 Displaying errors 318 Caching 322 Configuring for cache 323 Using a file-based cache 324 Cache dependencies 329 Fragment caching 331 Declaring fragment caching options 331 Using fragment cache 332 Page caching 333 General performance tuning tips 335 Using APC 335 Disabling debug mode 335 Using yiilite.php 336 Using caching techniques 336 Enabling schema caching 336 Summary 337 Index 339


Tidsskrift

Artiklen er en del af

Artiklerne i  handler ofte om

Artikler med samme emner

Fra


Artikler

Alle registrerede artikler fordelt på udgivelser

...

...

...

...

...