Giter Site home page Giter Site logo

slim3's Introduction

Slim 3 application skeleton

SensioLabsInsight Scrutinizer Code Quality

This is an app skeleton for the Slim PHP Micro-Framework to get started quickly

Features

For more information, check out the project's wiki.

Installation

Create the project using Composer

$ composer create-project awurth/slim-base [project-name]

Setup environment variables

Copy .env to a .env.local file and change the values to your needs. This file is ignored by Git so all developers working on the project can have their own configuration.

Download client-side libraries

$ yarn

or if you prefer to use npm

$ npm install

Webpack

This skeleton uses Webpack to manage assets. The CSS and Javascript files are located in assets/, so you have to use Webpack after creating your project to generate the minified files in public/, which will be ignored by Git.

Generate assets

If you just want to generate the default CSS and JS that comes with this skeleton, run the following command

$ yarn build

or

$ npm run build

If you want to run a watcher and begin coding

$ yarn watch

Setup cache files permissions

The skeleton uses a cache system for Twig templates and the Monolog library for logging, so you have to make sure that PHP has write permissions on the var/cache/ and var/log/ directories.

Update your database schema

First, create a database with the name you set in the .env* file. Then you can create the tables by running this command:

$ php bin/console db

slim3's People

Contributors

awurth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

slim3's Issues

Slim Application Error

When I get an internal server error, I do not have the errors showing, I just have :

Slim Application Error
A website error has occurred. Sorry for the temporary inconvenience.

We used to have in previous versions the error showing. And it's not convenient at all to not have the error. (I'm in dev)

Any idea why?

kudos for the boilprate small question

i liked the combination of simantic and slim your thinking is unique it helped me build and advance

i'm a deaf and blind computer programmer using briale display

as i am new to slim and have manged to build on its basic skeleton tutoria project app as i learned it
so i tried doing the same with your structure it seems a bit complicated...
took your project as a tutorial for my own learning curve
added routes and pages
facing diffuclty with adding an admin view
only enabled checking the auth.check() using the twig %if% to see if user is logged and in session
wanted to build as first step an admin only interface using the premissions to view\edit\delete users
i was unable to do so since lacking some wiki about the structure
any basic guide wiki would be much thanked for

src.zip

PHP 7.1

The code now forces us to have PHP 7.1 to use it, as Symfony's Dotenv isn't compatible with PHP 7.0, so why is there that Dotenv ? What is it's use? There is no official PHP 7.1 on linux yet so...

How to determine if user is logged in?

Hello,

Thank you for providing this framework.

I was wondering how you would go about setting a condition for logged in status within Twig templating?

I see in container.php you are setting a global for auth, however that seems to return an object regardless.

If I needed to conditionally show content based on a user being logged in or not, how would I got about doing so?

Small issue on Auth / register.twig

You need to update password confirmation field in register.twig file. The field name has a dash instead a underscore ('password-confirm', lines 30 and 33). On Auth Controller, you're using undersore ('password_confirm', line 53) to validate it.

Congrats, nice work!

Cannot retrieve Route Parameters

I am having trouble getting the route parameters using this boilerplate. Here is what I am doing:

Add to src/App/Resources/routes/app.php:

$app->get('/test/{testparam}', 'AppController:testParams')
    ->setName('test');

Add to src/App/Controller/AppController.php:

public function testParams($request, $response, $args) {
        echo $args['testparam'];
    }

Then go to: http://0.0.0.0:8888/test/thisistheparam and there you should see thisistheparam but instead there is an error and the first letter of the route parameter.

Warning: Illegal string offset 'testparam' in C:\Users\Jeff\Projects\test2\src\App\Controller\AppController.php on line 16
t

test

hey. nice job with your boilerplate!

what about the tests? do they run your end, I get errors?

cheers
zak

semantic should be 2.2.13 and rtl maybe??

can you add an option for rtl = both in the config
i did it manually copied from another install
but not sure if everything would work
didnt get that far yet to test

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.