Archives For yii

As you may already know, the beta of Yii 2 was announced yesterday. Besides being another release, which is a good thing, officially reaching beta status means that no new major features will be added before Yii 2 is released. In other words, what Yii 2 looks like in beta will be pretty close to what Yii 2 is. Yay!

Rather than discussing all, or the most important, changes in Yii 2, I’d recommend you read the announcement page linked above. As for how I imagine this will play out looking forward…

Continue Reading...

I’m hard at work on Chapter 20, “Working with Third-Party Libraries,” of “The Yii Book”, and making decent progress. The goal of the chapter, really, is to explain how to include third-party libraries without getting a ton of errors about not being able to find the class definition. If you’ve played around in this area at all, then you’ll know what I’m talking about: simple libraries, namespaces, autoloaders…it can get complicated.

Continue Reading...

I wanted to wait on saying something until the chapter was on its way to the tech editors, but it’s the end of the year and the chapter is close enough to being done that I can offer an update now. My wife and kids went away to visit friends for a couple of days, and I stayed home to work, spending the vast majority of my time on “The Yii Book”. Not only did I make pretty good progress on Chapter 19, but I got my Yii book mojo back (in terms of being in the flow and mindset), which is just as important.

Continue Reading...

Whenever you begin working with a database, you introduce more possible causes of errors. Thus, you must learn additional debugging strategies. When using PHP to run queries on the database, the problems you might encounter include:

An inability to connect to the database
A database error thrown because of a query
The query not returning the results or having the effect that you expect
None of the above, and yet, the output is still incorrect
On a non-framework site, you just need to watch for database errors to catch the first two types of problems. There’s a simple and standard approach for debugging the last two types:

Use PHP to print out the query being run.
Run the same query using another interface to confirm the results.
Debug the query until you get the results you want.
When using a framework, these same debugging techniques are a little less obvious, in part because you may not be directly touching the underlying SQL commands. Thankfully, Yii will still be quite helpful, if you know what switches to flip.

Continue Reading...

I’m looking ahead to writing Chapter 20, “Working with Third-Party Libraries,” of “The Yii Book” (I’m currently writing Chapter 19), and was wondering what people wanted me to specifically demonstrate. Originally, I had intended to use the Zend Framework as my example. I like how ZF components can be easily used on their own, and I’d frequently used ZF with my own Yii projects. Lately, I’ve been thinking about using Symfony in the chapter. I’ve not touched Symfony yet myself, but have heard good things. Of course, the examples don’t have to use frameworks; they could use any type of library.

Continue Reading...