The C2ms system is designed to handle all of a web site’s URLs and internally respond to requests with the appropriate content and promotion level. This is accomplished via block type renderers and application mount points. Block type renderers are appropriate for content that is thought of as an item like an event, a product or a content page. However, often developers may wish to program a system that controls the entire display – like a document library search. In those cases you may not wish to provide a placeable widget with a block type but instead answer at one or more specific URLs. To accommodate this C2MS provides application mount points.
Application mount points are simple to create, as they require only a simple database entry into the cbmapplicationurl table. For example, to register the documentlibrary module’s LibraryController’s actionIndex method at the /library url we would use the following database command:
1 2 |
INSERT INTO livedata.cbmapplicationurl ( urlprefix, module, controller, action) VALUES ( '/library', 'documentlibrary', 'library', 'index' ); |
Developers should never program their modules to expect an application to use a given URL for the mount point – as a C2ms user may choose to refactor the URL structure of a site – and the C2ms system will provide an interface to control mount point URLs in the near future. Instead, application mount points should be looked up using the helper class Cbmapplicationurl. For example, to lookup the URL we registered (/library) earlier, we would use:
1 |
$strMyUrl = Cbmapplicationurl::applicationUrl( 'documentlibrary', 'library', 'index' ); |