protected function renderIcon(array $item)
    {
        static $rendered = array();

        if (isset($rendered[$item['extension']])) {
            return $rendered[$item['extension']];
        }

        $template = "file_manager|icons/ext/{$item['extension']}";

        if ($item['type'] === 'dir') {
            $template = 'file_manager|icons/dir';
        }

        $data = array('item' => $item);
        $default = $this->controller->render('file_manager|icons/file', $data);
        $rendered[$item['extension']] = $this->controller->render($template, $data, true, $default);

        return $rendered[$item['extension']];
    }