sfPropelAutoAliasBehaviorPlugin - 1.0.0

This plugin enble you tou easyly add alias on an Peer Object For example to alias page if you're page's title seems to this is My Supër Page your alias will look like my-super-page, if you have set "" else if you set my page your alias will look like my-page.

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
This plugin is deprecated and is not maintained anymore. Use sluggable behavior instead
Show source | Show as Markdown

sfPropelAutoAliasBehavior plugin

This plugin enble you tou easyly add alias on an Peer Object For example to alias page

if you're page's title seems to this is My Supër Page your alias will look like my-super-page, if you have set "" else if you set my page your alias will look like my-page.

Th alias is UNIQUE, if you set two page with the same title the firts alias would be my-alias and the second my-alias2

Instalation

  • Install the plugin

      symfony plugin-install http://plugins.symfony-project.com/sfPropelAutoAliasBehavior
    
  • If you didn't enable it before, enable Propel behavior support in propel.ini:

      propel.builder.AddBehaviors = true
    
    
    
      <?php
        // lib/model/pages.php
        class pages
        {
        }
    
        $columns_map = array('id' => pages::ID,
                             'alias' => pages::ALIAS,
                             'auto_alias'=>pages::TITLE);
    
        sfPropelBehavior::add('pages', array(
          'sfPropelAutoAliasBehavior' => array(
            'columns' => $columns_map
          )
        ); 
    

    Nota: the auto_alias column is for autoGeneration alias if it's empty