|
GetToKnowPhpskeleton
anatomy of an app
app/the developer's domain. models, views, and controllers go here, as well as config.php and routes.php. app/config.phptell the system where your database is, what the root URL of your app is, etc. a good place to start. app/routes.phptell the system your default controller, as well as what URL's map to what actions, controllers, and idents. core/the libraries/classes phpskeleton depends on, including database stuff, hooks, and filters. Shouldn't need to mess around here. helpers/helpers the yummy coating around the core. you can use the framework without them, but they can take care of a lot of tedious stuff. lib/the place for code that neither you or me wrote - libraries for various things your app might need to do. Comes with Textile. assets/statically served CSS stylesheets, JavaScript scripts, and images. AssetHelpers are useful here. index.phpany page accessed through your app, besides assets, comes through here - this is where the action happens. The core, lib, helpers, models, and app helpers are loaded, your controller is initialized, your action is called, and your views are included. Everything's automatic - you won't need to change this. etcsample-htaccess.txt is a sample Apache .htaccess file - rename it .htaccess and set $config['enable_mod_rewrite'] to true in app/config.php, and if you have an Apache server with mod_rewrite, all urls from your application root will be redirected to index.php. All this does is takes the 'index.php' out of your URL's. generate is an experimental script that makes files with empty class definitions for you, just so you don't have to type them yourself. sqlconsole.php is an SQL console - type in some SQL, press run, and see the result. Useful for development and such. Delete it when you put your app up on the web so no one deletes everything in your database... |
Sign in to add a comment