Sunday, February 21, 2010

Cubi clean url

In Openbiz baseapp, a typical url to access a view is like http://host/baseapp/bin/controller.php?view=a.b.viewname. We call it raw openbiz url.

Cubi will map cleaner urls to raw urls by adding an index.php and .htaccess under the root directory of cubi installation.

View mapping syntax:
  • /cubi/a/x maps to /cubi/bin/controller.php?view=a.view.XView. Example: /cubi/system/userList
  • /cubi/a/x_y maps to /cubi/bin/controller.php?view=a.view.XYView. Example: /cubi/system/user_list
  • /cubi/a/x/number maps to /cubi/bin/controller.php?view=a.view.XView&fld:Id=number. Example: /cubi/system/user_detail/5
  • /cubi/a/x/word_number maps to /cubi/bin/controller.php?view=a.view.XView&fld:word=number
If .htaccess is not recognized by web server (e.g. installed on IIS), then you need to do the following:
  • Add "?" right after /cubi/. This assumes that index.php is the default script configured in web server. For example, http://host/cubi/?/system/user_list
  • Or add "index.php?" right after /cubi/. For example, http://host/cubi/index.php?/system/user_list

No comments:

Post a Comment