Closed Keshangit closed 4 years ago
I'm trying to pass data from controller to view in Codeigniter.
Report.php (Controller)
<?php defined('BASEPATH') OR exit('No direct script access allowed'); header('Access-Control-Allow-Origin: *'); class Report extends Public_Controller { function __construct() { parent::__construct(); } function index() {$data = array( 'title' => 'My Title', 'heading' => 'My Heading', 'message' => 'My Message' ); $this->load->view("templates/dashboard", $data); } }
dashboard.php(View file located in view/templates)
<div class="row"> <?php echo $title; ?> </div>
Those codes have executed an error
A PHP Error was encountered Severity: Notice Message: Undefined variable: title Filename: templates/dashboard.php Line Number: 4
I need to load title in the dashboard.php
Please post on our forums instead, this is a bug tracker.
I'm trying to pass data from controller to view in Codeigniter.
Report.php (Controller)
dashboard.php(View file located in view/templates)
Those codes have executed an error
I need to load title in the dashboard.php