original_string: public function actionLast($id = null)
      {
          if (!is_numeric($id) || $id < 1) {
              $this->error(Yii::t('podium/flash', 'Sorry! We can not find the thread you are looking for.'));
              return $this->redirect(['forum/index']);
          }
  
          $thread = Thread::find()->where(['id' => $id])->limit(1)->one();
          if (empty($thread)) {
              $this->error(Yii::t('podium/flash', 'Sorry! We can not find the thread you are looking for.'));
              return $this->redirect(['forum/index']);
          }
  
          $url = [
              'forum/thread',
              'cid' => $thread->category_id,
              'fid' => $thread->forum_id,
              'id' => $thread->id,
              'slug' => $thread->slug
          ];
  
          $count = $thread->postsCount;
          $page = floor($count / 10) + 1;
          if ($page > 1) {
              $url['page'] = $page;
          }
          return $this->redirect($url);
      }
code: public function actionLast($id = null)
      {
          if (!is_numeric($id) || $id < 1) {
              $this->error(Yii::t('podium/flash', 'Sorry! We can not find the thread you are looking for.'));
              return $this->redirect(['forum/index']);
          }
  
          $thread = Thread::find()->where(['id' => $id])->limit(1)->one();
          if (empty($thread)) {
              $this->error(Yii::t('podium/flash', 'Sorry! We can not find the thread you are looking for.'));
              return $this->redirect(['forum/index']);
          }
  
          $url = [
              'forum/thread',
              'cid' => $thread->category_id,
              'fid' => $thread->forum_id,
              'id' => $thread->id,
              'slug' => $thread->slug
          ];
  
          $count = $thread->postsCount;
          $page = floor($count / 10) + 1;
          if ($page > 1) {
              $url['page'] = $page;
          }
          return $this->redirect($url);
      }
code_tokens: public function actionLast ( $ id = null ) { if ( ! is_numeric ( $ id ) || $ id < 1 ) { $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! We can not find the thread you are looking for.' ) ) ; return $ this -> redirect ( [ 'forum/index' ] ) ; } $ thread = Thread :: find ( ) -> where ( [ 'id' => $ id ] ) -> limit ( 1 ) -> one ( ) ; if ( empty ( $ thread ) ) { $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! We can not find the thread you are looking for.' ) ) ; return $ this -> redirect ( [ 'forum/index' ] ) ; } $ url = [ 'forum/thread' , 'cid' => $ thread -> category_id , 'fid' => $ thread -> forum_id , 'id' => $ thread -> id , 'slug' => $ thread -> slug ] ; $ count = $ thread -> postsCount ; $ page = floor ( $ count / 10 ) + 1 ; if ( $ page > 1 ) { $ url [ 'page' ] = $ page ; } return $ this -> redirect ( $ url ) ; }
docstring: Direct link for the last post in thread of given ID.
  @param int $id
  @return Response
docstring_tokens: Direct link for the last post in thread of given ID .