do you know if there is in Akelos a function to create an url alias for a title, deleting all punctuation, spaces, etc....?? I need it to include the title of a news item in the url... Thanks!
CommentAuthorarnoschn
Hi Delia,
I just added a plugin called acts_as_sluggable to the akelos trunk. We are using it in some projects and would like to share it. If you are using a recent akelos trunk version you can do the following to install the plugin in your application:
./script/plugin install acts_as_sluggable
Simple Usage example from the README:
class MyModel extends ActiveRecord { var $acts_as = array('sluggable'=>array('slug_source'=>'title','slug_target'=>'slug')); }
if you have the following model:
$model = new MyModel(); $model->title = "Vacations in France"; $model->save();
the $model->slug will be generated as:
echo $model->slug; ---- vacations-in-france ----
$model2 = new MyModel(); $model2->title = "Vacations in France"; $model2->save();