Welcome Guest, Not a member yet? Register   Sign In
create a new object CI4
#1

Goodmorning everyone,
i am using codeigniter version 4 rc3.
I would like to create a model object for CI3 compatibility.

PHP Code:
<?php namespace App\Controllers;

use 
App\Models\MO_Home;

class 
Home_1 extends BaseController
{
    
    
function __construct(){
        
        $model
= new stdObject();
        $this->model->MO_Home = new MO_Home(); 

usage
PHP Code:
public function index()
 {
    echo $this->model->MO_Home->call_function(); 

It gives me error in creating the object.

Thank you
Reply


Messages In This Thread
create a new object CI4 - by gra - 02-08-2020, 04:28 AM
RE: create a new object CI4 - by mjamilasfihani - 02-08-2020, 08:23 AM
RE: create a new object CI4 - by gra - 02-08-2020, 08:52 AM
RE: create a new object CI4 - by gra - 02-08-2020, 02:59 PM
RE: create a new object CI4 - by jreklund - 02-09-2020, 03:05 AM
RE: create a new object CI4 - by gra - 02-10-2020, 09:53 PM
RE: create a new object CI4 - by InsiteFX - 02-11-2020, 04:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB