Welcome Guest, Not a member yet? Register   Sign In
Using a class that returns an image, how to display the image?
#2

[eluser]Mischievous[/eluser]
Hey Jordan, welcome to the community. The controllers just handles the request. You need to pass the info to a "View" file or echo the image out.

Code:
<?php
class Test extends Controller{

function index(){
header('Content-Type: image/jpg');
$this->load->library('Equalise');
$image = $this->equalise->outputimage($_SERVER['DOCUMENT_ROOT']'/3.jpg');
echo $image;
}

}
?>

Also, make sure your "outputimage" function is returning the image before its destroyed.


Messages In This Thread
Using a class that returns an image, how to display the image? - by El Forum - 04-04-2010, 10:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB