dougou7008 2014-12-19 09:34
浏览 20

设置语言中的%s不起作用

When I submit my form I have set flash data, with a line from my language file. But I need to include the Uri segment which is the id in with it so it would out put like so Success: You have modified store id 20 settings!

Currently it shows id but in wrong place: Success: You have modified store id %s settings! 280

Language:

$lang['text_success'] = 'Success: You have modified store id %s settings!';

Set Flash Data

sprintf($this->session->set_flashdata('success', $this->lang->line('text_success') . $this->uri->segment(5)));

How can I make it so where the %s in language line the id will show when message is outputted?

  • 写回答

2条回答 默认 最新

  • douxi8119 2014-12-19 09:39
    关注

    Use this
    I assume $this->uri->segment(5) is your id

    $this->session->set_flashdata('success', sprintf($this->lang->line('text_success'), $this->uri->segment(5)));
    
    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效