Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

TutsPlus.com:
How to Create Custom Drivers in CodeIgniter
Sep 11, 2017 @ 10:36:54

On the TutsPlus.com site there's a new tutorial posted showing you how to create custom drivers in a CodeIgniter application. In this case the "drivers" are what lefts the application work with external technology or services.

The best way to understand the concept of drivers is to look at how caching is implemented in the core CodeIgniter framework. The main Cache class acts as a parent class and extends the CI_Driver_Library class. On the other hand, you'll end up finding child classes for APC, Memcached, Redis and the like, implemented as pluggable adapters. The child classes extend the CI_Driver class instead of the main driver class.

[...] Creating a custom driver in the CodeIgniter application is the aim of today's article. In the course of that, we'll go through a real-world example that creates a MediaRenderer driver used to render the media from different services like YouTube, Vimeo and similar. The different services will be implemented in the form of adapter classes.

He starts by listing the files that he'll be creating along the way and where they need to be located in the application structure. He then starts in on the configuration changes required and the contents of the files. He then walks through the code for each of them briefly explaining how they work. He starts with the drivers then moves to the adapters and, finally, how to put them together to make a functional renderer for either Vimeo our Youtube videos.

tagged: tutorial codeigniter custom driver video media renderer

Link: https://code.tutsplus.com/tutorials/how-to-create-custom-drivers-in-codeigniter--cms-29339

TutsPlus.com:
How CodeIgniter's Hook System Works
Aug 25, 2017 @ 11:49:13

The TutsPlus.com site has a tutorial posted that introduces you to CodeIgniter's hook system and details how it all works. The tutorial goes through each hook already included and shows how to create a custom one to fit your needs.

As a CodeIgniter developer, sometimes you end up in a situation that requires you to alter the core of the framework or the execution flow to fulfill your custom requirements. Of course, it's never recommended to modify the core files as it makes the upgrade process cumbersome. Luckily, the CodeIgniter framework comes with the hooks system, which allows you deal with this scenario.

In this article, we'll start with an introduction to the hooks system in the CodeIgniter framework. Then, we'll discuss the different types of hooks available. And finally, we'll grab this opportunity to explore the creation of custom hooks.

They start with an overview of the hooks system and what kind of functionality it offers to the developer. The article then goes through each of the default ones built in to the framework including system hooks, controller hooks and "overrides" hooks. It then finishes off with a look at creating a custom hook and how to add it into the system for use across the application.

tagged: codeigniter system hook tutorial introduction custom

Link: https://code.tutsplus.com/tutorials/how-codeigniter-hook-system-works--cms-29301

TutsPlus.com:
Pagination in CodeIgniter: The Complete Guide
Aug 15, 2017 @ 12:07:18

In this new tutorial posted to the TutsPlus.com site author Sajal Soni shares "the complete guide" to handling pagination in a CodeIgniter framework application using built-in tooling included with the framework.

The benefit of using any full-stack web application framework is that you don't have to worry about the common tasks like input handling, form validation and the like, as the framework already provides wrappers for those features. Thus, it allows you to concentrate on the business logic of the application rather than reinventing the wheel over and over again.

Today, we're going to explore an important library in the CodeIgniter framework—the pagination library.

The tutorial walks you through three main things: the basics of the pagination functionality, options you can use to customize it and the configuration options available for the component. Each section comes with code and configuration examples showing how to use the component.

tagged: pagination codeigniter tutorial options configuration example

Link: https://code.tutsplus.com/tutorials/pagination-in-codeigniter-the-complete-guide--cms-29030`

NetTuts.com:
CodeIgniter Form Validation: From Start to Finish
Jul 06, 2017 @ 10:53:12

The NetTuts.com site has a new tutorial posted covering form validation in CodeIgniter "from start to finish" showing you how to use the built-in functionality to verify the information coming from your users.

As a web application developer, form validation is a crucial part of your work, and it should not be underrated as it could lead to security flaws in your application. You should consider it a must if you're striving to provide a professional end user experience.

In this article, we'll go through the built-in form validation library in the CodeIgniter framework. Here are the highlights of today's article: [The use of ] basic form validation, cascading and prepping, custom error messages, custom validation callback, and validation configuration

They start off by covering some of the basic included rules using a simple controller and view. These checks include values being required, maximum length of text, alphanumeric only, valid email and checking that the value is a valid IPv4 address. The example also shows how to make use of the "cascading" rules and using the rules system to "prep" the data first. They walk through each line of the code that defines the rules talking about what it does and how they can be adjusted to fit your needs. They cover more in-depth how cascading and prepping work, how to customize error messages and create custom callback validation rules you can apply along with the standard ones.

tagged: codeigniter tutorial validation introduction cascade prep data custom message

Link: https://code.tutsplus.com/tutorials/codeigniter-form-validation-from-start-to-finish--cms-28768

Nate Krantz:
How I'm Writing Unit / Functional Tests
May 22, 2015 @ 10:50:42

In a recent post Nate Krantz has shared some of his own methods around writing functional and unit tests.

So...testing. That thing that everyone says is so important but you don't really learn about it in school. I've had some trials and tribulations with testing so I'm going to just dump out some thoughts here.

He starts with a bit of background on his own experiences in development and how he finally decided that testing would "solve everything". He started with unit tests (for a CodeIgniter application) and how he got them up and running. He talks about issues he found around dependencies (and static methods) and how he made use of mocks to reduce some of the issues with dynamic loading, at least how CodeIgniter does it. Unfortunately, this didn't work out as planned so he fell back to a test database and create more effective and simpler functional tests. Code examples are sprinkled through out the post to show how he was trying to solve the problem at different points in the process.

tagged: unittest functionaltest opinion experience codeigniter

Link: http://www.natekrantz.com/why-test-driven-development-rocks-sucks/

Three Devs & A Maybe Podcast:
Three Devs and a Aimee
Jan 19, 2015 @ 09:17:21

The Three Devs and a Maybe podcast has released their latest episode of their show - episode #54, Three Devs and a Amiee with hosts Michael Budd, Fraser Hart, Lews Cains and Edd Mann.

It is the first show of the new year! In this weeks episode we first reflect on how our holiday breaks went, and what happened to Edd's face?! Fraser's move up to Greenwich is next discussed, including how useful the taxi app 'Uber' is. We then move on to talk about Mick's experiences compiling Apache and PHP from source, along with CodeIgniter's decision to maintain 5.2 support. This leads on to conversation about the upcoming PHP UK Conference, along with tuning queries for the database query planner. Finally, we highlight the differences between Apache and nginx, along with their use of PHP-FPM.

Other topics mentioned include:

You can listen to this latest show either through the in-page audio player or by downloading the mp3 to listen whenever. If you enjoy the show, be sure to subscribe to their feed too.

tagged: threedevsandamaybe podcast ep54 holiday apache codeigniter phpuk nginx phpfpm

Link: http://threedevsandamaybe.com/three-devs-and-a-aimee/

Three Devs & A Maybe Podcast:
The PHP-FIG/RFC, CodeIgniter 3 and PyroCMS with Phil Sturgeon
Jun 16, 2014 @ 09:42:13

The Three Devs & A Maybe podcast has released a new episode, #29 - The PHP-FIG/RFC, CodeIgniter 3 and PyroCMS with Phil Sturgeon with (obviously) guest Phil Sturgeon.

This week we are lucky to have the one n' only Phil Sturgeon on the show. Starting off conversation with how he got into programming, we move on to his time using and contributing to the CodeIngiter and FuelPHP projects. This leads us on to discuss the current status of CodeIgniter 3.0 and his experiences with porting PyroCMS to Laravel. Among other things we then touch upon the 'Wordpress positive feedback loop', the PHP-FIG (Framework Interop Group) and the PHP-RFC (Request for Comments) process. We wrap up the show with some sound and interesting advice to any budding/new developer.

Besides Phil's own background and PyroCMS they also talk about CodeIgniter, PHP: The Right Way, methods on primitive types and PHPBridge. You can listen to this episode either using the in-page player or by downloading the mp3. You can also subscribe to their feed for this and other great shows.

tagged: threedevsandamaybe podcast ep29 phpfig rfc codeigniter philsturgeon

Link: http://threedevsandamaybe.com/posts/the-php-fig-rfc-codeigniter-3-and-pyrocms-with-phil-sturgeon/

Three Devs & A Maybe Podcast:
Delving into CodeIgniter
Apr 10, 2014 @ 09:22:55

The Three Devs and a Maybe podcast has released their latest episode today - Episode #19, "Delving into CodeIgniter. The show, hosted by Michael Budd, Fraser Hart, Lewis Cains and Edd Mann continues their look into web application frameworks.

In this weeks show we continue our discussion on web application frameworks by delving into CodeIgniter. Though it has had its fair share of bad press over the past couple of years, its mature code-base and ease of getting started can not be denied. Initially exploring what the framework is from a high-level we move on to discuss it's strengths and weaknesses along with personal experiences. We finally wrap up the show with a CodeIgniter influenced quiz.

Other technology mentioned includes jQuery Unveil, D3.js, the Hearbleed bug and Guzzle. You can listen to this latest episode either by downloading the mp3, using the in-page player or by subscribing to their feed.

tagged: threedevsandamaybe podcast ep19 codeigniter web framework

Link: http://threedevsandamaybe.com/posts/delving-into-codeigniter/

NetTuts.com:
Building a CodeIgniter Web Application From Scratch - Part 1
Aug 27, 2013 @ 11:42:02

NetTuts.com has started up a new tutorial series perfect for those wanting to get into PHP frameworks for modern hybrid (PHP backend, Javascript frontend) applications. This is the first part of their series introduces you to the technologies they'll be using and helps you get the basics setup.

In this series we’re going to build a web billboard application from scratch, we’re going to use CodeIgniter to handle the back-end service and BackboneJS for the web client. In the first two parts of the series we’ll create the back-end service and then the client application in the last two.

They walk you through the steps to to set up a MongoDB to handle the data for the backend and configuring CodeIgniter to work with it. He helps you get it set up to handle REST requests from the BackboneJS frontend too (including OPTIONS handling). He shows how to parse the input and handle the output as well as models to connect to the database resources and how to handle sessions.

tagged: codeigniter tutorial series backbonejs mongodb framework

Link: http://net.tutsplus.com/tutorials/php/building-a-codeigniter-web-application-from-scratch-part-1/

Lingohub.com:
Internationalization How To for the 5 most popular PHP frameworks
Jul 24, 2013 @ 10:15:31

On the Lingohub site there's a new post showing how internationalization (i18n) is handled in 5 major PHP frameworks - CodeIgniter, CakePHP, Zend Framework Symfony and Yii.

As discussed in the previous articles on PHP internationalization, PHP provides native support for string translation using gettext and PHP arrays. These can be used in any PHP project. Additionally, some popular PHP frameworks offer their own way of string translation. In this article, I want to provide a brief summary of the internationalization process with five of the most popular PHP frameworks currently out there. In this How-To you will read about using CodeIgniter, CakePHP, Zend, Yii and Symphony.

There's only a bit of sample code here, so it's not a complete tutorial for all of them. Mostly its links to more information about how each framework does things - modules used, formats and configurations.

tagged: framework i18n internationalization howto codeigniter zendframework symfony cakephp

Link: http://blog.lingohub.com/2013/07/internationalization-how-to-5-most-popular-php-frameworks