Skip to content

Commit

Permalink
Make use of url generation via Routing.
Browse files Browse the repository at this point in the history
End of part 4.
  • Loading branch information
Toon Ketels committed May 27, 2012
1 parent 70f4524 commit af1ec4c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

Use Symfony\Component\Routing;
use Symfony\Component\Routing;

$routes = new Routing\RouteCollection();
$routes->add('hello', new Routing\Route('/hello/{name}', array('name' => 'Wold')));
Expand Down
10 changes: 9 additions & 1 deletion src/pages/bye.php
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
Goodbye sir.
<p>Goodbye sir.</p>

<?php
use Symfony\Component\Routing;
$generator = new Routing\Generator\UrlGenerator($routes, $context);
$link = $generator->generate('hello', array('name' => 'Toon'), TRUE);
?>

<p><a href="<?php echo $link; ?>">Say hi to Toon</a></p>

0 comments on commit af1ec4c

Please sign in to comment.