->assert('page', '\d+')
->value('page', '0')
->bind('networkData');
$route->get(
'{repo}/network/{commitishPath}',
function ($repo, $commitishPath) use ($app) {
$repository = $app['git']->getRepositoryFromName($app['git.repos'], $repo);
if ($commitishPath === null) {
$commitishPath = $repository->getHead();
}
list($branch, $file) = $app['util.routing']->parseCommitishPathParam($commitishPath, $repo);
list($branch, $file) = $app['util.repository']->extractRef($repository, $branch, $file);
return $app['twig']->render(
'network.twig',
array(
'repo' => $repo,
'branch' => $branch,
'commitishPath' => $commitishPath,
)
);
}
)->assert('repo', $app['util.routing']->getRepositoryRegex())
->assert('commitishPath', $app['util.routing']->getCommitishPathRegex())
->value('commitishPath', null)