Pop\Nav\Nav::returnFalse PHP Метод

returnFalse() публичный Метод

Set the return false flag
public returnFalse ( boolean $return ) : Nav
$return boolean
Результат Nav
    public function returnFalse($return)
    {
        $this->returnFalse = (bool) $return;
        return $this;
    }

Usage Example

Пример #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));
 }