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

CloudWays Blog:
Automate Codeigniter Unit Testing With PHPUnit
Oct 08, 2018 @ 17:08:59

On the CloudWays blog there's a tutorial posted for the CodeIgniter framework users out there showing how to get started with unit testing your application.

Quality assurance is one of the central aspects of software development. In fact, test-driven development is an entire development methodology developed around the concept of integrating quality assurance within the development cycle. However, before discussing how to automate Codeigniter unit testing, I will describe the theoretical basis of unit testing and how it adds value to the Codeigniter projects.

The tutorial starts out by defining what a "unit" is and how testing provides value to your project, making it easier to find issues early on and building in simplicity in its structure. It also talks about some of the limitations of unit testing including the effort involved (and lack or potential gain) and having test code with bugs too. It then starts in on some example tests, showing how to work with configuration objects and built test cases and execute the tests.

tagged: unittest codeigniter tutorial introduction testing

Link: https://www.cloudways.com/blog/codeigniter-unit-testing/

TutsPlus.com:
How to Manage Multiple Applications in CodeIgniter
Nov 28, 2017 @ 16:29:11

The TutsPlus.com site has posted a new tutorial showing the CodeIgniter users out there how to manage multiple sites written using the framework. Traditionally CodeIgniter applications needed to be run as separate instances but their method simplifies the setup by needing only one instance for all.

Today, we’re going to explore how you can manage multiple applications in the CodeIgniter web framework using a single codebase. In the course of that, we’ll go ahead and create two different CodeIgniter applications that will share the core CodeIgniter codebase.

Sharing the core codebase across different applications is not something new as it’s already practiced by different frameworks and open-source systems, and CodeIgniter is no different. It easily allows you to manage multiple applications that share the core CodeIgniter library and API files, and at the same time you could use different databases and site-specific configurations.

The article then starts with some of the benefits of using a multisite setup including simpler maintenance and the ability to use different databases for each. It then gets into the process for creating multiple applications using separate directories under an "applications" directory and creating sample "welcome" content under each. Finally, they make some changes to the configuration to use an environment variable to switch out which front controller (index.php) file to direct the request to (as set up in the web server config).

tagged: manage multiple application codeigniter tutorial website

Link: https://code.tutsplus.com/tutorials/manage-multiple-applications-in-codeigniter--cms-29795

TutsPlus.com:
How to Create Custom Drivers in CodeIgniter
Sep 11, 2017 @ 15: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 @ 16: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 @ 17: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 @ 15: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 @ 15: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 @ 15: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 @ 14: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 @ 14: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/


Trending Topics: