* @copyright 2020 Copyright XEHub Corp. * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL * @link https://xpressengine.io */ namespace App\Widgets; use View; use XeUser; use Xpressengine\Document\Models\Document; use Xpressengine\Widget\AbstractWidget; /** * Class ContentInfo * * @category Widgets * @package App\Widgets * @author XE Developers * @copyright 2020 Copyright XEHub Corp. * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL * @link https://xpressengine.io */ class ContentInfo extends AbstractWidget { /** * The component id * * @var string */ protected static $id = 'widget/xpressengine@contentInfo'; /** * Returns the title of the widget. * * @return string */ public static function getTitle() { return '콘텐츠 현황 위젯'; } /** * Get the evaluated contents of the object. * * @return string */ public function render() { $viewData = [ 'totalDocument' => Document::count(), 'totalUser' => XeUser::users()->count(), ]; return $this->renderSkin([ 'viewData' => $viewData, ]); } }