Anatoliy
Well-known member
So I'm following "Building with XF2" video tutorials. I'm trying to build a simple addon that shows thread titles that are too long.
So far I made addon that shows all threads (2) from my new local xf installation. I have 2 questions.
1. How do I limit to say 20 result, so on my production forum it will not fetch thousands and thousands?
2. And how to incorporate in the code strlen()? Should I use it in my Controller, or in foreach loop in template?
Thanks in advance.
so far I have this
So far I made addon that shows all threads (2) from my new local xf installation. I have 2 questions.
1. How do I limit to say 20 result, so on my production forum it will not fetch thousands and thousands?
2. And how to incorporate in the code strlen()? Should I use it in my Controller, or in foreach loop in template?
Thanks in advance.
so far I have this
Code:
public function actionIndex(){
$threadFinder = $this->finder('XF:Thread');
$viewParams = [
'mythreads' => $threadFinder->fetch()
];
return $this->view('AV\Titles:Title\Index', 'av_titles_index', $viewParams);
}