Articles → PHP CODEIGNITER → Helper Functions In Codeigniter
Helper Functions In Codeigniter
Purpose
Example
- Load the helper functions in the controller.
- Call the anchor helper function in the view.
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class users_list extends CI_Controller
{
public function Index()
{
$this
->load
->helper('url');
$this
->load
->view('users');
}
}
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<div id="container">
<?php echo anchor('http://Gyansangrah.com', 'Gyansangrah');?>
</div>
</body></html>
Output
Click to Enlarge