protected function initializeResolver()
    {
        $extensions = $this->getCompiler()->getExtensions();
        $resolver = $this->resolver = new AggregateResolver();
    
        $stack = array($this->getView()->resolver());
        while ($source = array_shift($stack)) {
            if ($source instanceof AggregateResolver) {
                foreach ($source as $child) {
                    array_push($stack, $child);
                }
            } elseif ($source instanceof TemplatePathStack) {
                foreach ($extensions as $extension) {
                    $child = clone $source;
                    $child->setDefaultSuffix($extension);
                    $resolver->attach($child);
                }
            } else {
                $resolver->attach($source);
            }
        }
    }