<?php
/**
 * Pi Engine (http://piengine.org)
 *
 * @link            http://code.piengine.org for the Pi Engine source repository
 * @copyright       Copyright (c) Pi Engine http://piengine.org
 * @license         http://piengine.org/license.txt BSD 3-Clause License
 */

namespace Module\Demo\Controller\Front;

use Pi;
use Pi\Mvc\Controller\ActionController;

/**
 * Class for user activity fetching
 *
 */
class ActivityController extends ActionController
{
    public function indexAction()
    {
        return 'Demo for external user activity.';
    }

    public function getAction()
    {
        $uid  = _get('uid') ?: Pi::user()->getId();
        $data = [
            'uid'     => $uid,
            'title'   => 'Demo activity with template',
            'content' => sprintf(
                'Demo activity contents generated by module %s.',
                $this->getModule()
            ),
        ];

        return $data;
    }
}
