Download the PHP package cwbit/cakephp-sluggable without Composer

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

cakephp-sluggable

Plugin for CakePHP 3.x that enables automatic, configurable slugging of database fields

WHY?

Because slugs are great for human-readable yet seo-friendly page titles, urls, image urls, etc! They're pretty much the standard nowadays and CakePHP makes it super easy to give your app the power to create them for you.

HOW?

Just add the Sluggable.Sluggable behaviour to any model whose field(s) you need to slug. See the [usage]() section for customization.

Requirements

TOC

  1. [Plugin Installation]()
  2. [Usage]()
    1. [Examples]()
  3. [Contributing]()

Plugin Installation

  1. [Composer Install]()
  2. [Manual Install]()
    1. [Loading the plugin in your app]()
    2. [Setting up the namespace / autoloader]()

Composer Install

This plugin is on Packagist which means it can be easily installed with Composer.

Then simply load the plugin normally in your config/bootstrap.php file

Manual Install

You can also manually load this plugin in your App

loading the plugin in your app

Add the source code in this project into plugins/Sluggable

Then configure your App to actually load this plugin

setting up the namespace / autoloader

Tell the autoloader where to find your namespace in your composer.json file

Then you need to issue the following command on the commandline

If you are unable to get composer autoloading to work, add 'autoload' => true line in your bootstrap.php Plugin::load(..) command (see loading section)

Slug Behavior

The sluggable behavior is extremely easy to implement, simply add it, like any other behavior, to your Table

By default the plugin will automatically generate a slug based on name, will store it in a column called slug and will use a dash - replacement, and will NOT automatically overwrite the slug field whenever name changes.

All of these settings are, of course, configurable.

Examples

Generate a slug based on the title field instead of name

Generate a slug based on id and title

Generate a slug based on the latest version of the title (always)

Generate a slug normally, but store it in the foo column

Generate a slug using . dots instead of - dashes

Slug Utility

The Sluggable Plugin adds a Utility class Slug that can be called statically. This is the function used by the Behavior to actually generate the slug.

It is capable of handling a string, array, or entity in conjunction with a simple string or Text::insert-friendly pattern.

To use the Utility, simply add the following to your class header

The Utility provides the following function

Examples

To Text::insert via an array...

To Text::insert via Entity properties...

Contributing

If you'd like to contribute, please submit a PR with your changes!

Requests will be accepted more readily if they come complete with TESTS :D


All versions of cakephp-sluggable with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
cakephp/cakephp Version ~3
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 cwbit/cakephp-sluggable contains the following files

Loading the files please wait ....