Skip to content

Commit

Permalink
Update README files with current default options, session and flash f…
Browse files Browse the repository at this point in the history
…eatures
  • Loading branch information
Fabrice Luraine committed Aug 5, 2009
1 parent c2849af commit d87f108
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 23 deletions.
1 change: 0 additions & 1 deletion CHANGES
Expand Up @@ -4,7 +4,6 @@

* [FIXED] flash features: now works only with html output [#21 state:resolved]


[2009-07-31: VERSION 0.4.1]

* [NEW] support for HEAD requests [#12 state:resolved]
Expand Down
45 changes: 34 additions & 11 deletions LISEZMOI.mkd
Expand Up @@ -311,17 +311,40 @@ Vous pouvez l'utiliser pour gérer les options propres à Limonade mais aussi de
Les options utilisées par Limonade ont par défaut les valeurs suivantes:

option('root_dir', $root_dir); // le dossier qui contient le fichier de lancement de l'application
option('limonade_dir', dirname(__FILE__).'/'); // dossier contenant le fichier prinicipal limonade.php.
option('public_dir', option('root_dir').'/public/');
option('views_dir', option('root_dir').'/views/');
option('controllers_dir', option('root_dir').'/controllers/');
option('lib_dir', option('root_dir').'/lib/');
option('env', ENV_PRODUCTION);
option('debug', true);
option('encoding', 'utf-8');
option('x-sendfile', 0); // 0: disabled,
// X-SENDFILE: for Apache and Lighttpd v. >= 1.5,
// X-LIGHTTPD-SEND-FILE: for Apache and Lighttpd v. < 1.5
option('base_path', $base_path);
option('base_uri', $base_uri); // à spécifier si vous utiliser l'url rewriting.
option('limonade_dir', dirname(__FILE__).'/'); // dossier contenant le fichier principal limonade.php
option('limonade_views_dir', dirname(__FILE__).'/limonade/views/');
option('limonade_public_dir',dirname(__FILE__).'/limonade/public/');
option('public_dir', $root_dir.'/public/');
option('views_dir', $root_dir.'/views/');
option('controllers_dir', $root_dir.'/controllers/');
option('lib_dir', $root_dir.'/lib/');
option('error_views_dir', option('limonade_views_dir'));
option('env', ENV_PRODUCTION);
option('debug', true);
option('session', LIM_SESSION_NAME); // true, false or the name of your session
option('encoding', 'utf-8');
option('x-sendfile', 0); // 0: disabled,
// X-SENDFILE: for Apache and Lighttpd v. >= 1.5,
// X-LIGHTTPD-SEND-FILE: for Apache and Lighttpd v. < 1.5

## Sessions ##

Une session démarre automatiquement par défaut. Vous puvez ensuite accéder aux variable des session comme d'habitude avec le tableau `$_SESSION`.

Vous pouvez désactiver les sessions avec l'option `session`

[voir un exemple de code](http://gist.github.com/159327)

### Flash ###

Flash est une fonctionnalit particulière des sessions. Une valeur flash sera disponible pour la preochaine requête puis effacée. Cette fonctionnalité est particulièrement utile pour l'affiche des erreurs de retours après la soumission d'un formulaire ou pour notifier l'utilisateur du bon déroulement d'une action.

* `flash($name, $value...)` définit une valeur flash pour la prochaine requête
* dans les vues HTML, vous pouvez accéder aux valeurs flash disponible grâce au tableau `$flash` ou à la fonction `flash_now($name)`.

[voir un exemple de code](http://gist.github.com/162680)

## Helpers ##

Expand Down
45 changes: 34 additions & 11 deletions README.mkd
Expand Up @@ -324,17 +324,40 @@ You can use it to manage Limonade options and your own custom options in your ap
Default Limonade options have the following values:

option('root_dir', $root_dir); // this folder contains your main application file
option('limonade_dir', dirname(__FILE__).'/'); // this folder contains limonade.php main file
option('public_dir', option('root_dir').'/public/');
option('views_dir', option('root_dir').'/views/');
option('controllers_dir', option('root_dir').'/controllers/');
option('lib_dir', option('root_dir').'/lib/');
option('env', ENV_PRODUCTION);
option('debug', true);
option('encoding', 'utf-8');
option('x-sendfile', 0); // 0: disabled,
// X-SENDFILE: for Apache and Lighttpd v. >= 1.5,
// X-LIGHTTPD-SEND-FILE: for Apache and Lighttpd v. < 1.5
option('base_path', $base_path);
option('base_uri', $base_uri); // set it manually if you use url_rewriting
option('limonade_dir', dirname(__FILE__).'/'); // this fiolder contains the limonade.php main file
option('limonade_views_dir', dirname(__FILE__).'/limonade/views/');
option('limonade_public_dir',dirname(__FILE__).'/limonade/public/');
option('public_dir', $root_dir.'/public/');
option('views_dir', $root_dir.'/views/');
option('controllers_dir', $root_dir.'/controllers/');
option('lib_dir', $root_dir.'/lib/');
option('error_views_dir', option('limonade_views_dir'));
option('env', ENV_PRODUCTION);
option('debug', true);
option('session', LIM_SESSION_NAME); // true, false or the name of your session
option('encoding', 'utf-8');
option('x-sendfile', 0); // 0: disabled,
// X-SENDFILE: for Apache and Lighttpd v. >= 1.5,
// X-LIGHTTPD-SEND-FILE: for Apache and Lighttpd v. < 1.5

## Sessions ##

Session starts automatically by defaut. Then you can access session variables like you use to do, with `$_SESSION` array.

You can disable sessions with the `session` option.

[see snippet example](http://gist.github.com/159327)

### Flash ###

Flash is a special use of sessions. A flash value will be available only on next request and will be deleted after. It's very useful to raise errors on a form or to notice a successful action.

* `flash($name, $value...)` defines a flash for the next request
* in views, you can get current flash values with the `$flash` array or `flash_now($name)` function.

[see snippet example](http://gist.github.com/162680)

## Helpers ##

Expand Down

0 comments on commit d87f108

Please sign in to comment.