Skip to content

Commit 587940a

Browse files
committed
first commit
0 parents  commit 587940a

File tree

18 files changed

+203
-0
lines changed

18 files changed

+203
-0
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
insert_final_newline = true
10+
indent_style = space
11+
indent_size = 4
12+
trim_trailing_whitespace = true

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/vendor
2+
composer.phar
3+
composer.lock
4+
node_modules
5+
bower_components
6+
.DS_Store
7+
Thumbs.db

.jshintrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"browser": true,
3+
"esnext": true,
4+
"bitwise": true,
5+
"camelcase": true,
6+
"curly": true,
7+
"eqeqeq": true,
8+
"immed": true,
9+
"indent": 4,
10+
"latedef": true,
11+
"newcap": true,
12+
"noarg": true,
13+
"quotmark": "single",
14+
"undef": true,
15+
"unused": true,
16+
"strict": true,
17+
"jquery": true
18+
}

LICENSE.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 dinkbit <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Slimboot
2+
3+
Small boilerplate for PHP website with assets compilers.
4+
5+
Includes
6+
- Slim Framework
7+
- Twig Templates
8+
- Laravel Elixir

app/app.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
$app->get('/', function () use ($app) {
4+
$app->render('index.html');
5+
});

bower.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "slimboot",
3+
"version": "0.1.0",
4+
"homepage": "https://github.com/dinkbit/slimboot",
5+
"private": true,
6+
"dependencies": {
7+
"bootstrap-sass-official": "~3.3.1"
8+
}
9+
}

composer.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "dinkbit/slimboot",
3+
"description": "Small boilerplate for PHP website with assets compilers",
4+
"keywords": [
5+
"slim",
6+
"twig",
7+
"elixir"
8+
],
9+
"require": {
10+
"slim/slim": "2.*",
11+
"twig/twig": "~1.0",
12+
"slim/views": "0.1.*"
13+
}
14+
}

config/config.php

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
$app->configureMode('production', function () use ($app) {
4+
$app->config(array(
5+
'log.enable' => true,
6+
'debug' => false
7+
));
8+
});
9+
10+
$app->configureMode('local', function () use ($app) {
11+
$app->config(array(
12+
'log.enable' => false,
13+
'debug' => true
14+
));
15+
});

elixir.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"assetsDir": "resources/assets/",
3+
"cssOutput": "public/css/",
4+
"jsOutput": "public/js/",
5+
"bowerDir": "bower_components"
6+
}

gulpfile.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var elixir = require('laravel-elixir');
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Elixir Asset Management
6+
|--------------------------------------------------------------------------
7+
|
8+
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
9+
| for your Laravel application. By default, we are compiling the Sass
10+
| file for our application, as well as publishing vendor resources.
11+
|
12+
*/
13+
14+
elixir(function(mix) {
15+
mix.sass('resources/assets/sass/app.scss');
16+
});

package.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"private": true,
3+
"engines": {
4+
"node": ">=0.10.0"
5+
},
6+
"devDependencies": {
7+
"gulp": "^3.8.8",
8+
"laravel-elixir": "*"
9+
}
10+
}

public/index.php

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
require 'vendor/autoload.php';
4+
5+
$app = new \Slim\Slim();
6+
7+
// Global config
8+
$app->config(array(
9+
'mode' => 'local', // Can be set by $_ENV['SLIM_MODE'] = 'production';
10+
'templates.path' => './resources/templates',
11+
));
12+
13+
// Configure Views
14+
$app->view(new \Slim\Views\Twig());
15+
$app->view->parserOptions = array(
16+
'charset' => 'utf-8',
17+
'cache' => realpath('./storage/templates'),
18+
'auto_reload' => true,
19+
'strict_variables' => false,
20+
'autoescape' => true
21+
);
22+
$app->view->parserExtensions = array(new \Slim\Views\TwigExtension());
23+
24+
// Load app
25+
require './app/app.php';
26+
27+
$app->run();

resources/assets/sass/app.scss

Whitespace-only changes.

resources/templates/index.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% extends "layouts/default.html" %}
2+
3+
{% block title %}Index{% endblock %}
4+
{% block head %}
5+
{{ parent() }}
6+
<style type="text/css">
7+
.important { color: #336699; }
8+
</style>
9+
{% endblock %}
10+
{% block content %}
11+
<h1>Index</h1>
12+
<p class="important">
13+
Welcome on my awesome homepage.
14+
</p>
15+
{% endblock %}
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
{% block head %}
5+
<link rel="stylesheet" href="style.css" />
6+
<title>{% block title %}{% endblock %} - Slimboot</title>
7+
{% endblock %}
8+
</head>
9+
<body>
10+
<div id="content">{% block content %}{% endblock %}</div>
11+
<div id="footer">
12+
{% block footer %}
13+
&copy; Copyright 2011 by <a href="http://domain.invalid/">you</a>.
14+
{% endblock %}
15+
</div>
16+
</body>
17+
</html>

storage/templates/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

0 commit comments

Comments
 (0)