public function generateControllerTemplate()
    {
        $controllerTemplate = ($this->viewType == 'php') ?
            'Php'.DS.'Controller'.EXT :
            $this->controllerTemplateName();
        $file = $this->getControllerTemplatePath().$controllerTemplate;

        $this->formPath = str_replace('Controllers\\', '', $this->getControllerTemplatePath()).DS.'Form'.DS;

        file_exists($file) or die('Controller Template not Exists');
        //file_exists($modelFl ) or die("No Model Exists");

        /*read operation ->*/
        $this->filePointer = fopen($file, 'r');
        $content = fread($this->filePointer, filesize($file));
        //fclose($tmp);

        $content = $this->replaceControllerName($content);
        $content = str_replace('{%Apps%}', APP_NS, $content);
        $primaryKey = $this->controllerCommand->table()->getPrimaryKey();

        $content = str_replace('{%primaryKey%}', $primaryKey, $content);
        $content = str_replace('%modelColumns%', $this->getDbCode().PHP_EOL, $content);

        $content = str_replace('%ControllerName%Form', $this->controller.'Form', $content);

        $formTemplatePath = null;
        $formTemplatePath = str_replace('Controllers', '', $this->formPath);

        if (file_exists($formTemplatePath.'Form'.EXT)) {
            //We will generate Form Component
            $formContent = file_get_contents($formTemplatePath.'Form'.EXT, true);
        } else {
            die("Form template doesn't exists in ".$formTemplatePath.'Form'.EXT.' directory.');
        }

        $formContent = str_replace('%controllerName%', $this->controller, $formContent);
        $formContent = str_replace('{%formElements%}', $this->getForm().PHP_EOL, $formContent);
        $this->generateFormComponent($formContent);

        $newContent = $this->replaceModelName($content);
        $content = null;

        $this->replacedContent = $newContent;
    }