Example #1
0
// returns Page 2 and Page 3
$found = $nav->findById('page_2_and_3');
// returns Page 2
$found = $nav->findOneById('page_2_and_3');
// returns Page 2
$found = $nav->findAllById('page_2_and_3');
// returns Page 2 and Page 3
// Find all matching CSS class my-class
$found = $nav->findAllBy('class', 'my-class');
// returns Page 1.2 and Page 2
$found = $nav->findAllByClass('my-class');
// returns Page 1.2 and Page 2
// Find first matching CSS class my-class
$found = $nav->findOneByClasS('my-class');
// returns Page 1.2
// Find all matching CSS class non-existant
$found = $nav->findAllByClass('non-existant');
// returns array()
// Find first matching CSS class non-existant
$found = $nav->findOneByClass('non-existant');
// returns null
// Find all pages with custom property 'foo' = 'bar'
$found = $nav->findAllBy('foo', 'bar');
// returns Page 1 and Page 1.1
// To achieve the same magically, 'foo' must be in lowercase.
// This is because 'foo' is a custom property, and thus the
// property name is not normalized to 'Foo'
$found = $nav->findAllByfoo('bar');
// Find all with controller = 'index'
$found = $nav->findAllByController('index');
// returns Page 2 and Page 3