1. Go to this page and download the library: Download nullref/yii2-cms library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
/** in some component constructor define additional parameter and set it in class property **/
public function __construct(LinkManager $linkManager, $config = [])
{
$this->linkManager = $linkManager;
parent::__construct($config);
}
/** generate link **/
echo $this->linkManager->createUrl('page', $id);