-
Notifications
You must be signed in to change notification settings - Fork 7
filters
Alexander Söderberg edited this page Nov 4, 2017
·
2 revisions
Filters are used to determine which view gets to serve the incoming requests. Each filter is made up of different parts, there are four types of parts:
- Separators -
/
and.
- Used like a path separator - Static - Example:
user
- A static string - Required Variable - Example:
<username>
- Optional Variable - Example:
[page]
- Can also have a default value, like:
[page=index]
wherepage
is the variable name andindex
is the default value
- Can also have a default value, like:
user/<username>
- Serves user/Citymonstret
, but not user/
or user/Citymonstret/other
news/[page=1]
- Serves news
(as news/1
), news/1
, news/foo
but not news/foo/bar
user/<username>/posts/[page]
- Serves user/Citymonstret/posts
and user/Citymonstrst/posts/10
To add an optional file extension, do:
[page].[extension=html]
- Will direct requests to ${page}.html
or ${page}.${extension}
There is no filtering of variable. That is done using Middleware
IntellectualServer
Files can be found in .kvantum/config
- Getting Started
- View Patterns
- File Patterns
- server.yml
views.yml- socketFilters.yml
- translations.yml
- SSL
- Getting Started
- Modules
- Hello World
- Plugins
- Events
- Account System
- Authorization
- Application System
- Sessions
- Create a view - OOP based
- Create a view - @Annotation based
- Middleware
- Extending Crush (Templating syntax)
- ViewReturn