Okay, I’m just started work with Yii recently. I have two questions.
I’m working on a website and want my pages to be dynamic so I CRUD’d (correct term???) a table name ‘page’ which basically has an id (pk), title (to be displayed), link title (title I want to be shown in the URL) and the actual content.
At the moment, to view a specific page, I use the following url: index.php?r=page/view&id=x where x is the page id (e.g. 1).
I’ve tried to change it to /page/x where x is the link title (e.g. about) however it doesn’t seem to be working. What exactly to I have to change for it to work in such a manner? I added the getUrl() property and have played around with the URLManager but I’m guessing I have to change something else before it’ll start working. Any ideas?
Second question is related to the home page. Instead of defaulting to index.php I want to change it to a specific page, e.g. page/view&id=1. If I change the defaultController to that, though, in the config file I get an error. I can change it to page fine, and it’ll list all the pages I have, but if I try to make it point to a specific page, it’ll give me an error. Any ideas on how to achieve this?