dmnkhhn
Active member
How can I use {xen:link ...} in my custom addon?
Inside a foreach I would like to link to a specific garage.
I currently have this:
hoping that the link helper is smart enough to append the garage_id but all I get is http://localhost/xenforo1b1/garage/
$garage is filled by this method:
I know that this helper takes 4 arguments:
Inside a foreach I would like to link to a specific garage.
I currently have this:
PHP:
<xen:foreach loop="$garage" value="$test">
{xen:raw $test.garage_id} / {xen:raw $test.name}
{xen:link 'full:garage', $test}
</xen:foreach>
hoping that the link helper is smart enough to append the garage_id but all I get is http://localhost/xenforo1b1/garage/
$garage is filled by this method:
PHP:
/**
* @return array
*/
public function getAllGarages()
{
return $this->fetchAllKeyed('
SELECT *
FROM xf_doh_garage_garage
', 'garage_id');
}
I know that this helper takes 4 arguments:
- @param string $type Type of data to link to. May also include a specific action.
- @param mixed $data Primary data about this link
- @param array $extraParams Extra named params. Unhandled params will become the query string
- @param callback|false $escapeCallback Callback method for escaping the link