Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions (HMVC), class variables and code completion (NetBeans)
#1

[eluser]Derdiusz[/eluser]
Hi!

I use Modular Extensions (http://codeigniter.com/wiki/Modular_Extensions_-_HMVC/) in my application. And from now I've problems with define local class variables for class - php throws me an error: "Call to a member function .... on a non-object in ...".

My controller class looks like:

Code:
class Start extends MX_Controller
{

/**
* @var CI_Benchmark
*/
var $benchmark;

function Start()
{
parent::MX_Controller();

$this->benchmark->mark('a');

}

}

And when I call a $this->benchmark->mark('a') I've an error but when I remove:
Code:
var $benchmark;
everything works. Works also when I use standard CI classes instead of Modular Extensions.

Code:
Code:
/**
* @var CI_Benchmark
*/
var $benchmark;
is usefull for code completion features of NetBeans and without it work with many custom classes is really difficult.

It looks like a Modular Extensions overwrite base controller class CI_Benchmark with empty var $benchmark...

I also trying to force load a benchmark class ($this->load->library('benchmark')Wink before using any methods from benchmark class - no results Sad

Any solutions for it?

Kind regards
D.




Theme © iAndrew 2016 - Forum software by © MyBB