Download
Osmek Codeigniter Library Documentation
Download includes the Osmek.php library, osmek.php config file, and osmek_helper.php.
Installation
- Upload the config/osmek.php file to your CodeIgniter application/config folder.
- Upload the library/Osmek.php file to your CodeIgniter application/libraries folder.
- Upload the helper/osmek_helper.php file to your CodeIgniter application/helpers folder.
Get the Codeigniter Sample Site
This download includes a sample site built using the codeigniter framework. It includes examples of a Single Entry section, Blog, Photo Gallery, and Events.
Configuration
To start, open config/osmek.php and set your API key. Your API key can be found under the "My Account" section of your Osmek account.
<?php
/*
|---------------------------------------------------------------
| API KEY
|---------------------------------------------------------------
|
| The API key found in the "My Account" section.
|
*/
$config['account_api_key'] = 'APIKEY1234567890';
Text and image caching can also be turned on, but is not required to access Osmek.
Library Reference
See osmek.php documentation for more information on the Osmek library.
Helper Reference
osmek()
Provides a shortcut for calling functions in the Osmek.php library.
osmek(string $method [, $method parameters ])
<?php
echo osmek('fetch_template', 101, '<h1>[title]</h1>[description]', array('limit' => 5));
?>
If you call fetch_template(), osmek() will accept a view as the third parameter.
<?php
echo osmek('fetch_template', 101, 'template-view', array('limit' => 5));
?>