Archives For yii

Approximately 1,000 years ago (or 5 months), I promised to give away copies of my “Effortless E-commerce with PHP and MySQL (2nd Edition)” book to those people that have purchased “The Yii Book”. The only problem is I had to create the code to do that. Which I now have. And it may even work.

If you’re interested in possibly winning a copy, log into your account. Then click the “Giveaway” link that appears in the navigation sidebar. If you can’t recall your password, use the reset link.

Pesky details of this giveaway…

Continue Reading...

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...