• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Models in PHP4

#1
[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

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

#3
[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

#4
[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

#5
[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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.