XF 2.2 Usage of xf:delete


New member

I know the official way of XF is to check the source code and copy paste it on good luck till it works and than you maybe understand it. But this time this isn't enough.

I'm trying to use a xf:delete element. That's how I'm using it:
<xf:delete href="{{ link('module/delete', $rule) }}" />

It gets to the desired function, but $params is empty. This is the function:
    public function actionDelete(ParameterBag $params)
        $rule = $this->assertRuleExists($params->rule_id);

        /** @var \XF\ControllerPlugin\Delete $plugin */
        $plugin = $this->plugin('XF:Delete');
        return $plugin->actionDelete(
            $this->buildLink('module/delete', $rule),
            $this->buildLink('module/edit', $rule),

I just copied the code of one of the many files that are using the same code. How do I get the rule_id into $params?
Yes, $rule inside the template is filled (I'm showing the other data without any problems).
Yes, I named the "title" attribute "name".
Glad that you were able to sort it out. And thanks to you, I now know about xf:delete tag. You learn something new everyday. Thanks for that.
Top Bottom