Download the PHP package inblank/yii2-seobility without Composer

On this page you can find all versions of the php package inblank/yii2-seobility. 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-seobility

Behavior for Yii2 to manage SEO data for ActiveRecord

Build Status Packagist Version Code Coverage Code Quality GitHub license

Русская версия этого документа доступна здесь.

Behavior yii2-seobility for Yii2 allows you to manage SEO data for ActiveRecord models. For each model, you can store multiple records with SEO data and select according to the condition. If data with the condition not found, then will returned the default data, and if them not, will returned the data with empty values.

Each SEO data entry contains the fields: title, keywords and description.

Installation

The preferred way to install this extension is through composer.

Navigate to the project folder and run the console command:

or add:

to the require section of your composer.json file.

Configuring

Database

To storing SEO data the behavior uses an ActiveRecord model's database connection. Behavior does not create and does not check for required tables. Tables must be created before using.

The name of the table to store and retrieve data, the behavior has on the basis of the table name of the ActiveRecord model to which is attached. The name is created by adding the suffix _seo to the table name of the ActiveRecord model. To get the table name of the model the model uses the method ActiveRecord::tableName()

Examples:

  • If the model uses a table model, the behaviour will use the table model_seo.
  • If the model uses a table {{%model}}, the behaviour will use the table {{%model_seo}}.

To create a table use the following SQL query, replacing model_seo by required table name:

The query uses the MySQL syntax

Model

To use a behavior just attach it to the ActiveRecord model as specified in the Yii2 documentation

If you correctly created a table to store the SEO data, configuring is complete.

Usage

After successful configuration, you can use behavior methods to manage SEO data of ActiveRecord models.

Setting default SEO data

Default SEO data have condition=0

To setting default SEO data:

After saving the model, the default SEO data will contain defined values and these will be available at any time.

Note: If the model has not passed validation and was not saved SEO data will not be saved too.

Setting SEO data with condition

To setting SEO data with condition:

Note: If the model has not passed validation and was not saved SEO data will not be saved too.

Getting default SEO data

To getting default SEO data:

After getting the data, the variable $seo will contain an array with keys title, keywords and description.

Data will be obtained even if they were not specified. In this case, all array fields will contain empty value.

Getting SEO data with condition

To getting SEO data with condition:

Will be obtained SEO data with condition=1, and if no such data will be getting the default SEO data, or empty if no default data.

Through the method parameters, you can specify what data to obtain if the requested data is not found.

Getting all SEO data

To getting all SEO data:

After getting the data, the variable $seo will contain an array with all the SEO data. Indices of elements in the array are the values of the condition.

Remove default SEO data

To remove default SEO data:

Attention: Be careful, the removal happens immediately and does not require $model->save() method. Removed data cannot be restore.

Remove SEO data with condition

To remove SEO data with condition:

Attention: Be careful, the removal happens immediately and does not require $model->save() method. Removed data cannot be restore.

Remove all SEO data for model

To remove all SEO data for model:

Attention: Be careful, the removal happens immediately and does not require $model->save() method. Removed data cannot be restore.


All versions of yii2-seobility with dependencies

PHP Build Version
Package Version
Requires 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 inblank/yii2-seobility contains the following files

Loading the files please wait ....