Welcome Guest, Not a member yet? Register   Sign In
Ancillary Classes in CI4
#3

(This post was last modified: 07-30-2020, 03:13 AM by psreejiths.)

(07-29-2020, 02:58 AM)InsiteFX Wrote: There is no CI 4 get_instance like CI 3 it's all OOP now.

Helpers are load by an array anywhere or by the array in the BaseController.
How to call the controller function or model function inside a  particular helper function?

function allcustomers($x)
{
$ci =& get_instance();
$customer_datas=$ci->invoice_model->getallcustomers($x);
echo "<select id='customer' name='customer' class='form-control required' required>";
echo '<option value="">Please Select</option>';
foreach($customer_datas as $listcustomer)
{
echo "<option value='$listcustomer[customer_id]'>$listcustomer[customer_name]</option>";
}
echo "</select>";
}
Reply


Messages In This Thread
Ancillary Classes in CI4 - by psreejiths - 07-29-2020, 01:20 AM
RE: Ancillary Classes in CI4 - by InsiteFX - 07-29-2020, 02:58 AM
RE: Ancillary Classes in CI4 - by psreejiths - 07-30-2020, 03:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB