Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinevia authored May 17, 2018
1 parent 53303c0 commit b82df19
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ The widgets are predefined dynamic modules which can be embedded into pages and

To embed in page or template use a shortcode like this: [[WIDGET_20180509052702261348]]

## Human Friendly Aliases ##
The following shortcuts can be used to create human friendly page aliases, that can be used for pages with dynamic content

|Shortcut | Regex |
| ------- |-------|
| :any | ([^/]+) |
| :num | ([0-9]+) |
| :all | (.*) |
| :string | ([a-zA-Z]+) |
| :number | ([0-9]+) |
| :alpha' | ([a-zA-Z0-9-_]+) |

Example page alias: /article/:num/:string

To retrieve back you may use the following snippet
```php
preg_match('#^/article/([0-9]+)/([a-zA-Z]+)/([a-zA-Z]+)$#', '/' . $uri, $matched);
$articleId = $matched[1] ?? "";
```

## Quick Snippets

1. Advanced usage. Use the CMS templates to wrap around custom code with blade templates:
Expand Down

0 comments on commit b82df19

Please sign in to comment.