Mecha CMS

A lower priority extensions.

Candy

Author: Taufik Nurrohman · 631 Views

Tweet

Embed global variables in page content.

Table of Content

Download Latest Version

Common patterns:

Configuration 

  • %‌{‌config.title‌}‌%
  • %‌{‌config.description‌}‌%
  • %‌{‌config.page.title‌}‌%
  • %‌{‌config.page.description‌}‌%

Date 

  • %‌{‌date.year‌}‌%
  • %‌{‌date.month‌}‌%
  • %‌{‌date.en_us‌}‌%
  • %‌{‌date.F2‌}‌%

Language 

  • %‌{‌language.yes‌}‌%
  • %‌{‌language.no‌}‌%
  • %‌{‌language.submit‌}‌%
  • %‌{‌language.cancel‌}‌%

Page 

  • %‌{‌page.url‌}‌%
  • %‌{‌page.title‌}‌%
  • %‌{‌page.description‌}‌%
  • %‌{‌page.link‌}‌%
  • %‌{‌page.author‌}‌%

Site 

Alias for $config.

  • %‌{‌site.title‌}‌%
  • %‌{‌site.description‌}‌%
  • %‌{‌site.page.title‌}‌%
  • %‌{‌site.page.description‌}‌%

This 

Alias for $page.

  • %‌{‌$.url‌}‌%
  • %‌{‌$.title‌}‌%
  • %‌{‌$.description‌}‌%
  • %‌{‌$.link‌}‌%
  • %‌{‌$.author‌}‌%

URL 

  • %‌{‌url‌}‌%http://localhost/a
  • %‌{‌url.scheme‌}‌%http
  • %‌{‌url.protocol‌}‌%http://
  • %‌{‌url.host‌}‌%localhost
  • %‌{‌url.port‌}‌%80
  • %‌{‌url.directory‌}‌%a
  • %‌{‌url.url‌}‌% → same as %‌{‌url‌}‌%
  • %‌{‌url.path‌}‌%foo/bar
  • %‌{‌url.query‌}‌%?foo=bar&baz=qux
  • %‌{‌url.current‌}‌%http://localhost/a/foo/bar

Related: Variable


Custom 

Add your custom syntax or replace the default syntax in the v property, remove the default syntax in x:

[
    'v' => [
        'asset' => 'http://mecha-cms.com/lot/asset'
        …
    ],
    'x' => [ … ]
]

0 Comments

No comments yet.