mkoh.net beta!

Source

Source for: 'library/MkohZf/View/Helper/ImageUrl.php'


<?php
class MkohZf_View_Helper_ImageUrl 
{
	private $view;
	
	public function setView($view)
	{
		$this->view = $view;
	}
	
	public function imageUrl($path, $resizetype = 'thumb', Array $options = Array())
	{
		try {
			
			$image = new MkohZf_Image(
				ROOT_PATH.'/data/images_original',
				ROOT_PATH.'/html/images_cached'
			);
			// @todo: include lightbox js here instead of main tpl
			$path = $image->getResized($path, $resizetype);
			$path = $this->view->baseUrl().'/images_cached'.DIRECTORY_SEPARATOR.$path;
			return $path;
			
		} catch(MkohZf_Exception $e) {
			return '';
		}
	}
}

Comments

No comments, why not write one?

Add a comment

  _____    _    _    ______      ___     _    _     _____   
 /  ___|| | || | || |      \\   / _ \\  | || | ||  |  ___|| 
| // __   | || | || |  --  //  | / \ || | || | ||  | ||__   
| \\_\ || | \\_/ || |  --  \\  | \_/ || | \\_/ ||  | ||__   
 \____//   \____//  |______//   \___//   \____//   |_____|| 
  `---`     `---`   `------`    `---`     `---`    `-----`