Articles → PHP CODEIGNITER → Helper Functions In Codeigniter

Helper Functions In Codeigniter






Purpose





Example




  1. Load the helper functions in the controller.
  2. 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


Picture showing the output of using URL library in codeigniter
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, July 20, 2020

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250