Page MenuHomeIsabelle/Phabricator
Diviner Phabricator Tech Docs AphrontSideNavFilterView

final class AphrontSideNavFilterView
Phabricator Technical Documentation ()

Provides a navigation sidebar. For example:

$nav = new AphrontSideNavFilterView();
$nav
  ->setBaseURI($some_uri)
  ->addLabel('Cats')
  ->addFilter('meow', 'Meow')
  ->addFilter('purr', 'Purr')
  ->addLabel('Dogs')
  ->addFilter('woof', 'Woof')
  ->addFilter('bark', 'Bark');
$valid_filter = $nav->selectFilter($user_selection, $default = 'meow');

Tasks

Managing Children

  • protected function canAppendChild() — Test if this View accepts children.
  • final public function hasChildren() — Test if an element has no children.
  • private function reduceChildren($children) — Reduce effectively-empty lists of children to be actually empty. This recursively removes `null`, `''`, and `array()` from the list of children so that @{method:hasChildren} can more effectively align with expectations.

Other Methods

config

  • public function setUser($user) — Deprecated, use @{method:setViewer}.
  • protected function getUser() — Deprecated, use @{method:getViewer}.

1

  • final protected function renderChildren() — Produce children for rendering.

Methods

public function setViewer($viewer)
Inherited

AphrontView

Set the user viewing this element.

Parameters
PhabricatorUser$viewerViewing user.
Return
this

public function getViewer()
Inherited

AphrontView

Get the user viewing this element.

Throws an exception if no viewer has been set.

Return
PhabricatorUserViewing user.

public function hasViewer()
Inherited

AphrontView

Test if a viewer has been set on this element.

Return
boolTrue if a viewer is available.

public function setUser($user)
Inherited

AphrontView

Deprecated, use setViewer().

Parameters
PhabricatorUser$user
Return
wild

protected function getUser()
Inherited

AphrontView

Deprecated, use getViewer().

Return
wild

protected function canAppendChild()
Inherited

AphrontView

Test if this View accepts children.

By default, views accept children, but subclases may override this method to prevent children from being appended. Doing so will cause appendChild() to throw exceptions instead of appending children.

Return
boolTrue if the View should accept children.

final public function appendChild($child)
Inherited

AphrontView

Append a child to the list of children.

This method will only work if the view supports children, which is determined by canAppendChild().

Parameters
wild$childSomething renderable.
Return
this

final protected function renderChildren()
Inherited

AphrontView

Produce children for rendering.

Historically, this method reduced children to a string representation, but it no longer does.

Return
wildRenderable children.

final public function hasChildren()
Inherited

AphrontView

Test if an element has no children.

Return
boolTrue if this element has children.

private function reduceChildren($children)
Inherited

AphrontView

Reduce effectively-empty lists of children to be actually empty. This recursively removes null, '', and array() from the list of children so that hasChildren() can more effectively align with expectations.

NOTE: Because View children are not rendered, a View which renders down to nothing will not be reduced by this method.
Parameters
list<wild>$childrenRenderable children.
Return
list<wild>Reduced list of children.

public function getDefaultResourceSource()
Inherited

This method is not documented.
Return
wild

public function requireResource($symbol)
Inherited

This method is not documented.
Parameters
$symbol
Return
wild

public function initBehavior($name, $config)
Inherited

This method is not documented.
Parameters
$name
$config
Return
wild

public function willRender()
Inherited

AphrontView

Inconsistent, unreliable pre-rendering hook.

This hook may fire before views render. It is not fired reliably, and may fire multiple times.

If it does fire, views might use it to register data for later loads, but almost no datasources support this now; this is currently only useful for tokenizers. This mechanism might eventually see wider support or might be removed.

Return
wild

public function render()

This method is not documented.
Return
wild

public function producePhutilSafeHTML()
Inherited

This method is not documented.
Return
wild

public function setMenuID($menu_id)

This method is not documented.
Parameters
$menu_id
Return
wild

public function getMenuID()

This method is not documented.
Return
wild

public function __construct()

This method is not documented.
Return
this//Implicit.//

public function addClass($class)

This method is not documented.
Parameters
$class
Return
wild

public function setCrumbs($crumbs)

This method is not documented.
Parameters
PHUICrumbsView$crumbs
Return
wild

public function getCrumbs()

This method is not documented.
Return
wild

public function setIsProfileMenu($is_profile)

This method is not documented.
Parameters
$is_profile
Return
wild

public function getIsProfileMenu()

This method is not documented.
Return
wild

public function setActive($active)

This method is not documented.
Parameters
$active
Return
wild

public function setFlexible($flexible)

This method is not documented.
Parameters
$flexible
Return
wild

public function setCollapsed($collapsed)

This method is not documented.
Parameters
$collapsed
Return
wild

public function setWidth($width)

This method is not documented.
Parameters
$width
Return
wild

public function getMenuView()

This method is not documented.
Return
wild

public function addMenuItem($item)

This method is not documented.
Parameters
PHUIListItemView$item
Return
wild

public function getMenu()

This method is not documented.
Return
wild

public function addFilter($key, $name, $uri, $icon)

This method is not documented.
Parameters
$key
$name
$uri
$icon
Return
wild

public function addButton($key, $name, $uri)

This method is not documented.
Parameters
$key
$name
$uri
Return
wild

public function newLink($key)

This method is not documented.
Parameters
$key
Return
wild

private function addThing($key, $name, $uri, $type, $icon)

This method is not documented.
Parameters
$key
$name
$uri
$type
$icon
Return
wild

public function addCustomBlock($block)

This method is not documented.
Parameters
$block
Return
wild

public function addLabel($name)

This method is not documented.
Parameters
$name
Return
wild

public function setBaseURI($uri)

This method is not documented.
Parameters
PhutilURI$uri
Return
wild

public function getBaseURI()

This method is not documented.
Return
wild

public function selectFilter($key, $default)

This method is not documented.
Parameters
$key
$default
Return
wild

public function getSelectedFilter()

This method is not documented.
Return
wild

public function appendFooter($footer)

This method is not documented.
Parameters
$footer
Return
wild

public function getMainID()

This method is not documented.
Return
wild

private function renderFlexNav()

This method is not documented.
Return
wild