How To Access The Action And Controller

Hello Friends,

I have a default controller named SiteController with some actions in it like: index, aboutcompany etc

When I open my site in browser like: localhost/lucky

The index action is working properly.

On index.php (view) i made a link: echo CHtml::link(‘About Company’, array('site/aboutcompany));

When I click on the link an error appears: The requested url not found on this server.

None of the actions (sitecontroller) are workin except index.

Please suggest me the solution

Hi Lalitesh, You can try like this

In view: use direct html code


<a class="ftlink" href="?r=site/aboutus">About Us</a>

In controller Action:


public function actionAboutus() {

		$this -> layout = 'layout1';

		$this -> render('pages/aboutus');

	}

cheers…

[color="#556B2F"]/* Moved from "Indonesian" to "General Discussion for Yii 1.1.x" */[/color]