• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can i pass complete language to a view

#1
hello

i have $data which including my datas from mysql.

i want to pass language to a view with $data



Code:
$this->lang->load($settings->website_language . '_lang', $settings->website_language); 
$this->load->view('templates/' . $settings->template.'/'.$where["loadfile"], $data);



how can i do that?

and i want to use parser->parse instead of load->view. may i parse view with data and language?
Reply

#2
It's easier to use lang helper function - it has access to the full language file without need of poluting view data object.

https://www.codeigniter.com/userguide3/h...elper.html
Reply

#3
(02-14-2016, 07:53 AM)siburny Wrote: It's easier to use lang helper function - it has access to the full language file without need of poluting view data object.

https://www.codeigniter.com/userguide3/h...elper.html

I've read this page, maybe 100 times, but I can't see this code


Code:
$this->load->helper('language');


after add this code to my controller problem solved. Another question if it's possible

i dont want to use php code in my template files. may i user parser for lang files?

maybe 


Code:
{lang->lang1} etc..

instead of


Code:
<?php echo lang("lang1") ?>


is this possible?
Reply

#4
I don't it's possible like that.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.