Bedrock

Introduction

The Assely framework perfectly integrates with Bedrock. It's recommended stack in order to take full advantage of the framework, like environment files and WP-CLI commands.

Installing Bedrock

Basically follow up the Bedrock documentation. It is simple and well explanatory.

Scaffolding Assely application

Now we can scaffold our application. Bedrock holds all themes in web/app/themes folder. Go to that directory and run assely new <project-name> command to craft fresh project.

cd web/app/themes

assely new project-name

Requiring package

Now, we will be working with Bedrock's composer.json file. Get back to the bedrock root folder and require the assely/framework package:

composer require assely/framework @dev

.. or manually add package entry to the require section in composer.json file.

"require": {
    "assely/framework": "@dev"
}

Autoloading application

In order to properly load project files, we must tell composer where he can find it. Add PSR-4 autoload rules for your application in the Bedrock's composer.json file. Insert autoload section with namespace and path of the application directory.

"autoload": {
    "psr-4": {
        "App\\": "web/app/themes/<project-name>/app"
    }
}

Installing Composer dependences

Finally, last step. While still being in the Bedrock's root folder run composer install to resolve project dependencies and generate autoloading files.

You are ready to start. Activate newly created theme and visit your website.