Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tip: You can also simply register route as: to-do-list/view/_ * - "_*" means you can put as many requests as you want.

...

Why the file name is view.html.php, let's review the naming rule mentioned in the previous chapters.

...

Integrate Comment To Page View

First, add code below to the bottom of file view.html.php under views/controller.

...

Wiki Markup
By using {module name='...'}, you integrate block to your view.



...

Code Block
php
php
<?php
public function getForBrowse($id)
{
    if (Phpfox::isModule('friend')) {
        db()->select('f.friend_id AS is_friend, ')
            ->leftJoin(Phpfox::getT('friend'), 'f', "f.user_id = t.user_id AND f.friend_user_id = " . Phpfox::getUserId());
    }

    if (Phpfox::isModule('like')) {
        db()->select('l.like_id AS is_liked, ')
            ->leftJoin(Phpfox::getT('like'), 'l', 'l.type_id = \'todo\' AND l.item_id = t.task_id AND l.user_id = ' . Phpfox::getUserId());
    }

    return db()->select('t.*')
        ->from(Phpfox::getT('todolist_task'), 't')
        ->where('task_id='. (int)$id)
        ->execute('getSlaveRow');
}

...