Powered by SmartDoc

An example: displaying an image file

CKImage can display resource files as image. Do setting the following to display an image file (cgikit.png) in ImagePage of Examples.

<番号リスト-1->move resourcesdirectory to path enables displaying images.

  1. set path of the resource directory for resourceattribute of CKAppication.
  2. set the image file name for file attribute of CKImage.

<リストタイトル>move resourcesdirectory

[localhost:/var/www/cgi-bin/Examples] user% mv resources ../../htdocs

<リストタイトル>set path of resourcesdirectory (Example.cgi)

app = CKApplication.new
app.web_server_resources = '../../htdocs/resources'

<リストタイトル>set an image file name of fileattribute (ImagePage.ckd)

FileInResource : CKImage {
  alt  = "File in resource direcory";
  file = "cgikit.png";

This is an example to display static an image file. CKImage can display dinamically using with dataattribute.