URL Dispatcher
From XOMBO Documentation
URL Format:
http[s]://[appname].domain.tld[/view][/action][/ID]
By now, you have familiarized yourself with View objects and their constituent functions. Having a general understanding of the URL Dispatcher will help you visualize how in-bound links will be presented. XOMBO Platform follows a paradigm that users of Ruby on Rails will recognize.
As you learned when adding your View to the database, each View has its own “Default Function.” This is the action that gets called by default if no other action is explicitly referenced. This is usually the “main” function.
You can call up the default action for a view via a web browser with a request similar to the following:
Alternatively, if my default action is called “main” you can call it or another function explicitly as follows:
One convenient method of linking allows you to include the ID of the record you are editing. If we're using the boilerplate “edit” function, we can pass the ID of the element we're editing in the URL as follows:
You can call up the ID with $this->GetRequest ('ID'); The “main” function can also be programmed to accept ID as a parameter. Issuing a call to such a function is similar:
The basic format is as follows:
http://mysite/ViewName/ActionName/ID
Keep these URL formats in mind when having XOMBO Platform prepare e-mails and pages. Having these simple links allows for better Search Engine Optimization. Additionally, simple linking makes it easier for users to remember and bookmark page URLs. Also, simple linking allows users to “go up a level” by manipulating the address bar. You should plan this into your code so it fails gracefully, throws an error, or redirects to the View's default function.
When you use the Link library, simple URLs are created automatically for you.
File ./model/sessionbase.class.php ★ SVN http://svn.xombo.org/svn/platform/current/trunk/model/sessionbase.class.php API DOCS
.htaccess
This section details two options for creating an .htaccess file for XOMBO Platform. The .htaccess file will parse and translate the simple URL(s) described above into something the server can understand. On some versions of Apache, the first option does not work properly. The second version was designed to remedy this problem, but is not officially supported.
Recommended:
ErrorDocument 404 /index.php
File ./htaccess ★ SVN http://svn.xombo.org/svn/platform/current/trunk/htaccess API DOCS
Alternative:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(.*)/compress(.*)$ [NC]
RewriteRule .* index.php [QSA,L]
File ./htaccess_alt ★ SVN http://svn.xombo.org/svn/platform/current/trunk/htaccess_alt API DOCS
Be sure to rename the .htaccess file you choose in your distribution to .htaccess for changes to be applied. It must be in the root directory of your XOMBO Platform installation.

