That's the way I do it (at least for 404 templates):

In app/config/routing.yml append:

#always in last position
#------------&gt;
nonexistent_route:
    path:     /{url}
    defaults: { _controller: ACMEDemoBundle:Default:wrongRoute}
    requirements:
        url: ".+"    
#&lt;-----------


The Controller:

namespace ACME\DemoBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class DefaultController extends Controller
{
    ...

    public function wrongRouteAction($url)
    {
        $user = $this-&gt;get('security.context')-&gt;getToken()-&gt;getUser();

        return $this-&gt;render('TwigBundle:Exception:error404.html.twig', array("user" =&gt; $user, "url" =&gt; $url));

    }
}


And in your twig template app/Resources/TwigBundle/views/Exception/error404.html.twig you can access {{ user }}

Symfony 2 and Twig custom error page
I've designed a few PCB's now, but never put much thought into good practices. They were small boards and most of the emphasis was put into just making sure everything that needed to be connected was connected.

Now I want to get more serious into making well designed boards. I've designed and redesigned my current project multiple times trying to come up with a good looking layout. 

This project is based around the ATXMega256 mCU running on a 16Mhz crystal, around 60 total components and 7 or 8 of them being IC's.

For my next redesign, I plan on giving "Manhattan Routing" a go to at least try and help with crazy traces going every which way - but that's a little bit off topic.

The problem I seem to run into the most is understanding an appropriate method of running power to each IC. Normally, I would just daisy chain them but that is said to be a bad practice.

Here are my questions relating to feeding power


I've heard of the "Star Configuration" where all the IC's tie directly into the regulator but haven't seen a real life example of that so I'm not sure how to design that into my projects. It sounds like a mess of traces coming off of one pad in my mind. Can you post an example of a well designed Star Configuration?
What would be some advantages and disadvantages of using the star configuration as opposed to a power plane, other than the obvious of power being everywhere with a plane.
When is it ok or not ok to use a plane for VCC, specifically for a 2 layer board as I've heard that it's not as common on a 2 layer board?
If I shouldn't use a power plane, which is better in the case of traces needing to cross each other: using via's for GPIO or via's for power?
If it is ok to use a power plane on a 2 layer board, should VCC be on the top layer or bottom, obviously I would have a Ground plane as well.


I know there isn't a win/win answer to these questions because every project is going to be different and require different planning, but I think the basic concept behind it should be somewhat universal that people follow. You have to know the rules before you can break them.

I also realize that these questions may be beyond the scope of online discussion, but I'm looking for more general answers that can help push me in the right direction.
