PHPackages                             katheroine/layin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. katheroine/layin

ActiveLayout[Utility &amp; Helpers](/categories/utility)

katheroine/layin
================

General purpose web page layout.

0.4.0(3y ago)016[1 issues](https://github.com/katheroine/layin/issues)MITHTMLPHP &gt;=7.2.5

Since Oct 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/katheroine/layin)[ Packagist](https://packagist.org/packages/katheroine/layin)[ RSS](/packages/katheroine-layin/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (4)Versions (30)Used By (0)

Layin
=====

[](#layin)

General purpose web page layout.

See demo \[\]

Prerequisites
-------------

[](#prerequisites)

1. **PHP**: at least PHP **7.2.5**
2. [**Composer**](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos) - dependency manager for PHP.
3. A web server (Apache has been used in the example below).

Project set-up
--------------

[](#project-set-up)

1. Create project directory and place `composer.json` - project configurtion file for Composer with appropriate content, eg.:

```
{
    "name": "awesomeauthor/awesomesite",
    "description": "Some awesome site.",
    "type": "project",
    "require": {
        "katheroine/layin": "*"
    },
    "require-dev": {
        "phpunit/phpunit": "*",
        "squizlabs/php_codesniffer": "*"
    },
    "autoload": {
        "psr-4": {
            "AwesomeAuthor\\AwesomeSite\\": [
                "src/"
            ],
            "AwesomeAuthor\\AwesomeSite\\Preconfiguration\\": [
                "site/preconfigurations/",
                "site/preconfigurations/page_renderers/"
            ]
        }
    },
    "autoload-dev": {
        "psr-4": {
            "AwesomeAuthor\\AwesomeSite\\": [
                "tests/"
            ]
        }
    }
}
```

2. Run in the console:

```
$ composer install
```

The `vendor` directory will be created and the dependencies will be placed there.

3. If you're using Git, create `.gitignore` file with `vendor` directory and optionally `composer.lock`:

```
vendor
composer.lock

```

It will remove those files/directories from the Git tracking process, so that those ones won't be placed in the respository.

4. Prepare project directories structure within the main project directory:

```
- site
    - config
    - preconfigurations
    - public
        - assets
            - images
            - scripts
            - stylesheets
        - pages
    - templates

```

You can use the predefined Layin command:

```
$ vendor/bin/layin site:prepare
```

5. Choose concrete theme, e.g. *Violet* - currently the only available, and generate links to its files, which will be placed in the `site` directory. You can use the predefined Layin command:

```
$ vendor/bin/layin theme:load violet
```

6. Copy and edit the configuration files from vendor/katheroine/layin/site/config to site/config directory and replace its content with the one appropriate to your site:

- `site.config.yaml`

```
html_doc_title: Some awesome site
html_doc_description: My awesome site based on the Layin layout system
html_doc_keywords: awesome site, layin example
html_doc_author:
  name: Lucy Diamond
  email: lucy.diamond@someemailbox.com
html_doc_charset: utf-8
html_doc_language: english
html_doc_language_code: en-EN
header_title: The awesome site
header_subtitle: good place on the web
footer_copyright_range: 2023
footer_site_name: The awesome site
```

- `navigation_links.yaml`

```
- css_id: home-link
  title: News
  url_part: [[base_url]]
```

- `contact_info_links.yaml`

```
- css_id: email-action
  title: e-mail
  value: lucy.diamond@someemailbox.com
  url: mailto:lucy.diamond@someemailbox.com
```

7. Copy and edit the `AbstractBasePreconfiguredPageRenderer.php` file from `vendor/katheroine/layin/site/preconfigurations/page_renderers` to `site/preconfigurations/page_renderers`:

```
