I am trying to integrate the textlocal sms api if i pass three at the time of load library it's not working.
Error: Too few arguments to function Textlocal::__construct(), 1 passed and at least 2 expected
I have one Setupfile.php Library as following.
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Setupfile {
function send($number, $message)
{
$ci = & get_instance();
$data=array("username"=>'xyz',"hash"=>'abc','apiKey'=>false);
$sender = "xyz";
$numbers = array($number);
$ci->load->library('textlocal', $data); //passing paramenters
}
}
and another Textlocal.php library as follows:
class Textlocal
{
function __construct($username, $hash, $apiKey = false) //get into this function
{
$this->username = $username;
$this->hash = $hash;
if ($apiKey) {
$this->apiKey = $apiKey;
}
}
}