code/database/behavior/sluggable.php
protected function _createSlug()
    {
        //Regenerate the slug
        if($this->isModified('slug')) {
            $this->slug = $this->_createFilter()->sanitize($this->slug);
        }

        //Handle empty slug
        if(empty($this->slug))
        {
            $slugs = array();
            foreach($this->_columns as $column) {
                $slugs[] = $this->_createFilter()->sanitize($this->$column);
            }

            $this->slug = implode($this->_separator, array_filter($slugs));
        }

        //Canonicalize the slug
        if($this->_unique) {
            $this->_canonicalizeSlug();
        }
    }
protected function _createSlug()
    {
        //Regenerate the slug
        if($this->isModified('slug')) {
            $this->slug = $this->_createFilter()->sanitize($this->slug);
        }

        //Handle empty slug
        if(empty($this->slug))
        {
            $slugs = array();
            foreach($this->_columns as $column) {
                $slugs[] = $this->_createFilter()->sanitize($this->$column);
            }

            $this->slug = implode($this->_separator, array_filter($slugs));
        }

        //Canonicalize the slug
        if($this->_unique) {
            $this->_canonicalizeSlug();
        }
    }
protected function _createSlug ( ) { //Regenerate the slug if ( $ this -> isModified ( 'slug' ) ) { $ this -> slug = $ this -> _createFilter ( ) -> sanitize ( $ this -> slug ) ; } //Handle empty slug if ( empty ( $ this -> slug ) ) { $ slugs = array ( ) ; foreach ( $ this -> _columns as $ column ) { $ slugs [ ] = $ this -> _createFilter ( ) -> sanitize ( $ this -> $ column ) ; } $ this -> slug = implode ( $ this -> _separator , array_filter ( $ slugs ) ) ; } //Canonicalize the slug if ( $ this -> _unique ) { $ this -> _canonicalizeSlug ( ) ; } }
Create the slug

@return void
Create the slug