Szczegóły ebooka

Yii 1.1 Application Development Cookbook. Over 80 recipes to help you master using the Yii PHP framework

Yii 1.1 Application Development Cookbook. Over 80 recipes to help you master using the Yii PHP framework

Alexander Makarov, Qiang Xue (Project)

Ebook
When Alex told me he was about to write a Yii cookbook about a year ago, I was wondering how original it would be, considering the fact that there was already an online user-contributed cookbook (aka. Yii wiki). It turned out Alex produced a book that is not only full of wisdom about how to use Yii effectively, but also presented in such a systematic way that it can be taken as an essential companion book to the definitive guide to Yii. In fact, Alex has successfully intrigued the interest of every member in the Yii developer team when he asked for review and comments on his newly finished book chapters.As the founder and the lead developer of the Yii framework, I feel this book is a must-read for every Yii programmer. While this book does not describe directly the rules set by Yii, it shows how to program with Yii from a practical perspective. People who are driven by tight project schedules will find this book very handy as it gives ready-to-use solutions to many problems they may face in their projects; people who are already familiar with Yii will also find this book very informative as most problem solutions given in the book can be considered as officially recommended because they have undergone thorough review of every Yii developer team member. Alex, through this book and his active participation in the Yii project, proved himself to be a great programmer as well as a good writer.

Qiang XueLead developer of the Yii framework

Yii framework is a rapidly growing PHP5 MVC framework often referred to as Rails for PHP. It has become a solid base for many exciting web applications such as Stay.com and Russia Today's meetfriends.rt.com and can be a good base for your developments. Yii is an object-oriented, high-performance, component-based PHP web application framework. Yii is pronounced as Yee and is an acronym for Yes It Is!.

Familiar with Yii and want to exploit it to its full potential, but do not know how to go about it? Yii 1.1 Application Development Cookbook will show you how to use Yii efficiently. You will learn about implementing shortcuts using core features, creating your own reusable code base, using test-driven development, and many more topics that will escalate your knowledge in no time at all!

Yii 1.1 Application Development Cookbook will help you learn more about Yii framework and application development practices in general with demonstrations of shortcuts and information about dangerous things you should not do.

Grouped in 13 chapters, the recipes will assist you to write your applications exploiting Yii core functionality to its full potential. The chapters are generally independent of each other and you can start reading from the chapter you need most, whether it is AJAX and jQuery, Database, Active Record and Model Tricks or Extending Yii. The most interesting topics include Yii application deployment, a guide to writing your own extensions, advanced error handling, debugging and logging, application security, and performance tuning.

Yii 1.1 Application Development Cookbook will help you utilize Yii functionalities completely and efficiently.
  • Yii 1.1 Application Development Cookbook
    • Table of Contents
    • Yii 1.1 Application Development Cookbook
    • Credits
    • Foreword
    • About the Author
    • About the Reviewers
    • www.PacktPub.com
      • Support files, eBooks, discount offers, and more
        • Why Subscribe?
        • Free Access for Packt account holders
    • Preface
      • What this book covers
      • What you need for this book
      • Who this book is for
      • Conventions
      • Reader feedback
      • Customer support
        • Downloading the example code
        • Errata
        • Piracy
        • Questions
    • 1. Under the Hood
      • Introduction
      • Using getters and setters
        • How to do it...
        • How it works...
        • Theres more...
        • See also
      • Using Yii events
        • How to do it...
        • There's more...
          • Further reading
        • See also
      • Using import and autoloading
        • How to do it...
        • How it works...
        • There's more...
      • Using exceptions
        • How to do it
        • How it works
        • There's more...
      • Configuring components
        • How to do it
        • How it works
        • There's more...
        • See also
      • Configuring widget defaults
        • How to do it
        • See also
      • Using Yii core collections
        • How to do it
      • Working with request
        • How to do it
        • There's more...
    • 2. Router, Controller, and Views
      • Introduction
      • Configuring URL rules
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Further reading
        • See also
      • Generating URLs by path
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Using regular expressions in URL rules
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Creating URL rules for static pages
        • Getting ready
        • How to do it...
        • How it works...
        • See also
      • Providing your own URL rules at runtime
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Using base controller
        • Getting ready
        • How to do it...
        • How it works...
      • Using external actions
        • Getting ready
        • How to do it...
        • How it works...
        • There's more
      • Displaying static pages with CViewAction
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Further reading
        • See also
      • Using flash messages
        • Getting ready
        • How to do it...
        • How it works...
        • There's more
      • Using controller context in a view
        • Getting ready
        • How to do it...
        • How it works...
        • There's more
      • Reusing views with partials
        • Getting ready
        • How to do it...
        • How it works...
        • There's more
        • See also
      • Using clips
        • Getting ready
        • How to do it...
        • How it works...
        • See also
      • Using decorators
        • Getting ready
        • How to do it...
        • How it works...
        • There's more
        • See also
      • Defining multiple layouts
        • Getting ready
        • How to do it...
        • How it works...
        • See also
      • Paginating and sorting data
        • Getting ready
        • How to do it...
        • How it works...
        • There's more
    • 3. AJAX and jQuery
      • Introduction
      • Loading a block through AJAX
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Prevent including a bundled jQuery
          • Further reading
        • See also
      • Managing assets
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • What is inside the assets directory?
          • Publishing an entire directory
          • Further reading
        • See also
      • Including resources into the page
        • How to do it...
        • How it works...
        • There's more
          • Using custom script packages
          • Registering linked resources
          • Registering meta tags
          • Further reading
        • See also
      • Working with JSON
        • Getting ready
        • How to do it...
        • How it works...
        • There's more
        • See also
      • Passing configuration from PHP to JavaScript
        • Getting ready
        • How to do it...
        • How it works...
        • See also
      • Handling variable number of inputs
        • Getting ready
        • How to do it...
        • How it works...
        • There's more
        • See also
    • 4. Working with Forms
      • Introduction
      • Writing your own validators
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Further reading
      • Uploading files
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • File validation
          • Further reading
        • See also
      • Adding CAPTCHA
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Further reading:
        • See also
      • Customizing CAPTCHA
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Creating a custom input widget with CInputWidget
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
    • 5. Testing your Application
      • Introduction
      • Setting up the testing environment
        • Getting ready
        • How to do it...
        • There's more...
        • See also
      • Writing and running unit tests
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Using fixtures
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Testing the application with functional tests
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Generating code coverage reports
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
    • 6. Database, Active Record, and Model Tricks
      • Introduction
      • Getting data from a database
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Defining and using multiple DB connections
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Cross-database relations
          • Further reading
        • See also
      • Using scopes to get models for different languages
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Processing model fields with AR event-like methods
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Further reading
        • See also
      • Applying markdown and HTML
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Makdown syntax
          • Yii markdown wraper and usage
        • See also
      • Highlighting code with Yii
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Yii code highlighter
          • More code highlighters
        • See also
      • Automating timestamps
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Setting an author automatically
        • Getting ready
        • How to do it...
        • How it works...
        • See also
      • Implementing single table inheritance
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Using CDbCriteria
        • How to do it...
        • How it works...
        • There's more...
        • See also
    • 7. Using Zii Components
      • Introduction
      • Using data providers
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Further reading
        • See also
      • Using grids
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Using data from related Active Record models
          • Further reading
        • See also
      • Using lists
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Adding sorting
          • Customizing templates
          • Customizing markup and data displayed
          • Further reading
        • See also
      • Creating custom grid columns
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
    • 8. Extending Yii
      • Introduction
      • Creating model behaviors
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • CActiveRecordBehavior and CModelBehavior
          • More behavior types
          • Further reading
        • See also
      • Creating components
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Overriding existing application components
          • Further reading
        • See also
      • Creating reusable controller actions
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Further reading
        • See also
      • Creating reusable controllers
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Creating a widget
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Creating CLI commands
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Custom help
          • Further reading
        • See also
      • Creating filters
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Creating modules
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Creating a custom view renderer
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Further reading
        • See also
      • Making extensions distribution-ready
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
    • 9. Error handling, Debugging, and Logging
      • Introduction
      • Using different log routes
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Yii::trace vs Yii::log
          • Yii::beginProfile and Yii::endProfile
          • Log messages immediately
          • Further reading
        • See also
      • Analyzing the Yii error stack trace
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Logging and using the context information
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Implementing your own smart 404 handler
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Further reading
        • See also
    • 10. Security
      • Introduction
      • Using controller filters
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Using CHtml and CHtmlPurifier to prevent XSS
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • XSS types
          • Configuring the HTML purifier
          • HTML purifier performance
          • Further reading
        • See also
      • Preventing SQL injections
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Preventing CSRF
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Extra measures
          • Using GET and POST properly
          • Further reading
        • See also
      • Using RBAC
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Naming RBAC nodes
          • A way to keep the hierarchy simple and efficient
          • Avoiding RBAC
          • Further reading
        • See also
    • 11. Performance Tuning
      • Introduction
      • Following best practices
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Server-side performance is just a part of the big picture
          • Things to be done without using Yii
          • Active record versus query builder and SQL
          • Always check for slow queries first
          • Cache or save results of "heavy" processes
          • Handling too much processing
          • Further reading
        • See also
      • Speeding up sessions handling
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Using cache dependencies and chains
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Profiling an application with Yii
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
    • 12. Using External Code
      • Introduction
      • Using Zend Framework from Yii
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Customizing the Yii autoloader
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Further reading
        • See also
      • Using Kohana inside Yii
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Further reading
        • See also
      • Using PEAR inside Yii
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
    • 13. Deployment
      • Introduction
      • Changing the Yii directories layout
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Moving an application out of webroot
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Sharing the framework directory
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Moving configuration parts into separate files
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Using multiple configurations to simplify the deployment
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
      • Implementing and executing cron jobs
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
          • Further reading
        • See also
      • Maintenance mode
        • Getting ready
        • How to do it...
        • How it works...
        • There's more...
        • See also
    • Index
  • Tytuł: Yii 1.1 Application Development Cookbook. Over 80 recipes to help you master using the Yii PHP framework
  • Autor: Alexander Makarov, Qiang Xue (Project)
  • Tytuł oryginału: Yii 1.1 Application Development Cookbook. Over 80 recipes to help you master using the Yii PHP framework
  • ISBN: 9781849515498, 9781849515498
  • Data wydania: 2011-08-25
  • Format: Ebook
  • Identyfikator pozycji: e_3cut
  • Wydawca: Packt Publishing