Mercurial > hg > Members > shoshi > webvirt
view app/controllers/icon_controller.php @ 3:7201fd354bdf
added icon features , default icon
author | Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 14 Aug 2011 23:52:31 +0900 |
parents | |
children | c3adb28473d6 |
line wrap: on
line source
<?php class IconController extends AppController { public $name = "icon"; public $autoRender = false; public $uses = null; public function index() { $icon_dir = "../icon"; //relative path without slash $this->autoRender = false; $icon_default = "/default.png"; //file name must include slash $icon_file = $icon_default; if(isset($this->params["url"]["uuid"])){ $icon_file = "/".$this->params["url"]["uuid"]."png"; } $icon = @file_get_contents($icon_dir.$icon_file); if($icon === FALSE){ //failed to get icon $icon = file_get_contents($icon_dir.$icon_default); } header("Content-Type: image/png"); print($icon); } public function EditIcon() { } public function SaveIcon() { } } ?>