# autoptimize/1.5/classes/autoptimizeHTML.php

Autoptimize, version 1.5. 45 lines.

- Page: https://pluginprobe.com/plugins/autoptimize/1.5/code/classes/autoptimizeHTML.php
- Raw: https://pluginprobe.com/plugins/autoptimize/1.5/raw/classes/autoptimizeHTML.php
- Modified: 2009-07-26T04:33:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/autoptimize/1.5/code/classes/autoptimizeHTML.php#L10-L20`.

```php
<?php

class autoptimizeHTML extends autoptimizeBase
{
	private $keepcomments = false;
	
	//Does nothing
	public function read($options)
	{
		//Remove the HTML comments?
		$this->keepcomments = (bool) $options['keepcomments'];
		
		//Nothing to read for HTML
		return true;
	}
	
	//Joins and optimizes CSS
	public function minify()
	{
		if(class_exists('Minify_HTML'))
		{
			//Minify html
			$options = array('keepComments' => $this->keepcomments);
			$this->content = Minify_HTML::minify($this->content,$options);
			return true;
		}
		
		//Didn't minify :(
		return false;
	}
	
	//Does nothing
	public function cache()
	{
		//No cache for HTML
		return true;
	}
	
	//Returns the content
	public function getcontent()
	{
		return $this->content;
	}
}

```
