Welcome Guest, Not a member yet? Register   Sign In
Casting variable to my class
#1

(This post was last modified: 10-12-2018, 11:46 AM by omid_student.)

Hi
I have two class in php file
Below code is my php file
There are no problem in this code
My only problem is PHPStorm cannot show class fields
But when i delcare example $user = new user(); and when i use $user-> , PHPStorm show fields
I need casting variable to user class to show field when i try use this class

PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

class 
Test extends CI_Controller
{

 
   function __construct()
 
   {
 
       parent::__construct();
 
   }

 
   function index() {

 
       $this->db->select('first_name,last_name');
 
       $user_c  $this->db->get('user')->row(0,'user');
 
       echo $user_c->first_name;

 
   }

}

class 
user {
 
   var $first_name;
 
   var $last_name;


This picture is when i use class directly
   

And this picture when i use only variable
   
Reply




Theme © iAndrew 2016 - Forum software by © MyBB