- Premium Data
- Getting Started
- 51Degrees.php Config
- Using the Detector
- Advanced Usage
- Accessing Metadata
- Image Optimiser
- Client Side Overrides
- Passing Properties To Client Side
- User Performance Monitoring
- Usage Sharing
- Automatic Data Updates
- Advanced Suggestions
This guide covers how to configure the 51Degrees Code Igniter plugin. See the installation guide for installation instructions.
To using 51Degrees Data in your CodeIgniter project a few lines of code are required that import the plugin then extract the $_51d data array. This example will welcome your site visitors with a message that changes depending on whether they are using a mobile or non-mobile device.
1. With the module installed into you CodeIgniter environment, go to your "views" directory, by default this will be in "your_website/public_files/application/views", and open the file "welcome_message.php" for editing. Towards the bottom of this page you will find the welcome message that reads "Welcome to Codeigniter".
2. To produce the custom message we will simply replace the line
With this piece of code you have a simple dynamic welcome message for your visitors.
This is example is an extremely simple example of what can be done use 51Degrees Device Detector. To see how to get more data from the $_51d array see Using the Detector .