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

If we're on page/foo, and content is that page, you can use {% is page|current %}class='active'{% endif %}
public current ( Content | array $content ) : boolean
$content Bolt\Legacy\Content | array
Результат boolean True if the given content is on the curent page.
Пример #1
0
 public function testCurrentFalse()
 {
     $app = $this->getApp();
     $app->flush();
     $this->addDefaultUser($app);
     $this->addSomeContent();
     $request = (new Request())->create('/gum-tree/koala');
     $request->query->set('_route_params', ['zone' => 'frontend', 'slug' => 'koala', 'contenttypeslug' => 'gum-tree']);
     $app['request'] = $request;
     $handler = new RecordHandler($app);
     $content = ['slug' => 'clippy'];
     $result = $handler->current($content);
     $this->assertFalse($result);
 }