public static function handlers($type = null) {
		$handlers = static::$_handlers + [
			'default' => [
				'view'     => 'lithium\template\View',
				'encode'   => false,
				'decode'   => false,
				'cast'     => false,
				'paths'    => [
					'template' => '{:library}/views/{:controller}/{:template}.{:type}.php',
					'layout'   => '{:library}/views/layouts/{:layout}.{:type}.php',
					'element'  => '{:library}/views/elements/{:template}.{:type}.php'
				]
			],
			'html' => [],
			'json' => [
				'cast' => true,
				'encode' => 'json_encode',
				'decode' => function($data) {
					return json_decode($data, true);
				}
			],
			'text' => ['cast' => false, 'encode' => function($s) { return $s; }],
			'form' => [
				'cast' => true,
				'encode' => 'http_build_query',
				'decode' => function($data) {
					$decoded = [];
					parse_str($data, $decoded);
					return $decoded;
				}
			]
		];

		if ($type) {
			return isset($handlers[$type]) ? $handlers[$type] : null;
		}
		return $handlers;
	}
public static function handlers($type = null) {
		$handlers = static::$_handlers + [
			'default' => [
				'view'     => 'lithium\template\View',
				'encode'   => false,
				'decode'   => false,
				'cast'     => false,
				'paths'    => [
					'template' => '{:library}/views/{:controller}/{:template}.{:type}.php',
					'layout'   => '{:library}/views/layouts/{:layout}.{:type}.php',
					'element'  => '{:library}/views/elements/{:template}.{:type}.php'
				]
			],
			'html' => [],
			'json' => [
				'cast' => true,
				'encode' => 'json_encode',
				'decode' => function($data) {
					return json_decode($data, true);
				}
			],
			'text' => ['cast' => false, 'encode' => function($s) { return $s; }],
			'form' => [
				'cast' => true,
				'encode' => 'http_build_query',
				'decode' => function($data) {
					$decoded = [];
					parse_str($data, $decoded);
					return $decoded;
				}
			]
		];

		if ($type) {
			return isset($handlers[$type]) ? $handlers[$type] : null;
		}
		return $handlers;
	}
public static function handlers ( $ type = null ) { $ handlers = static :: $ _handlers + [ 'default' => [ 'view' => 'lithium\template\View' , 'encode' => false , 'decode' => false , 'cast' => false , 'paths' => [ 'template' => '{:library}/views/{:controller}/{:template}.{:type}.php' , 'layout' => '{:library}/views/layouts/{:layout}.{:type}.php' , 'element' => '{:library}/views/elements/{:template}.{:type}.php' ] ] , 'html' => [ ] , 'json' => [ 'cast' => true , 'encode' => 'json_encode' , 'decode' => function ( $ data ) { return json_decode ( $ data , true ) ; } ] , 'text' => [ 'cast' => false , 'encode' => function ( $ s ) { return $ s ; } ] , 'form' => [ 'cast' => true , 'encode' => 'http_build_query' , 'decode' => function ( $ data ) { $ decoded = [ ] ; parse_str ( $ data , $ decoded ) ; return $ decoded ; } ] ] ; if ( $ type ) { return isset ( $ handlers [ $ type ] ) ? $ handlers [ $ type ] : null ; } return $ handlers ; }
Helper method for listing registered type handlers. Returns all handlers, or the
handler for a specific media type, if requested.

@param string $type The type of handler to return.
@return mixed Array of all handlers, or the handler for a specific type.
Helper method for listing registered type handlers . Returns all handlers or the handler for a specific media type if requested .