Welcome Guest, Not a member yet? Register   Sign In
loading images in a view
#1

[eluser]junaids[/eluser]
hi..i have problem loading images to a view.
most of code i m using is a copy fromforum

here the controller
Code:
$data['css'] = $this->css;
          $data['base'] = $this->base;
        $Event_id = $this->uri->segment(3, 0);
  
        if (($Event_id !== NULL) && (is_numeric($Event_id)))
        {
        $validevent = $Event_id;
        $eventdata = $this->eventsmodel->geteventdata($validevent);
        $data['eventdata'] = $eventdata;
        //Load page contents into template
        $this->load->view('viewevent', $data);

now i can load the css in the view like
Code:
<link href="<?php echo "$base/$css"; ?>" rel="stylesheet" type="text/css" />

but can not include any images. i have the code
Code:
<img src="$base/images/logo.gif" alt="" title="" width="176" height="111">

any idea how to do it?
#2

[eluser]JoostV[/eluser]
There are no php tags around $base. Tried this?
Code:
<img src="&lt;?php echo $base; ?&gt;/images/logo.gif" alt="Place your alt text here" title="" width="176" height="111">




Theme © iAndrew 2016 - Forum software by © MyBB