Welcome Guest, Not a member yet? Register   Sign In
about image
#1

[eluser]jmorty[/eluser]
how can i come up with the image in my template?
every time i try to do this $this->load->view('main'); the image are gone and not include in loading the templates.

How to load image together with the template?

can anyone help me? please!!!!
im new in codeigniter.
#2

[eluser]hqhdn[/eluser]
You should use:

$data['image'] = 'image.jpg' //Link to your image
$this->load->view('main',$data);

At the main.php

echo '<img src="'.$image.'">';
#3

[eluser]jmorty[/eluser]
Somethings wrong...
i try this

$data['image'] = 'title.jpg'; //Link to your image

$this->load->view('main',$data);

main.php

echo $image;

but it only load the word "title.jpg" not the image named title.jpg
#4

[eluser]tardyace[/eluser]
Code:
echo '<img src="'.$image.'" />';
#5

[eluser]saidai jagan[/eluser]
Code:
$data['image'] = base_url().'/image/title.jpg'; //Link to your image
#6

[eluser]jmorty[/eluser]
error show in loading image Fatal error: Call to undefined function base_url() in C:\xampp\htdocs\codeigniter\system\application\controllers\welcome.php on line 25


is base_url() is already set on codeigniter or do i nid to create that function?

please anyone help me, this is my last prob.

tnx




Theme © iAndrew 2016 - Forum software by © MyBB