system/libary/console.php
/**
     * Create Controller
     *
     * @param string $controller
     * @return string
     */
Create Controller
@param string $controller
@return string
Create Controller @param string $controller @return string
private function createController($controller)
    {
        $isDir          = strpos($controller, '/');
        if ($isDir) {
            $parts      = explode('/', $controller);
            $class      = end($parts);
            array_pop($parts);
            $namespace  = 'app\\controller\\' . implode('\\', $parts);
        } else {
            $namespace  = 'app\\controller';
            $class      = $controller;
        }
        $location   = 'app/controller/' . $controller . '.php';
        if (file_exists($location)) {
            return $this->getColoredString('Controller zaten mevcut:', 'red') . "\t" . $this->getColoredString($location);
        } else {
            $file       = fopen ($location, 'w');
            $content    = "<?php\nnamespace $namespace;\n\nuse view;\n\nclass $class\n{\n\n\tpublic function index()\n\t{\n\t\t\n\t}\n\n}";
            fwrite ($file, $content);
            fclose($file);
            return $this->getColoredString('Controller basariyla olusturuldu: ', 'light_blue') . "\t" . $this->getColoredString($location);
        }
    }
private function createController ( $ controller ) { $ isDir = strpos ( $ controller , '/' ) ; if ( $ isDir ) { $ parts = explode ( '/' , $ controller ) ; $ class = end ( $ parts ) ; array_pop ( $ parts ) ; $ namespace = 'app\\controller\\' . implode ( '\\' , $ parts ) ; } else { $ namespace = 'app\\controller' ; $ class = $ controller ; } $ location = 'app/controller/' . $ controller . '.php' ; if ( file_exists ( $ location ) ) { return $ this -> getColoredString ( 'Controller zaten mevcut:' , 'red' ) . " \t " . $ this -> getColoredString ( $ location ) ; } else { $ file = fopen ( $ location , 'w' ) ; $ content = " <?php \n namespace  $ namespace ; \n \n use view; \n \n class  $ class \n { \n \n \t public function index() \n \t { \n \t \t \n \t } \n \n } " ; fwrite ( $ file , $ content ) ; fclose ( $ file ) ; return $ this -> getColoredString ( 'Controller basariyla olusturuldu: ' , 'light_blue' ) . " \t " . $ this -> getColoredString ( $ location ) ; } }
Create Controller
 @param string $controller
 @return string
Create Controller @param string $controller @return string