mkoh.net beta!

Lähdekoodi

Lähdekoodi tiedostolle: '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 '';
		}
	}
}

Kommentit

Ei kommentteja, mikset kirjoittaisi ensimmäistä?

Kommentoi

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