Download the PHP package magicalella/yii2-sef without Composer

On this page you can find all versions of the php package magicalella/yii2-sef. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-sef

Collegamenti CNC Yii2 (URL) per il sito

Installazione

Il modo migliore per installare questa estensione è tramite composer.

Lancia

o aggiungi

nella sezione require del tuo file "composer.json".

E avvia la migrazione dei file

yii migrate/up --migrationPath=@vendor/magicalella/yii2-sef/migrations

Può essere creato manualmente. Vale a dire, la tabella sef ha solo 5 campi:

id(primaryKey, AUTO_INCREMENT); link(varchar(255)); link_sef(varchar(255)); meta_title(varchar(255)); meta_description(varchar(255));

Utilizzo

Nel file: config/web.php o frontend/config/main.php se yii advanced scrivi

    'urlManager' => [
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    'rules' => [
            // Ci sono delle regole qui.
            [ 
                'class' => 'magicalella\sef\SefRule',
                'connectionID' => 'db',
            ],
        ],
    ],

Per il pannello di amministrazione, puoi creare un modello "Sef" oppure puoi utilizzare un modello "magicalella\sef\src\Sef" già pronto

'link' = questo è il campo del collegamento originale, ad esempio articolo/vista?id=49

'link_sef' = questo campo è sinonimo dell'URL

'meta_title' = Titolo della pagina

'meta_description' = Meta description della pagina

Memorizzazione automatica delle URL in db e sostituzione automatica Meta Title e Description

Inserire:

in _protected\ (Yii basic) o _protected\common\ (Yii advanced)

in _protected\backend\controllers

in FrontendController

use app\models\Sef (Yii basic) use common\models\Sef (Yii advanced)

public function afterAction($action, $result) { $result = parent::afterAction($action, $result); $request = Yii::$app->request;

    if ($request->isGet){
        Sef::inserisciSef($action,$request);
    }    
    return $result;
}

public function render ( $view, $params = [] ){
        $request = Yii::$app->request;
        $controller  = Yii::$app->controller->id;
        // ! SEO
        $meta_titol = Sef::scriviMetaTitle($view,$controller,$request);
        $meta_description =  Sef::scriviMetaDescription($view,$controller,$request);

        Yii::$app->view->title = $meta_titol;
        Yii::$app->view->registerMetaTag([
            'name' => 'description',
            'content' =>  $meta_description,
        ]);
        return parent::render($view, $params);   
    }

in params

//se impostato prende aggiunge prefisso 'add_prefix_meta_titol' => 1, //se non impostato prende di default il nome del sito sempre se add_prefix è a 1 'prefix_meta_titol' => 'prefix', //se non impostato prende di default ' | ' 'separazione_meta_titol' => ' | ', 'meta_description' => 'Default meta description',


All versions of yii2-sef with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
yiisoft/yii2 Version ~2.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package magicalella/yii2-sef contains the following files

Loading the files please wait ...