Snippets Ideas

How to get current URL in CodeIgniter

Posted in Snippets Ideas on June 6th, 2011 by admin – Be the first to comment

If you want to get the current URL in CodeIgniter then you can use uri_string from URI Class.

$this->uri->uri_string()

Related searches:

  • codeigniter current url
  • codeigniter get current url
  • current_url codeigniter
  • codeigniter current_url
  • codeigniter currenturl
  • current_url() codeigniter
  • current_url() how to use codeigniter
  • get current url in codeigniter
  • google
  • ci getcurrenturl

link_tag in CodeIgniter 2.0

Posted in Snippets Ideas on June 2nd, 2011 by admin – Be the first to comment

link_tag is an interesting helper function introduced recently in CodeIgniter that helps you build link HTML tags to include CSS files but also feeds or favicons in a header.

The helper function documentation is quite explanatory and you can see it here.

In particular, if you are planning to use a similar function for Javascript files, please check this forum post. A custom helper function that helps using the same approach but for JS files instead.

But if you want to go one step ahead, also notice that you can get a performance improvement by combining external resources in one single file. In CodeIgniter you can also do that, for example using the approach to combine JS and CSS files.

Related searches:

  • codeigniter link_tag
  • link_tag codeigniter & different location
  • link_tag codeigniter
  • link_tag ci
  • codeigniter favicon
  • link_tag
  • link_tag in codeigniter
  • link_tag in codeigniter example
  • link_tag javascript codeigniter
  • link_tag() in ci

Import CSV file into database using CodeIgniter

Posted in Snippets Ideas on July 14th, 2010 by admin – Be the first to comment

CSVReader is a library for CodeIgniter that can help you importing CSV files into database using CodeIgniter framework. The library uses fgetcsv function from PHP to get the content from CSV file and then iterates over the records returning an array as result.

Then, you can iterate the parsed results from the CSV file to insert them into the database easily using a foreach statement. For example, you can refer to Clooner’s proposal here.

This CSVReader library can be really helpful in case you need to import large CSV files into the database using a CodeIgniter application, but also can be useful to import Excel files into the database or any other database file that can be exported to CSV. For Excel, you can export the results using comma separated values and then use this approach.

Related searches:

  • codeigniter import csv
  • codeigniter csv import
  • codeigniter CSV
  • import csv codeigniter
  • codeigniter upload csv
  • csv import codeigniter
  • csv codeigniter
  • codeigniter csvreader
  • codeigniter read csv
  • csvreader codeigniter

Using MD Image to resize and crop an Image

Posted in Snippets Ideas on July 1st, 2010 by admin – Be the first to comment

MD_Image is a CodeIgniter Library that allows you to resize and crop images in CodeIgniter keeping a desired ratio. You can see the original thread here.

read more »

Related searches:

  • codeigniter image resize and crop
  • codeigniter image resize
  • codeigniter resize and crop
  • codeigniter image crop and resize
  • codeigniter upload image and resize ajax
  • codeigniter crop image
  • resize imagen con jquery codeigniter
  • upload image codeigniter ajax
  • image cropping in codeigniter
  • how to upload profile picture with codeigniter

Gravatars using CodeIgniter

Posted in Snippets Ideas on May 28th, 2010 by admin – Be the first to comment

If you want to display avatar images in your CodeIgniter application, you can use this Gravatar helper that contains a simple function to retrieve the Gravatar image source for a given email.

The Gravatar helper was created by Dave_C as mentioned in Codeigniter Forums.

By using this helper you can easily integrate your application with Gravatars like this:

codeigniter-gravatars

How to use the helper?

Follow the installation steps described here, and then just load the helper as usual and put this code in your view page passing the desired email as first parameter.

<?php echo gravatar( "you@domain.com" ); ?>

Related searches:

  • gravatar codeigniter