Installation and first controller

Installation and first controller

Create a minimum of your vhost

ServerName phpway
DocumentRoot /var/www/phpway/public

If vhost is installed succesfully framework will ask you to create and give writable permissins to log file.

touch /var/www/phpway/public/../log/development.log
chmod 777 /var/www/phpway/public/../log/development.log

Now, edit config/routes.php file and add first route to your controlelr. On default action is index. In our example we will create default controller.

$this->map->connect(array (
        "*" => array (
                "controller" => "default",
        )
));

Then creata default controller, you can do it manually but we will generate using exising script.

$ php ./script/generate.php controller default index
         exists app/controllers/
         create app/controllers/default_controller.php
         exists app/helpers/
         create app/helpers/default_helper.php
         exists app/views/
         create app/views/default/
         create app/views/default/index.phtml

And here you go, in app/controler directory you should find default_controller.php file with index action in it. Print some thing out in action

<?php class DefaultController extends AppController {

        function index() {
                echo "here";
        }
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>