background preloader

Codeigniter

Facebook Twitter

Philsturgeon/codeigniter-restserver - GitHub. Video: Set up a REST API with CodeIgniter | Blog | Phil Sturgeon. MySQL: Created & Modified Date Fields « Joe Gornick. DeIgniter Base Classes: Keeping it DRY | Blog | Phil Sturgeon. Most applications in CodeIgniter will have various types of pages. The public frontend, a backend admin panel, perhaps some sort of moderator or staff panel, etc. Logic for these types of pages is normally copied between all of their different Controllers which means, for example, if the way the admin area protection is handled is changed there will be lots of Controllers to change and test.

This logic can instead be shared by some creative extending of the Controller class to create custom Base Controllers like Public_Controller, Admin_Controller, etc. WTF are you talking about? The idea is that most of your controllers share something in common with each other. Wicked! The first step is to create these Base Controllers. application/core/MY_Controller.php MY_Controller is a basic core library extension. All we have done here is create a base class that all of our Controllers and "controller types" will inherit. Application/core/Public_Controller.php application/core/Admin_Controller.php. Video for Everybody! Video for Everybody is simply a chunk of HTML code that embeds a video into a website using the HTML5 <video> element, falling back to Flash automatically without the use of JavaScript or browser-sniffing.

It therefore works in RSS readers (no JavaScript), on the iPhone / iPad (don’t support Flash) and on many browsers and platforms. Thanks to the rapid adoption of HTML5 video happening right now, Video for Everybody isn’t the only solution around. It is not a neatly packaged, fully-featured solution for those unfamiliar with HTML. VfE is for developers who either want something really simple they can quickly use on their blog or websites, or as a good starting point to develop their own custom solution.

How It Works If your browser supports it, HTML5 video is used. If HTML5 video is not supported, Adobe Flash is used. Finally, if all else fails, a placeholder image is shown and the user can download the video using the links provided. VfE The Code Here follows the full source code. Using. Working with RESTful Services in CodeIgniter. CodeIgniter is becoming well known for its power as a PHP based web application framework, but it's not often that we see examples of it being used for anything else. Today we'll learn how we can use CodeIgniter to create a RESTful API for your existing web applications, and demonstrate how to interact with your own API or other RESTful web-services, such as Facebook and Twitter.

Program: CodeIgniter, CodeIgniter REST server and CodeIgniter REST client Difficulty: MediumEstimated Completion Time: 30 minutes If you have been following the CodeIgniter From Scratch series you will know by now that it is relatively quick and easy to put together simple web applications, such as blogs, CMS systems, brochure sites, etc. One thing you may not have thought about is using CodeIgniter to create an interactive API. This tutorial is broken down into two parts. Firstly you need to download the codeigniter-restserver code from GitHub and extract it and move the code to your server. Tank Auth authentication library for CodeIgniter. A Quick Code Igniter and JQuery Ajax Tutorial | Michael Forbes – Online Experience Engineer. This tutorial assumes a basic working knowledge of Code Igniter. If you have never used CI before, please refer to the framework documentation In the old days (2 years ago), working the Javascript magic to create a cool AJAX based event took a fairly decent working knowledge of the mechanisms behind the process.

With the increasing popularity of Javascript libraries however, this type of functionality became available to the web site hobbyist, and was made much easier for the web site professional. The following step-by-step tutorial will show you how to combine the power of JQuery (a javascript library that weighs in at about 20k) with Code Igniter (a PHP framework based on the MVC design pattern) to quickly and painlessly pass a record ID through the javascript and over to the server, where it will be passed to a mysql database, used to retrieve some data, and sent back to the page for display.

Step 2: Next, youll use the JQuery function load, and attach it to your content div: Step 4. Ci + jquery. I just use “load” with Code Igniter’s site_url() function. Here’s the javascript (after loading in jQuery of course): $(document).ready(function() { $("#submitit").click(function() { Here’s the form and ajax div: <form action="<? This degrades nicely - if javascript is disabled, it loads the “loadinfo” function of the “ajax” controller, otherwise it loads the “ajaxloadinfo” function of the controller. It took me a long time to figure this out, since there are not many good tutorials on how to use jQuery’s load function with Code Igniter (and the ones that do exist don’t have many examples).

Hope this helps! Unit Testing for Codeigniter - Hasitha's Ramblings.