forked from slimphp/Slim-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
186 lines (166 loc) · 7.27 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
---
layout: default
title: Slim Framework
description: Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
---
<header class="site-header">
<div class="site-title"><a href="/">Slim</a></div>
<div class="site-slogan">a micro framework for PHP</div>
</header>
<div class="row">
<div class="col-md-12">
<p class="lead">
Slim is a PHP micro framework that helps you quickly write simple
yet powerful web applications and APIs.
</p>
<pre class="language-php"><code><?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require 'vendor/autoload.php';
$app = new \Slim\App;
$app->get('/hello/{name}', function (Request $request, Response $response, array $args) {
$name = $args['name'];
$response->getBody()->write("Hello, $name");
return $response;
});
$app->run();</code></pre>
</div>
</div>
{% include nav.html %}
<div class="row section">
<div class="col-md-12">
<h1 class="divider"><span>Download & Install</span></h1>
<p>
We recommend you install the Slim Framework with the
<a href="https://getcomposer.org/" target="_blank">Composer</a>
dependency manager.
</p>
<p>The easiest way to start working with Slim is to create a project using
<a href="https://github.com/slimphp/Slim-Skeleton">Slim-Skeleton</a> as a base
by running this bash command:</p>
<pre><code class="language-bash">$ php composer.phar create-project slim/slim-skeleton [my-app-name]</code></pre>
<p>Replace <code>[my-app-name]</code> with the desired directory name for your new application. </p>
<p>You can then run it with PHP's built-in webserver:</p>
<pre><code class="language-bash">$ cd [my-app-name]; php -S localhost:8080 -t public public/index.php</code></pre>
</div>
</div>
<div class="row section">
<div class="col-md-12">
<h1 class="divider"><span>Features</span></h1>
<div class="row">
<div class="col-md-6">
<h2><i class="fa fa-plane"></i> HTTP Router</h2>
<p>
Slim provides a fast and powerful router that maps
route callbacks to specific HTTP request methods and
URIs. It supports parameters and pattern matching.
</p>
</div>
<div class="col-md-6">
<h2><i class="fa fa-dot-circle-o"></i> Middleware</h2>
<p>
Build your application with concentric middleware to tweak
the HTTP request and response objects around your Slim app.
</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h2><i class="fa fa-exchange"></i> PSR-7 Support</h2>
<p>
Slim supports any PSR-7 HTTP message implementation
so you may inspect and manipulate HTTP message method,
status, URI, headers, cookies, and body.
</p>
</div>
<div class="col-md-6">
<h2><i class="fa fa-plug"></i> Dependency Injection</h2>
<p>
Slim supports dependency injection so you
have complete control of your external tools.
Use any Container-Interop container.
</p>
</div>
</div>
</div>
</div>
<div class="row section">
<div class="col-md-12">
<h1 class="divider"><span>Latest News</span></h1>
{% for post in site.posts limit:3 %}
<article class="note note-partial">
<time class="note-publish-datetime">{{ post.date | date: "%b %d, %Y" }}</time>
<h2 class="note-title"><a href="{{ post.url }}">{{ post.title }}</a></h2>
<div class="note-excerpt">
{{ post.excerpt }}
</div>
</article>
{% endfor %}
<p class="center">
<a class="btn btn-primary btn-lg" href="/blog">Older News</a>
</p>
<p class="center">
<small><a href="/blog/feed.rss"><i class="fa fa-rss-square"></i> Subscribe with RSS</a></small>
</p>
</div>
</div>
<div class="row section"><a name="community"></a>
<div class="col-md-12">
<h1 class="divider"><span>Community</span></h1>
You can chat with other Slim Framework developers to share code or troubleshoot tricky issues using
either Slack or IRC.
Our nicks are <code>akrabat</code>, <code>silentworks</code> and <code>codeguy</code> if you have have questions
or need assistance.
<h2>Slack</h2>
<p>
We can by found on <a href="https://slack.com">Slack</a> at <a href="https://slimphp.slack.com">slimphp.slack.com</a>.
<p class="center">
<a class="btn btn-primary btn-lg" href="https://slimphp-slack-invite.herokuapp.com/">Get Access to the Slack Channel</a>
</p>
</p>
</p>
<h2>IRC</h2>
<p>
The official <a href="https://freenode.net/">Freenode</a> IRC channel is
<code>#slimphp</code>.
</p>
<p class="center">
<a class="btn btn-primary btn-lg" href="irc://irc.freenode.net:6667/slimphp">Visit the IRC Channel</a>
</p>
<p class="center">
<a href="https://botbot.me/freenode/slimphp/"><small><i class="fa fa-history"></i> Read real-time IRC logs on BotBot.me</small></a>
</p>
<h2>Support forums</h2>
<p>We also have Discourse support forums at <a href="http://discourse.slimframework.com/">discourse.slimframework.com/</a> for
when you have a more in depth question.
</div>
</div>
<div class="row section">
<div class="col-md-12">
<h1 class="divider"><span>Newsletter</span></h1>
<p>
Don't have Twitter? Join our newsletter and receive one email a week (at most)
with the latest Slim Framework news, release announcements, and security updates.
We hate spam, and we'll respect your inbox. You can unsubscribe at any time.
</p>
<form action="https://tinyletter.com/slimphp" method="post" target="_blank">
<div class="form-group">
<label for="tlemail">Enter your email address</label>
<input type="email" class="form-control" name="email" id="tlemail" required/>
</div>
<p class="center">
<input type="hidden" value="1" name="embed"/>
<input type="submit" class="btn btn-primary btn-lg" value="Subscribe Now"/>
</p>
<p class="center">
<small><a href="https://tinyletter.com/slimphp" target="_blank"><i class="fa fa-envelope"></i> Email Archives</a></small>
</p>
</form>
</div>
</div>
<div class="row section">
<div class="col-md-12">
<h1 class="divider"><span>Follow <a href="https://twitter.com/slimphp" target="_blank">@slimphp</a> on Twitter</span></h1>
<a class="twitter-timeline" height="500" href="https://twitter.com/slimphp" data-widget-id="564606760938668032">Tweets by @slimphp</a>
</div>
</div>