Welcome Guest, Not a member yet? Register   Sign In
Call file / class from ThirdParty folder
#1

(This post was last modified: 11-22-2019, 03:44 AM by StefenKhoe.)

Hello, 

guys i have the problem to load file class that i place it at ThirdParty folder,
i try using namescape, require, require_once, include and etc.. but nothing work

example i have this Foo.class
PHP Code:
<?php namespace TP\Tools;

/**
 * 
 */
class Foo
{
    public static function 
check1(){
        echo 
"string";
    }
}

?>

Try to call in

PHP Code:
<?php namespace App\Controllers;

use 
CodeIgniter\Controller;
use 
App\Models\UserModel;
use 
TP\Tools\Foo;

class 
User extends BaseController
{
    private 
$usermodel;

    public function 
__construct()
        {
         $this->usermodel = new UserModel();        
        
}

        public function index(){
        
Foo::check1();
        

is it wrong ? pls advise better way to load another file because i cant find it anywhere at user guide..

Thankyou guys for your help
Reply


Messages In This Thread
Call file / class from ThirdParty folder - by StefenKhoe - 11-21-2019, 07:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB