Url Problems

hi!

I am implementing the "Yii blog demo" in my website, but I found that the URLs of the posts appear like this: "this+is+a+post". However, I would like "this-is-a-post".

Please have a look at this URL and you will understand: www.yiiframework.com/demos/blog/index.php/post/6/My+Testing+Post

What could I do?

open models/Post.php and look for the getUrl method and change it


<?php

	# ... 

	public function getUrl()

	{

		return Yii::app()->createUrl('post/view', array(

			'id'=>$this->id,

			# change this

			'title'=>$this->title,

			# like so

			'title'=>preg_replace('|\s+|', '-', $this->title),

		));

	}

	# ... 

it worked!!! many thanks