Skip to content

Commit

Permalink
Explain autoload_controller user defined function in README
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrice Luraine committed Oct 9, 2010
1 parent 56b8a38 commit d7a66f1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
15 changes: 15 additions & 0 deletions README.mkd
Expand Up @@ -145,6 +145,21 @@ Functions called by routes can be written anywhere before the execution of the
This folder location can be set with the `controllers_dir` option.

option('controllers_dir', dirname(__FILE__).'/other/dir/for/controllers');


You can also define `autoload_controller` function to load controllers in your own way:

function autoload_controller($callback)
{
# If $callback, the callback function defined in matching route,
# begins with 'admin_', then we load controllers from
# the admin sub-directory in the controllers directory.
# Else we load controllers the normal way from 'controllers_dir'.
$path = option('controllers_dir');
if(strpos($callback, "admin_") === 0) $path = file_path($path, 'admin');
require_once_dir($path);
}

### Url rewriting ###

Expand Down
9 changes: 4 additions & 5 deletions TODO
Expand Up @@ -22,21 +22,19 @@
- write tests for content_for()
- refactor content_for()
- content_for() write small doc (README) and examples
- adding an option('display_errors'); by default ini_set('display_errors', 0) in production env, but enabled if env is dev (unless matching option is enabled)
- explain autoload_controller() in README
- in debug output, formating debug_backtrace to be me readable (like debug_backtrace output but with extra informations that can be toggled)
- adding tests with special characters for request_uri
- complete CHANGES file
- adding support for extra GET variables in all url styles like in rails (http://groups.google.fr/group/limonade/browse_thread/thread/f9402fb0a3b1f65c)

- improve security in render_file with a safe_dir option
- adding contributors/thanks in AUTHORS
- new redirect_to (support for https)
- adding an option('display_errors'); by default ini_set('display_errors', 0) in production env, but enabled if env is dev (unless matching option is enabled)
- in debug output, formating debug_backtrace to be me readable (like debug_backtrace output but with extra informations that can be toggled)
- public API documentation:
- tests: tag private functions
- tests: describe in docblock header abstract definitions
- add links in header/welcome page(blank.tpl): project web site (clic on logo?), README, github


## And always ##

- more unit and functional tests
Expand All @@ -46,6 +44,7 @@

- implement user agent detection option in routing


Documentation:

- reformat code comments in order to use Natural docs (http://www.naturaldocs.org/)
Expand Down

0 comments on commit d7a66f1

Please sign in to comment.