Pop\Nav\Nav::returnFalse PHP Method

returnFalse() public method

Set the return false flag
public returnFalse ( boolean $return ) : Nav
$return boolean
return Nav
    public function returnFalse($return)
    {
        $this->returnFalse = (bool) $return;
        return $this;
    }

Usage Example

Exemplo n.º 1
0
 public function testReturnFalse()
 {
     $_SERVER['REQUEST_URI'] = '/first';
     $tree = array(array('name' => 'First Nav Item', 'href' => '#', 'children' => array(array('name' => 'First Child', 'href' => '/first/first-child'), array('name' => 'Second Child', 'href' => '/first/second-child'))));
     $n = new Nav($tree);
     $this->assertFalse($n->isReturnFalse());
     $n->returnFalse(true);
     $this->assertTrue($n->isReturnFalse());
     $this->assertContains('onclick="return false;"', $n->render(true));
 }