Last active
December 18, 2015 12:29
-
-
Save peterfox/5783073 to your computer and use it in GitHub Desktop.
A template for wrapping third party libraries that need to be used inside the framework but aren't compatible with the typical parameters required
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
//Load this class with $this->load->library('CI_Something', $data, 'something'); | |
require_once dir(__FILE__).'/Something/Something.php'; | |
class CI_Something extends Something | |
{ | |
public function __construct($config) | |
{ | |
$expected = array('arguement1', 'arguement2', 'arguement3') | |
get_instance()->load->helper('array'); | |
$config = elements($expected, $config); | |
parent::__construct($config['arguement1'], $config['arguement2'], $config['arguement3']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment