private function assignDeclaredLayout($package, $file)
    {
        $file = lcfirst($file);
        if (substr(strtolower($file), -6) == '.phtml') {
            $file = substr($file, 0, -6);
        }

        $package = $this->app->getPackage($package);
        $pathPieces = array($package['package_path'], 'res', 'layout', $file);
        $path = implode(self::DS, $pathPieces) . '.phtml';
        if (file_exists($path)) {
            $this->layoutLocation = $path;
            return true;
        }
        $e = new LayoutFileNotFoundException('Invalid layout file path, expected: "' . $path . '"');
        $e->setAdditionalData('Layout Path Checked: ', $path);
        throw $e;
    }