Snippets Ideas

Encrypt and decrypt with CodeIgniter

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

Encryption and decryption functions are available in CodeIgniter by using the Encryption class. Of course you can always use PHP functions, but what I say is that CodeIgniter has a specific class for handling some encryption functions.

Everything is explained in the Encryption class, but the first thing you should do is configure your encryption key in config.php.

Then, you can start using for example $this->encrypt->encode() and $this->encrypt->decode().

If you need to handle passwords instead, I’d recommend to visit Handling Passwords in CodeIgniter, by Elliot.

Related searches:

  • codeigniter encryption
  • codeigniter encrypt
  • encrypt codeigniter
  • encryption codeigniter
  • codeigniter encrypt decrypt
  • codeigniter encrypt url
  • encryption key codeigniter
  • codeigniter decrypt
  • codeigniter encryption key
  • codeigniter encrypt password

Using url_title() with Spanish or other strange characters

Posted in Snippets Ideas on March 14th, 2010 by admin – 3 Comments

If you are running your site in Spanish and using url_title to create Permalinks in CodeIgniter then likely you had run in character issues while creating your links.

Martin posted a solution in CodeIgniter’s forum with a workaround for this issue. He proposed


$trans = array(
                    $search                                => $replace,
                    "á"                                    => 'a',
                    "é"                                    => 'e',
                    "í"                                    => 'i',
                    "ó"                                    => 'o',
                    "ú"                                    => 'u',
                    "à"                                    => 'a',
                    "è"                                    => 'e',
                    "ì"                                    => 'i',
                    "ò"                                    => 'o',
                    "ù"                                    => 'u',
                    "ñ"                                    => 'n',
                    "ä"                                    => 'a',
                    "ë"                                    => 'e',
                    "ï"                                    => 'i',
                    "ö"                                    => 'o',
                    "ü"                                    => 'u',
                    "\s+"                                => $replace,
                    "[^a-z0-9".$replace."]"                => '',
                    $replace."+"                        => $replace,
                    $replace."$"                        => '',
                    "^".$replace                        => ''
                   );

My two cents here are the following. You can try to override the URL Helper by extending it in MY_url_helper.php under application/helpers directory.

Related searches:

  • codeigniter url_title
  • codeigniter url_title utf8
  • url_title codeigniter
  • codeigniter url_title javascript
  • url_title()
  • url_title javascript
  • url_title codeigniter utf-8
  • php utf8 url_title
  • codeigniter url_title() javascript
  • arabic url_title() codeigniter

A straightforward way to translate your language files in CodeIgniter

Posted in Snippets Ideas on January 12th, 2010 by admin – 1 Comment

Months ago we discussed about different alternatives to add i18n support to CodeIgniter applications. On this opportunity we will show how easy is to maintain your language files using CodeIgniter Language File Translator by MrKirkland and Owen Christian.

Basically what you need to do is download the zip here and then unpack the files under appropriate location, as explained in the article.

read more »

Related searches:

  • codeigniter convert language file to po
  • codeigniter translation
  • codeigniter i18n javascript
  • codeigniter language translation
  • codeigniter language file translator
  • codeigniter translator
  • translate in codeigniter
  • intniter com/language
  • codeigniter translate urls
  • codeigniter spanish translation

CodeIgniter in Spanish Language

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

CodeIgniter has been translated to many international languages, not only the User Guide but also the messages and errors strings in its language packs.

For example, you can find Spanish translations for your CodeIgniter applications, here. [Make sure to download the right version, ie: 1.7.2]

read more »

Related searches:

  • $config[language] codeigniter
  • application\language\spanish codeigniter
  • codeigniter $config[language]
  • codeigniter languages
  • file language spanish for codeigniter download
  • language error message codeigniter
  • language translator in codeigniter examples
  • select language codeigniter

Get Location Information based on an address, city or country name

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

In our last post we explained how to use GeoIP easily in CodeIgniter. Now we are interested in getting location information from a particular address using a Geocoder tool. For that reason, we’d recommend to take a look over How to use Google Maps API with PHP from Zimuel’s blog.

Zimuel exposes the following scenario:

Scenario: you have to check the validity of the geo data of a list of customers stored into a database. Using the Google Maps API you can easly compare the data stored into your database with the google data and fix the errors.

Moreover, his solution using Google Maps API proposes the following solution.

A PHP class that uses the Google Maps API to provide geographic information from a generic address (city, country, street+city, country. etc.).

read more »

Related searches:

  • $gmap->getinfolocation
  • gmaps place search db
  • google map api with street city country and zipcode provided
  • google maps is empty ie
  • how gmap takes location latitude and longitude
  • how to fetch data by country code in codeigniter
  • how to fetch gmap using zip code
  • php gmap 3 class
  • php gmaps
  • php gmaps search address