Jaxel
Well-known member
I'm using the following code for my media library:
Using that code works great... i can create links as follows:
{xen:link 'full:media', $media} would return xenforo/media/{$media_title}.{$media_id}
However, now I want to create links as follows: /media/category/{$category_title}.{$category_id}
How would I construct the buildLink function for this? and how would I call it?
Code:
<?php
class EWRmedio_Route_Media implements XenForo_Route_Interface
{
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
return $router->getRouteMatch('EWRmedio_ControllerPublic_Media', 'index', 'media', $routePath);
}
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'media_id', 'media_title');
}
}
{xen:link 'full:media', $media} would return xenforo/media/{$media_title}.{$media_id}
However, now I want to create links as follows: /media/category/{$category_title}.{$category_id}
How would I construct the buildLink function for this? and how would I call it?