A plugin to automatically generate user friendly url keys from model objects. You can configure the plugin to use a text column to generate url keys and to store in another column or plugin's own table. You can also retrieve your objects using utility classes.

Developers

License

Copyright (c) 2007 Hoydaa Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Installation

Activate the behavior for one of your Propel models, specifying the name of the source column
and/or target column. The behavior has two possible use cases. You can either store stripped
title in a column you specified as target_column on the same table as your model or you can
let the behavior to handle it in behavior's own table. Do not choice the second option if you
have performance issues, because every time $my_obj->getFriendlyUrl() method is requested on the
background the this value will be brought from this table and that will cause a couple of extra
sql executions.

There is no extra configuration, the behavior will bound a new method to the model object. In
order to get the stripped text you can call getFriendlyUrl method on your model object.

$my_model_object->getFriendlyUrl();

Unfortunately, as of PHP 5, static method calls cannot be caught by a __call(). This means
that symfony behaviors are not able to add new methods to the Peer classes. This means that
it is not possible to bound a static method like retrieveByFriendlyUrl to Peer class. However
there is a utility class with one method retrieveByFriendlyUrl, you can use this method to
retrieve your model object using it's friendly url.