codeigniter - How to get data from controller to view -
i have function in controller
function test() { $data['lang'] = read_file(apppath . "language/bahasa/english.php"); $this->load->view('test', $data); } english.php
<?php if ( ! defined('basepath')) exit('no direct script access allowed'); $lang['content.home'] = 'home'; $lang['content.about_us'] = 'about us'; $lang['content.team'] = 'team'; $lang['content.contact'] = 'contact us'; how data $lang['content.home'] = 'home' in view
why writing own method retrieving language files? there language class handle you.
using $this->load->view('test', $data) right way properties of $data view. said, if read_file() usage working, data in view in $lang['content.home'], etc.
Comments
Post a Comment