Help with Helpers in CodeIgniter

0

I'm starting with CodeIgniter. but I found a bump in my web application, it's just a hello world using own helpers. step code

controller

 <?php
defined('BASEPATH') OR exit('No direct script access allowed');
class CodigoFacilito extends CI_Controller {
    function __construct(){
        parent::__construct();
        $this->load->helper('mihelper');
    }
    function index(){
        $this->load->view('codigoFacilito/bienvenido');
    }
    function holaMundo(){
        $this->load->view('codigoFacilito/headers');
        $this->load->view('codigoFacilito/bienvenido');
    }
}
?>

View

<body>
    <h1>Llamado desde el controlador CF</h1>
    <?= getNombre()?>
</body>
</html>

Helper

<?
    function getNombre(){
        return "<h1>Daniel</h1>";
    }
?>

the truth is that the tutorial is very old and I do not know if coding is still used.  the error that comes to me is this

  

An uncaught Exception was encountered   Type: Error   Message: Call to undefined function getName ()   Filename: C: \ xampp \ htdocs \ CodeIgniter \ application \ views \ codeFacilito \ welcome.php   Line Number: 3   Backtrace:   File: C: \ xampp \ htdocs \ CodeIgniter \ application \ controllers \ CodeFacilito.php   Line: 15   Function: view   File: C: \ xampp \ htdocs \ CodeIgniter \ index.php   Line: 315   Function: require_once

I would really appreciate your help. greetings and thanks

    
asked by Dani Vil 06.07.2018 в 02:27
source

0 answers