Thursday, September 3, 2009

Link Manager

There are always a number of utility methods that you need to be able to use site wide but are specific to your site. I have used many approaches to this challenge and just tried a solution which involves utility plugins.

The first implementation is the LinkManager, which helps you fetch the right URLs to open dynamic content items with.

You configure them in application.ini:

resources.util.LinkManager.Forum_Model_Forum.open = "/forum/forum/open/{id}"

And then you can fetch the LinkManager from the Digitalus Core:


$linkManager = Dig_Core::getInstance()->getUtil()->LinkManager;
$forum = new Forum_Model_Forum(4);
echo $linkManager->getOpenModelUrl($forum);

No comments:

Post a Comment