PHP code example of infoweb-internet-solutions / yii2-cms-alias

1. Go to this page and download the library: Download infoweb-internet-solutions/yii2-cms-alias 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/ */

    

infoweb-internet-solutions / yii2-cms-alias example snippets


'modules' => [
    ...
    'alias' => [
        'class' => 'infoweb\alias\Module',
        'reservedUrls' => ['page'] // Url's that are reserved by the application
    ],
],

use infoweb\alias\behaviors\AliasBehavior;

public function behaviors()
{
    return [
        'alias' => [
            'class' => AliasBehavior::className(),
            'entityType' => Page::className(),
            'entityIdField' => 'page_id'
        ],
    ];
}

 // Initialize the tabs
<?= $this->render('@infoweb/alias/views/behaviors/alias/_url', [
        'form' => $form,
        'model' => $model,
        'alias' => $alias,
        'readonly' => false,
        'duplicateable' => true,
        'urlPrefix' => ''
    ]) 

'data-slugable' => 'true',
'data-slug-target' => "#alias-{$model->language}-url"

use infoweb\alias\traits\AliasRelationTrait;

class Page extends ActiveRecord
{
	use AliasRelationTrait;
}