Skip to content

Commit

Permalink
simplified readme
Browse files Browse the repository at this point in the history
  • Loading branch information
arzynik committed Dec 13, 2015
1 parent a0afa22 commit d02beb0
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,16 @@ Tipsy is an MVW (Model, View, Whatever) PHP micro framework inspired by [Angular

See [Examples](https://github.com/tipsyphp/tipsy/wiki/Examples) for more detailed examples. See [Documentation](https://github.com/tipsyphp/tipsy/wiki) for more information.

#### View Template Example

###### index.php
```php
$app->home(function($Scope, $View) {
$Scope->user = 'Mai Tai';
$View->display('hello');
$app->home(function($View) {
$View->display('index', [user => 'crystal']);
});
```

###### hello.phtml
###### index.phtml
```phtml
<h1>Hello <?=$user?>!</h1>
```

#### API Example

###### index.php

```php
$app->post('drink/:id', function($Params, $Request, $Maitai) {
$Maitai
->load($Params->id)
->serialize($Request->request())
->save();
echo $Maitai->json()
});
```

###### POST /drink/1?rating=5&name=maitai
```
{"id": 1, "name": "maitai", "rating": 5}
<h1>Hello <?=$user?></h1>
```

---
Expand Down

0 comments on commit d02beb0

Please sign in to comment.