Welcome Guest, Not a member yet? Register   Sign In
How to create Helper File
#1

[eluser]BD-CI-Programmer[/eluser]
Step # 1
Create a file at your helpers folder (system/helpers). File name will be filename_helper.php like this.

Now let create a file name test_helper.php and save it on your helpers folder.

Code:
<?
function hello_nahid()
{
echo "I am Nahid";
}
?>

Step # 2


Create a controller (test_help.php) on you controller folder.

Code:
<?php
class test_help extends Controller
{
    function test_help()
    {

        parent::Controller();

    }

function index()
{

$this->load->helper('test');
echo $str = hello_nahid();

}


}
?>

Now run the application http://localhost/ci/index.php/test_help

Out Put will be “I am Nahid”


Messages In This Thread
How to create Helper File - by El Forum - 04-25-2008, 10:02 PM
How to create Helper File - by El Forum - 04-25-2008, 10:13 PM
How to create Helper File - by El Forum - 04-26-2008, 12:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB