Download the PHP package eberfreitas/cakephp-slugomatic without Composer

On this page you can find all versions of the php package eberfreitas/cakephp-slugomatic. 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 cakephp-slugomatic

Slugomatic Plugin

Build Status Coverage Status

Slugomatic is a CakePHP plugin that automatically generate slugs based on your database fields. That way you can easily generate user and SEO friendly URLs for your resources. You can read more about Semantic URLs on Wikipedia.

Example

If you have a record on your database with the title "How to grow a beard", the plugin will generate a slug like "how-to-grow-a-beard". That way you can create links like this:

http://example.com/post/1234/how-to-grow-a-beard

Requirements

Installation

Using Composer

Add the plugin to your project's composer.json - something like this:

Because this plugin has the type cakephp-plugin set in it's own composer.json, composer knows to install it inside your /Plugins directory, rather than in the usual vendors file. It is recommended that you add /Plugins/Slugomatic to your .gitignore file. Why? read this.

Manual

GIT Submodule

In your app directory type:

GIT Clone

In your plugin directory type:

Usage

First of all you need to enable the plugin on your application. On your app/Config/bootstrap.php add the following line:

You can read more about enabling plugins and the different ways of doing it on Cake's Book.

After that, go to the model where you want to use the plugin and attach the behavior like this:

The plugin will assume that your have a field called title. The slug will be created using the data from that field. If you have a different field name, just configure the behavior like this:

The plugin will also assume that you have a slug field where the generated slug will be stored. Take a look at the options below if you need to change that.

If by any means you have two records with the same title, Slugomatic will identify those records and generate indexed slugs avoiding duplication, like this:

Options

When configuring the behavior, you have the following options:

Additional options for deduplication

Like stated before, Slugomatic will identify duplicated slugs and generate a properly indexed new slug to avoid that. The plugin also provides two different options that enables you to control the way it identifies duplicated slugs:

Credits & thanks

This plugin is heavily based on Mariano's SluggableBehavior from the Syrup package. A big thanks to Friends of Cake for providing the awesome boilerplate for travis-ci integration. And finally, thanks to Jose Diaz-Gonzalez and his CakeAdvent series which helped me to create this plugin properly.


All versions of cakephp-slugomatic with dependencies

PHP Build Version
Package Version
Requires composer/installers Version *
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 eberfreitas/cakephp-slugomatic contains the following files

Loading the files please wait ....