Professional CodeIgniter

(singke) #1

Chapter 10: Launch


306


The same thing goes when checking for cookie support. You ’ ll need just a small bit of code that will try
to set a test cookie with a value (say, the integer 1). If the site can write the cookie and retrieve it OK, then
cookies are supported. If not, display an error message.

< script >
var tcookie = new Date();
check_cookie = (tcookie.getTime() + ‘’);
document.cookie = “check_cookie=” + check_cookie + “; path=/”;
if (document.cookie.indexOf(check_cookie,0) < 0) {
alert(“You will not be able to view this site if cookies are not enabled.
Please enable them now.”);
}
< /script >

Conclusion


Congratulations! The project is now complete, and you know more than enough to continue working
with CodeIgniter fruitfully for many years to come. You ’ ve also learned a great deal about working
within an Agile context, coding iteratively without running yourself into the ground.

Some last parting thoughts on CodeIgniter:

It ’ s sometimes useful to leave third - party integrations (like the Google Checkout example) until
the very end. At other times, you ’ ll need to complete these kinds of integrations well before the
final deadline, as they may need to be thoroughly tested.

Because you ’ re working in an iterative fashion, it also means you can fix things iteratively. Just
apply the same common - sense rules for tackling fixes as you would for tackling any other sprint
backlog item.

It is always possible that your client might contact you in the months after you complete the
project because they have thought of additional functionality that they would like to incorporate
into their site. Working in an Agile way means being open to upgrades and updates after “ going
live ” or “ launching ” a project. In the case of this project, Claudia may want to integrate with a
different checkout process, or she might need more robust CSV import functions. Or she may
come back to you for a look and feel upgrade. Or she may need extra databases. Whatever the
changes might be, analyze what pieces are involved (models, views, controllers) and do the best
work you can.

A good rule to follow when working with CodeIgniter: Seek out a CodeIgniter library or helper
to do what you need first. If you can ’ t find that, seek out a PHP native function (like
number_format ). If you can ’ t find anything there, seek out a third - party solution. Of course,
you can always extend a native CodeIgniter library or helper too. Don ’ t forget to tell the rest of
the community about your extensions!




Free download pdf