Gc\Component\Navigation::useActiveBranch PHP Method

useActiveBranch() public method

Constructor, initialize documents
public useActiveBranch ( boolean $boolean = null ) : mixte
$boolean boolean Set the branch is active or only one page
return mixte
    public function useActiveBranch($boolean = null)
    {
        if ($boolean === null) {
            return $this->useActiveBranch;
        }
        $this->useActiveBranch = (bool) $boolean;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testRenderWithChildrenActivePageOnTheForthDocument()
 {
     Registry::get('Application')->getRequest()->getUri()->setPath('/url-key/children-key/second-child-key');
     $this->object = new Navigation();
     $this->object->useActiveBranch(true);
     $array = $this->object->render();
     $this->assertTrue(count($array) > 0);
 }