Skip to content

Commit

Permalink
Renamed www folder to public, updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
AliasIO committed Jun 19, 2013
1 parent 3e8b59e commit 28564c9
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 3 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ browser!
If you're running Apache and see "404 Not Found" you will need to enable
rewrites. Alternatively you can navigate to `http:https://<swiftlet>?q=foo`.

*Swiftlet can be invoked from the command line (e.g. to run cron jobs). Simply
run `php index.php -q foo`.*


Routing
-------
Expand Down Expand Up @@ -123,8 +126,8 @@ will throw an exception by default but can be overridden.
The action name and arguments can be accessed through
`$this->app->getAction()` and `$this->app->getArgs()` respectively.

Note: to use a different view for each action you may change the value of
`$this->view->name`. The view name is a filename relative to the `view`
To use a different view for a specific action you may change the value of
`$this->view->name`. The view name is a filename relative to the `views`
directory, without the `.php` suffix.


Expand Down Expand Up @@ -197,7 +200,7 @@ class Foo extends \Swiftlet\Plugin
public function actionAfter()
{
// Overwrite our previously set "helloWorld" variable
if ( get_class($this->controller) === 'Swiftlet\Controllers\Foo' ) {
if ( $this->app->getControllerName() === 'Index' ) {
$this->view->helloWorld = 'Hi world!';
}
}
Expand Down Expand Up @@ -284,6 +287,16 @@ Get a view variable, encoded for safe use in HTML by default
* `set(string $variable [, mixed $value ])`
Set a view variable

* `__set(string $variable [, mixed $value ])`
Magic method to set a view variable

* `get(string $variable [, bool $htmlEncode ])`
Get a view variable, pass `false` as the second parameter to prevent values from
being HTML encoded.

* `__get(string $variable)`
Magic method to get a view variable

* `htmlEncode(mixed $value)`
Recursively make a value safe for HTML

Expand Down
6 changes: 6 additions & 0 deletions Swiftlet/Exception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

namespace Swiftlet;

class Exception extends \Exception
{ }
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions www/index.php → public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

require 'config/main.php';

date_default_timezone_set('UTC');

$app->run();
$app->serve();
} catch ( Exception $e ) {
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 28564c9

Please sign in to comment.