Download the PHP package in-square/seo-bundle without Composer

On this page you can find all versions of the php package in-square/seo-bundle. 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 seo-bundle

InsquareSeoBundle

Maintained fork of leogout/SeoBundle, adapted for modern Symfony/PHP projects. This fork includes:

This bundle provides a simple and flexible API to manage search engine optimization (SEO) tags in your application. Its main goal is to make it simple for you to manage the most common meta, open graph and twitter card tags and to let you configure less common ones with ease.

Compatibility and Migration

Installation

Install the bundle with the command:

composer require in-square/seo-bundle

Register the bundle in config/bundles.php:

Configuration

These configuration values are the defaults used to render your tags. See the next section to learn how to override them dynamically.

There are four sections in the config:

See "Configuration reference" to get the whole configuration.

In your config/packages/in_square_seo.yaml:

In your view:

NOTE: _You can provide a generator name to the render_seo_tags() twig method to render it specifically. For example, to render the basic seo generator, you can use render_seo_tags('basic')._

The result:

NOTE: By default, the SEO generators aren't loaded if you don't require them in the config. However, if you want to use the associated generators without configuring any default values (or configuring only the general ones), you can use this notation:

Setting values dynamically

You can get the '[basic|twitter|og] as a service to set or override any values. Each configuration value can be overridden using a setter of the following form: $this->get('in_square_seo.provider.generator')->get(' [basic|twitter|og] ')->set [config field name] ( [value] )

For example, if you want to change title and robots from basic, you can do this:

Setting values from a resource

You can configure your own model classes to let the seo generators do all the work thanks to the fromResource() method. Multiple interfaces are available to help the method guess which setters to call to fill the tags.

This is an example for the basic generator: In your resource:

In your controller:

In your view:

The result:

There are three main interfaces, one for each generator:

These interfaces extend simpler interfaces that you can implement instead, or additionally. For example, if you only have a meta description on your resource, you can implement DescriptionSeoInterface only to provide a description alone. This is the list of the different interfaces and what they extends:

TitleSeoInterface DescriptionSeoInterface KeywordsSeoInterface ImageSeoInterface
BasicSeoInterface X X X
OgSeoInterface X X X
TwitterSeoInterface X X X

Advanced usage

If the built-in generators don't suit your needs, InsquareSeoBundle provides a way to create your own SEO generators. First, you have to create a class that extends the AbstractSeoGenerator class:

Then, register it as a service and add it a in_square_seo.generator tag and a custom alias. Don't forget the @in_square_seo.builder dependency:

That's it, now you can use it alongside the others:

In your controller:

In your view:

Result:

Custom attributes (issue #30)

You can pass custom attributes directly to addLink() or addMeta(). Tag content and attribute values are HTML-escaped by default for safer rendering. Example inside your own SEO generator (class extending AbstractSeoGenerator):

This renders, for example:

Configuration reference

Contributing

If you want to contribute (thank you!) to this bundle, here are some guidelines:

Todo

Thanks

Many thanks to the ARCANEDEV/SEO-Helper who authorized me to take some ideas from their library and to KnpMenuBundle which inspired me for the Providers APIs.


All versions of seo-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
symfony/framework-bundle Version ^7.3
twig/twig Version ^3.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 in-square/seo-bundle contains the following files

Loading the files please wait ...