Page View Counter Plugin for Flextype
Page View Counter plugin will help you to know how many readers of every page on your website.
The following dependencies need to be installed for Page View Counter Plugin.
Item | Version | Download |
---|---|---|
flextype | 0.9.16 | download |
twig | >=2.0.0 | download |
- Download & Install all required dependencies.
- Create new folder
/project/plugins/page-view-counter
- Download Page View Counter Plugin and unzip plugin content to the folder
/project/plugins/page-view-counter
Key | Value | Description |
---|---|---|
enabled | true | true or false to disable the plugin |
priority | 100 | Page View Counter plugin priority |
Function pageViewCounter()
in namespace Flextype\Plugin\PageViewCounter
/**
* Get page view counter
*
* @return int
*/
function pageViewCounter(): int
Display page view counter in the twig templates
{{ pageViewCounter() }}
Display page view counter in the entry content
[pageViewCounter]
Display page view counter in the php
echo Flextype\Plugin\PageViewCounter\pageViewCounter();
The MIT License (MIT) Copyright (c) 2021 Sergey Romanenko