PHP Classes
elePHPant
Icontem

File: src/config/templates/cabins.twig

Recommend this page to a friend!
  Classes of Scott Arciszewski  >  CMS Airship  >  src/config/templates/cabins.twig  >  Download  
File: src/config/templates/cabins.twig
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: CMS Airship
Content management system with security features
Author: By
Last change: Merge pull request #112 from UmeshAawte/master

No need of border if using shadow
Date: 1 year ago
Size: 2,258 bytes
 

Contents

Class file image Download
{
    /* {# Our JSON parser allows comments. #}
        Placeholders allowed:
        // These match (but don't capture) an optional / prefix:
            '{_any}'
            '{_id}'
            '{_year}'
            '{_month}'
            '{_day}'
            '{_isodate}'
            '{_lower}'
            '{_upper}'
            '{_page}'
            '{_slug}'
            '{_uslug}'
            '{_lslug}'
            '{_string}'
            '{_hex}',
        // Without the / prefix:
            '{any}'
            '{id}'
            '{year}'
            '{month}'
            '{day}'
            '{isodate}'
            '{lower}'
            '{upper}'
            '{slug}'
            '{uslug}'
            '{lslug}'
            '{string}'
            '{hex}'
    */
{% for route, cabin in cabins %}
    {{ route|je }}: {
            "enabled": {{ cabin['enabled'] ? 'true' : 'false' }},
            // Used in cross-cabin hyperlinks:
            "canon_url": {{ cabin['canon_url']|default('//')|je }},
            // Only respond over HTTPS (recommended!):
            "https": {{ cabin.https ? 'true' : 'false' }},
            "language": {{ cabin.language|default('en-us')|je }},
{% if supplier %}
            "supplier": {{ cabin.supplier|je }},
{% endif %}
            // HTTP Public-Key-Pinning:
            "hpkp": {
                "enabled": {{ cabin['hpkp']['enabled'] ? 'true' : 'false' }},
                "hashes": {% if cabin['hpkp']['hashes'] %}[
                    {% for h in cabin['hpkp']['hashes'] %}{
                        "algo": {{ h.algo|default('sha256')|je }},
                        "hash": {{ h.hash|je }}
                    }{% if not loop.last %},{% endif %} {% endfor %}

                ]{% else %}[]{% endif %},
                "include-subdomains": {{ cabin['hpkp']['include-subdomains'] ? 'true' : 'false' }},
                "max-age": {{ cabin['hpkp']['max-age']|je }},
                "report-only": {{ cabin['hpkp']['report-only'] ? 'true' : 'false' }},
                "report-uri": {{ cabin['hpkp']['report-uri']|je }}
            },
            // Must be unique:
            "name": {{ cabin.name|default('UnnamedCabin' ~ loop.index)|je }}
        }{% if not loop.last %},{% endif %}

    {% endfor %}
}