public function generateLayout($layout)
    {
        $layout = Inflector::toDirectorySeparator($layout);

        $file = $this->getViewTemplatePath().$layout.DS.$this->viewLayoutName();
        $appViewPath = '';
        $appViewPath = $this->command->applicationDir.DS.'Views'.DS;

        $this->hasDirectory($appViewPath);
        $this->hasDirectory($appViewPath.'layouts');
        $this->hasDirectory($appViewPath.DS.$layout);

        file_exists($file) or die("Base layout stub file doesn't exists in Cygnite Core");

        $layoutFile = $appViewPath.$layout.DS.$this->viewLayoutName();

        if ($this->layoutType == 'php') {
            $layoutFile = str_replace('.stub', EXT, $layoutFile);
        } else {
            $layoutFile = str_replace('.stub', '.twig', $layoutFile);
        }

        if (file_exists($layoutFile)) {
            echo "\n Layout file already exists in $layoutFile directory \n";

            return true;
        }

        /*read operation ->*/
        // Open the file to get existing content
        $fileContent = file_get_contents($file);

        $handle = null;

        $handle = fopen($layoutFile, 'w') or die('Cannot open file:  '.$layoutFile);

        fwrite($handle, $fileContent);
        fclose($handle);
    }