lithium\template\view\Renderer::handlers()

public method

Gets or adds content handlers from/to this rendering context, depending on the value of $handlers. For more on how to implement handlers and the various types, see applyHandler().

Parameters

  • mixed $handlers

    If $handlers is empty or no value is provided, the current list of handlers is returned. If $handlers is a string, the handler with the name matching the string will be returned, or null if one does not exist. If $handlers is an array, the handlers named in the array will be merged into the list of handlers in this rendering context, with the pre-existing handlers taking precedence over those newly added.

Returns

mixed

Returns an array of handlers or a single handler reference, depending on the value of $handlers.

Source

	public function handlers($handlers = null) {
		if (is_array($handlers)) {
			return $this->_handlers += $handlers;
		}
		if (is_string($handlers)) {
			return isset($this->_handlers[$handlers]) ? $this->_handlers[$handlers] : null;
		}
		return $this->_handlers;
	}