CodeIgniter Forums

Full Version: Models in PHP4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]nirbhab[/eluser]
Hello all,
My code:
Code:
<?php echo $this->SiteModules->SiteModules_var;?>
<!--this code in views-->
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined property: SiteModules

Filename: views/template.php

Line Number: 2
controller constructor:
Code:
function Welcome()
    {
        parent::Controller();
        $this->load->model('SiteModules','SiteModules',true);    
    }
OS: Windows

El Forum

[eluser]nirbhab[/eluser]
If call the syntax in controller, than also i am getting the same error.

El Forum

[eluser]nirbhab[/eluser]
RESOLVED

Code:
$CI =& get_instance();
Even this is not working, instead i used,
Code:
$this->CI = new CI_Base();

Guys please help me, whole application has to be build in php4

El Forum

[eluser]Gavin Blair[/eluser]
try keeping the model calls in the controller? i've never had to have a view talk to a model, it seems to go against MCV

El Forum

[eluser]nirbhab[/eluser]
See MVC is different thing here, but when we are talking about concepts, It should work,in fact....it is running fine on php5, i have tried every possible, things i could. Controller, Views....
But it is not working....any buddy has tried running models in php 4.4.8, Apache 1.3 and mysql 4.
Guys My CI Libraries are doing great, and has solved my problem to all extends, but why my models are not working? i am not getting this.