Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • AdjustNode
  • ConfigOperation
  • DeleteBlock
  • DeleteOperation
  • EditBlock
  • ExportBlock
  • ExportOperation
  • Helpers
  • Hooks
  • ImportOperation
  • ManageBlock
  • Model
  • Module
  • Node
  • OfflineOperation
  • OnlineOperation
  • PopNode
  • QueryOperationOperation
  • SaveOperation
  • TitleSlugCombo
  • Update20131208
  • Update20140405
  • ViewProvider

Functions

  • slugize
 1 <?php
 2 
 3 /*
 4  * This file is part of the Icybee package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace Icybee\Modules\Nodes;
13 
14 /**
15  * Converts a string into a slug.
16  *
17  * A slug is the part of a URL which identifies a page using human-readable keywords. It is
18  * common practice to make the slug all lowercase, accented characters are usually replaced
19  * by letters from the English alphabet, punctuation marks are generally removed, and long
20  * page titles may also be truncated to keep the final URL to a reasonable length.
21  *
22  * @param string $str The string to convert into a slug.
23  * @param string $language The language of the string.
24  *
25  * @return string
26  *
27  * @see http://en.wikipedia.org/wiki/Clean_URL
28  */
29 function slugize($str, $language=null)
30 {
31     return Helpers::slugize($str, $language);
32 }
33 
34 class Helpers
35 {
36     static private $jumptable = [
37 
38         'slugize' => [ __CLASS__, 'slugize' ]
39 
40     ];
41 
42     /**
43      * Calls the callback of a patchable function.
44      *
45      * @param string $name Name of the function.
46      * @param array $arguments Arguments.
47      *
48      * @return mixed
49      */
50     static public function __callstatic($name, array $arguments)
51     {
52         return call_user_func_array(self::$jumptable[$name], $arguments);
53     }
54 
55     /**
56      * Patches a patchable function.
57      *
58      * @param string $name Name of the function.
59      * @param collable $callback Callback.
60      *
61      * @throws \RuntimeException is attempt to patch an undefined function.
62      */
63     static public function patch($name, $callback)
64     {
65         if (empty(self::$jumptable[$name]))
66         {
67             throw new \RuntimeException("Undefined patchable: $name.");
68         }
69 
70         self::$jumptable[$name] = $callback;
71     }
72 
73     /*
74      * Default implementations
75      */
76 
77     static private function slugize($str, $language=null)
78     {
79         return \ICanBoogie\normalize($str);
80     }
81 }
Autodoc API documentation generated by ApiGen 2.8.0