forked from Public/pics
		
	Add Image::getInlineImage method
This commit is contained in:
		
							parent
							
								
									7d82a4a924
								
							
						
					
					
						commit
						52420b8715
					
				@ -67,14 +67,18 @@ class Image extends Asset
 | 
				
			|||||||
		return EXIF::fromFile($this->getPath());
 | 
							return EXIF::fromFile($this->getPath());
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public function getPath()
 | 
						public function getInlineImage($width = null, $height = null, $className = '')
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		return ASSETSDIR . '/' . $this->subdir . '/' . $this->filename;
 | 
							if (isset($width) && isset($height))
 | 
				
			||||||
	}
 | 
								$image_url = $this->getThumbnailUrl($width, $height, false);
 | 
				
			||||||
 | 
							elseif (isset($width))
 | 
				
			||||||
 | 
								$image_url = $this->getThumbnailUrl($width, null, false);
 | 
				
			||||||
 | 
							elseif (isset($height))
 | 
				
			||||||
 | 
								$image_url = $this->getThumbnailUrl(null, $height, false);
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								$image_url = $this->getUrl();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public function getUrl()
 | 
							return '<img class="inline-image ' . $className . '" src="' . $image_url . '" alt="">';
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		return ASSETSURL . '/' . $this->subdir . '/' . $this->filename;
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user