-
Notifications
You must be signed in to change notification settings - Fork 10
Getting Started
Devin Smith edited this page Dec 12, 2015
·
5 revisions
See Installation for more information.
composer require tipsyphp/tipsy
use Tipsy\Tipsy;
$tipsy = new Tipsy;
Routes can be closures, classes, or class instances. Here we create a route using a closure, and assign the internal $Scope and $View properties.
$tipsy->router()
->when('/', function($Scope, $View) {
$Scope->user = 'Devin';
$View->display('home');
});
All views are PHTML View Templates. Create a file called home.phtml
<div class="content">
<h1>Welcome <?=$user?>!</h1>
</div>
Once you have defined your stuff you can start the process like below.
$tipsy->run();
For more detailed examples see Examples.
- Home
- Getting Started
- Server Config
- Installation
- Installing Composer
- App
- Route Shorthand
- Config
- Routes
- Methods
- Controller Types
- Params & Regex
- Aliases
- Dependency Injection
- Advanced Routing
- Services
- User Defined Services
- Built in Services
- Middleware
- Views
- Templates
- Scope
- Resource
- Factory
- Looper
- Examples
- Plugins
- About