Today we will talk about how PHP creates objects in memory when performing a statement like $a = new Foo(); and how the references are managed in memory, since this is an issue that can generate discussion and difference of opinions. For that, we are going to talk about what references are NOT in PHP. Finally, we will talk about how the garbage collector works in PHP.
Installing Carabiner in our project
The first thing we need for installing Carabiner in our CodeIgniter project is to download it. We can download it from the CodeIgniter forum. In order to install it, we simply have to place the files “carabiner.php”, “jsmin.php” and “cssmin.php” files into the directory /application/libraries of your project. Once this is done, we have to place the configuration file “carabiner.php” into the directory /application/config. In this file we have to specify the path to the directories that contain our files “.js” and “.css”.
Today we will see how we can create a progress bar file upload in CodeIgniter without the need for libraries or plug-ins made with Flash (like SWFUpload) that are beyond our control, because usually these libraries offer us already compiled .swf files, so we can not change anything in them, just in case we have knowledge of programming in ActionScript 2 or 3.
The jQuery plug-in scrollTo (developed by Ariel Flesler) enables us to make our website to scroll (scrolling the vertical bar) to any item on our document we need, this way we can focus the user’s attention in that element each time the page is reloaded (for example, an entry in the left menu on our website), sparing the user from having to do it manually. On the website of the plug-in project you can find all (or almost all) the documentation that is needed to integrate it into your own project.
Today we are going to fix a bug I found in updating ImageFlow, going from version 1.2.1 to 1.3. The new version is intended to solve, among other things, the problem that was in Internet Explorer when there was only one image in the gallery. The problem was that nothing was showed if only we had a picture in the gallery in IE. Well, version 1.3 already displays the picture if we only have one, but if that image also has a caption, it turns out that the caption is not shown, nor Internet Explorer or any other browser . Well, here is the solution for those wishing to fix the bug (and are brave enough) and want to get their hands on the code of the library.
In this post we will explain a little what it is and how we can use SWFUpload library in our application made with the php framework CodeIgniter, so that, our users can upload their files to the application in an elegant and visual way, and all combined with safety and ease that CodeIgniter offers for uploading files to the server.
What is SWFUpload?
Today we are going to explain how we can send a form via AJAX using jQuery in CodeIgniter, so we avoid to reload the whole page, giving the appearance of “desktop application” to our web application, being able to perform certain actions without reloading the entire page view.
Creating the form
First, we need to create our form. In this case we will create a generic form, where we will add different types of fields to make the example as complete as possible, but functionally not very helpful, mainly for teaching purposes… So in our view file in CodeIgniter we add the following code:
What is ImageFlow and what is it for?
In a previous post I talked about how to use the library PHPMailer to send emails from our website without having our own mail server running on the machine. This time we will go a step further and explain how to integrate this library in our CodeIgniter project and not die in the attempt.
The first thing we do, if we have not done it yet, will be to download the library. Once we unzip the library, we can rename the folder named PHPMailer and move it to the folder /system/application/libraries (for CodeIgniter 1.7.3 or previous) or to the folder /application/libraries/ (for CodeIgniter 2.0 or later) in our CodeIgniter application. Once we did it so, we can start to implement our own library, which will be in charge of including PHPMailer into our application. To do this we have to create a new PHP file in the CodeIgniter’s library directory called my_phpmailer.php. In this file we will write the following code: