Clean up options documentation, order.

This commit is contained in:
Justin Hileman
2012-11-28 20:28:03 -08:00
parent 1792140afa
commit 2e97db3fc0
+11 -11
View File
@@ -47,13 +47,17 @@ class Mustache_Engine
* Passing an $options array allows overriding certain Mustache options during instantiation:
*
* $options = array(
* // The class prefix for compiled templates. Defaults to '__Mustache_'
* // The class prefix for compiled templates. Defaults to '__Mustache_'.
* 'template_class_prefix' => '__MyTemplates_',
*
* // A cache directory for compiled templates. Mustache will not cache templates unless this is set
* 'cache' => dirname(__FILE__).'/tmp/cache/mustache',
*
* // A Mustache template loader instance. Uses a StringLoader if not specified
* // Override default permissions for cache files. Defaults to using the system-defined umask. It is
* // *strongly* recommended that you configure your umask properly rather than overriding permissions here.
* 'cache_file_mode' => 0666,
*
* // A Mustache template loader instance. Uses a StringLoader if not specified.
* 'loader' => new Mustache_Loader_FilesystemLoader(dirname(__FILE__).'/views'),
*
* // A Mustache loader instance for partials.
@@ -75,12 +79,8 @@ class Mustache_Engine
* return htmlspecialchars($buffer, ENT_COMPAT, 'UTF-8');
* },
*
* // Character set for `htmlspecialchars`. Defaults to 'UTF-8'
* // Character set for `htmlspecialchars`. Defaults to 'UTF-8'. Use 'UTF-8'.
* 'charset' => 'ISO-8859-1',
*
* // Override default permissions for cache files. Defaults to using the system-defined umask. It is
* // *strongly* recommended that you configure your umask properly rather than overriding permissions here.
* 'cache_file_mode' => 0666,
* );
*
* @param array $options (default: array())
@@ -95,6 +95,10 @@ class Mustache_Engine
$this->cache = $options['cache'];
}
if (isset($options['cache_file_mode'])) {
$this->cacheFileMode = $options['cache_file_mode'];
}
if (isset($options['loader'])) {
$this->setLoader($options['loader']);
}
@@ -122,10 +126,6 @@ class Mustache_Engine
if (isset($options['charset'])) {
$this->charset = $options['charset'];
}
if (isset($options['cache_file_mode'])) {
$this->cacheFileMode = $options['cache_file_mode'];
}
}
/**