how to create image in view

thread: 3 messages  |  last: a year ago  |  started: wednesday, june 9, 2010, 9:31 pm pdt


#1  |  kingwithin (San Francisco, CA) United States of America
Wednesday, June 9, 2010, 9:31 PM PDT

Is there the equivalent to the image_tag in rails to pull an image with the appropriate mockup?

#2  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Wednesday, June 9, 2010, 10:15 PM PDT

Not really sure what image_tag does... but Qcodo has QImageControl allowing you to render out (and resize if needed) images outside of your docroot to deliver to the webuser.

Check out the Examples Page on QImageControl for more info.

#3  |  romcart (Redding, CA) United States of America Qcodo Core Contributor
Wednesday, June 9, 2010, 10:40 PM PDT

You should be able to replicate the functionality of rails image_tag pretty easily by adding something like this in your QApplication.class.php:

public static function ImageTag($strFilename) {
    echo sprintf('<img src="%s/%s" border="0" />', __IMAGE_ASSETS__, $strFilename);
}

Then in your template:

QApplication::ImageTag('my_mockup.jpg');


Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.