URLs
Last updated
Last updated
Please note: This page is under construction and has not been finished yet.
You can generate a Search Engine Friendly (SEF) URLs using the following method:
Parameter | Type | Description | Mandatory? |
---|---|---|---|
In this example we will generate search-engine-friendly URLs for a forum topic with the following code: .
The code above loads the following file: e107_plugins/forum/e_url.php
and generates a URL from the following array data with the unique key topic
:
Only the value of 'sef' is used in this array. it substitutes the values {forum_sef},
{thread_id}
and {thread_sef}
with the variables in the $data
array.
The end result would look something like this: http://sitename.com/forum/my-sef-forum-name/2-my-forum-topic
TODO: Add examples using the options parameter
plugin
string
Folder name of the plugin. (will use data from e_url.php)
Yes
key
string
Unique key
Yes
row
array
Array of variable data such as id, title etc. eg. user_id, user_name
No
options
array
An associative array of additional options, with the following elements:
mode: abs | full (returning the absolute path or full URL)
query: an array of query key/value-pairs (without any URL-encoding) to append to the URL.
fragment: a fragment identifier (named anchor) to append to the URL. Do not include the leading '#' character.
(optional)
No