Create controller for frontend module in magento1

Note:- you can download code from this rar_image
Note -1) Firstly Disable all cache from the Cache Management tab in System tab.
2) select the default theme of the Magento from the System->Design.

Step1:- Create Mywork_Usecontroller.xml file in app/etc/modules/.
where Mywork is Namespace and Usecontroller is Modulename.
[php]
<?xml version="1.0"?>
<config>
<modules>
<Mywork_Usecontroller>
<active>true</active>
<codePool>local</codePool>
</Mywork_Usecontroller>
</modules>
</config>
[/php]
Note:- 1) If you want to active the extensions then use true otherwise false.
2) there are three code pool (a) local (b) core (c) community
when we create the own extension then we use local code pool.

Step2:- Now create the config.xml file in app/code/local/Mywork/Usecontroller/etc/config.xml
[php]
<?xml version="1.0"?>
<config>
<modules>
<Mywork_Usecontroller>
<version>1.0.0</version>
</Mywork_Usecontroller>
</modules>

<frontend>
<routers>
<usecontroller>
<use>standard</use>
<args>
<module>Mywork_Usecontroller</module>
<frontName>usecontroller</frontName>
</args>
</usecontroller>
</routers>
</frontend>
</config>
[/php]
Note:- 1) In this file we created version of this module is 1.0.0
2) In the frontend tag we created routers tag. In routers tag we define the frontend name is usecontroller,
and we access the extension value from siteurl/usecontroller.

Step3:- Now we create the IndexController.php in app/code/local/Mywork/Usecontroller/controllers/IndexController.php
[php]
<?php
class Mywork_Usecontroller_IndexController extends Mage_Core_Controller_Front_Action {

public function indexAction() {

echo ‘hello index action call on index controller’;

}

public function myinfoAction() {

echo ‘hello myinfo action call on index controller’;

}
}
?>
[/php]

Step4:- Now we create the GetvalueController.php in app/code/local/Mywork/Usecontroller/controllers/GetvalueController.php
[php]
<?php
class Mywork_Usecontroller_GetvalueController extends Mage_Core_Controller_Front_Action {

public function indexAction() {
echo ‘hello index action call on Getvalue Controller’;
}

public function myinfoAction() {
echo ‘hello myinfo action call on Getvalue Controller’;
}
}
?>
[/php]

Note:- Call the url:-
1) siteurl/usecontroller/ Output:- hello index action call on index conroller
2) siteurl/usecontroller/index/myinfo Output:- hello myinfo action call on index conroller
3) siteurl/usecontroller/index/getvalue Output:- hello index action call on Getvalue Controller
4) siteurl/usecontroller/index/getvalue/myinfo Output:- hello myinfo action call on Getvalue Controller