Installation & Setup
-
Download the framework and extract it to your workspace area. Your directory structure should be as follows:
- From the command line, navigate to your scripts directory, and run the AppBuilder script by typing "php buildapp"
-
This will create the basic scaffolding needed for your project. At a top level, you should now have the following folders:
-
Next you'll need to provid some minimal configuration in adroit.conf.php.
- The constant WEB_ROOT should be set to the location of your applications webroot in relation to the servers webroot. Most setups will simply require "/", however, in developement it is common to have many applications located under your servers root.
- If your application requires a database, set the appropriate values in the Adroit::$config['db'] section
- You may setup your session data to be stored in the database by setting Adroit::$config['sessionDB'] to true
- While in developement, you may set Adroit::$config['debugging'] to true to enable errors and notices to be reported
-
Running buildapp setup the project scaffolding, along with some default files to get your application running. In your webroot directory, an .htaccess file was created that routes all incoming requests (except for static files like images and javascript) to an index.php file. Along with those, a generic controller was created, app/controller/Index.controller.php, and some basic view templates located in the app/view directory.
-
Once finished, open your application in your browser and you should see the following dull, boring screen:
-
The request is getting mapped to the IndexController class located in the app/controller/Index.controller.php file. In that class, the indexAction is being called, which simply sets the message 'Adroit app created' for the view to display. For more information on Controllers visit the Controller section.
-
The view for this request is located at app/view/index/index.tpl. It is rendered into a default layout template, base.tpl, located in app/view/layouts. Adroit utilizes the Smarty template engine to render the views. For more information on views, visit the View section.