PHP code example of eberfreitas / cakephp-slugomatic

1. Go to this page and download the library: Download eberfreitas/cakephp-slugomatic library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

eberfreitas / cakephp-slugomatic example snippets


CakePlugin::load('Slugomatic');

public $actsAs = array(
    'Slugomatic.Slugomatic'
);

public $actsAs = array(
    'Slugomatic.Slugomatic' => array(
        'fields' => 'name'
    )
);

public $actsAs = array(
    'Slugomatic.Slugomatic' => array(
        'fields' => 'title',
        'scope' => false,
        'conditions' => false,
        'slugfield' => 'slug',
        'separator' => '-',
        'overwrite' => false,
        'length' => 256,
        'lower' => true
    )
);

  array('title', 'product_code');
  

  array(
      'conditions' => array('product_type' => 'box')
  );
  

  array(
      'scope' => array('deleted')
  );
  

  $data = array(
      'title' => 'How to grow a beard',
      'text' => 'Lorem ipsum...',
      'deleted' => 0
  )