AndyB
Well-known member
I would like to add a widget that will be used to show a block while in thread_view. I have selected the Thread view: Sidebar.
In my PHP code I'm trying to get the thread_id from the URL. It would be nice to be able to use something like this, but this doesn't work.
Is there any PHP code that can get the thread_id from the URL?
Thank you.
In my PHP code I'm trying to get the thread_id from the URL. It would be nice to be able to use something like this, but this doesn't work.
PHP:
<?php
namespace Andy\SimilarThreads\Widget;
use \XF\Widget\AbstractWidget;
class SimilarThreads extends AbstractWidget
{
public function render()
{
$threadId = \XF::app()->filter('thread_id', 'uint');
Is there any PHP code that can get the thread_id from the URL?
Thank you.