Welcome Guest, Not a member yet? Register   Sign In
can not pass varibles to view
#1

the following s my controller code.I new to codeigniter..have no idea...but trying to learn...so my code is below.. can any one please help me find the bug?
PHP Code:
<?php
class Hello extends Controller
{
    var 
$name;
    var 
$color;
    
        
        function 
Hello()
        {
        
            
parent::Controller();
            
$this->name='test';
            
$this->color='red';
        }
     
 
        
function view()
        {
            
$data['name']=$this->name;
            
$data['color']=$this->color;
            
$this->load->view('view',$data);
        }
        
}

?>


my view is

PHP Code:
Hai  <font color="<?= $color ?>" <? $name ?> </font> 
Reply


Messages In This Thread
can not pass varibles to view - by munna - 02-22-2015, 02:55 AM
RE: can not pass varibles to view - by InsiteFX - 02-22-2015, 05:17 AM
RE: can not pass varibles to view - by Avenirer - 02-22-2015, 01:45 PM
RE: can not pass varibles to view - by Muzikant - 02-22-2015, 02:00 PM
RE: can not pass varibles to view - by Muzikant - 02-22-2015, 02:20 PM
RE: can not pass varibles to view - by dbui - 02-22-2015, 02:28 PM
RE: can not pass varibles to view - by dbui - 02-22-2015, 02:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB