`
baiyuxiong
  • 浏览: 179216 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

ci 2.0 Query Strings的 使用方法

    博客分类:
  • php
阅读更多
CI2.0可以很好的支持query strings了
可以像这样的方式访问控制器的方法
index.php?c=products&m=view&id=345

使用方法:
在application/config.php里配置:
//启用query string
$config['enable_query_strings'] = TRUE;
//控制器的参数名为c
$config['controller_trigger'] = 'c';
//方法的参数名为m
$config['function_trigger'] = 'm';

使用时链接就是这样了:
//c和m就是上面配置的两个trigger
index.php?c=controller&m=method

注意事项
如果使用query Strings的话,不能使用url辅助函数,需要自己构建URL,因为CI的URL辅助函数只是基于段格式的URL.即index.php/c/m/id这样的
分享到:
评论

相关推荐

    spring chm文档

    I. 核心技术 3. 控制反转容器 3.1. 简介 3.2. 容器和bean的基本原理 3.2.1. 容器 3.2.2. 实例化容器 3.2.3. 多种bean 3.2.4. 使用容器 3.3. 依赖 3.3.1. 注入依赖 3.3.2. 构造器参数的解析 3.3.3. bean...

    Spring-Reference_zh_CN(Spring中文参考手册)

    I. 核心技术 3. 控制反转容器 3.1. 简介 3.2. 容器和bean的基本原理 3.2.1. 容器 3.2.1.1. 配置元数据 3.2.2. 实例化容器 3.2.2.1. 组成基于XML配置元数据 3.2.3. 多种bean 3.2.3.1. 命名bean 3.2.3.2. 实例化bean ...

    Spring API

    使用@RequestParam绑定请求参数到方法参数 13.12.5. 使用@ModelAttribute提供一个从模型到数据的链接 13.12.6. 使用@SessionAttributes指定存储在会话中的属性 13.12.7. 自定义WebDataBinder初始化 13.13. 更多...

    Chinese Entity Linking Comprehensive

    LDC2014E83: TAC 2014 KBP Chinese Entity Linking Evaluation Queries and Knowledge Base Links V2.0 2. Contents ./README.txt This file ./data/2011/eval/tac_kbp_2011_chinese_entity_linking_...

    Spring中文帮助文档

    使用@RequestParam绑定请求参数到方法参数 13.12.5. 使用@ModelAttribute提供一个从模型到数据的链接 13.12.6. 使用@SessionAttributes指定存储在会话中的属性 13.12.7. 自定义WebDataBinder初始化 13.13. 更多...

    RxLib控件包内含RxGIF,全部源码及DEMO

    strings, dates, files, INI-files. 4. RX Library help files in Russian only. Help files in other languages do not exist. 5. A couple of simple demo applications. History ------- RX 2.75 (Oct,12,...

Global site tag (gtag.js) - Google Analytics