
Codeigniter / CakePHP
文章平均质量分 82
iteye_5904
这个作者很懒,什么都没留下…
展开
-
codeigniter + Ajax (亲测)
(E文,没时间翻译)首先做一个Ajax的helper,下面是说明,很简单,粘贴复制就可以了。。。<?php if (!defined('BASEPATH')) exit('No direct script access allowed');function is_ajax(){ return isset($_SERVER['HTTP_X_REQUE...2009-12-10 10:42:12 · 455 阅读 · 0 评论 -
利用 Cache_Lite代替codeigniter中的cache功能
codeigniter的功能纵然强大,也有不足之处。其cache模式在于针对不同的uri就会生成cache文件,如果URL中参数不同,则cache文件就会不同,从而产生了漏洞。如果访问者构建自动生成URI,不断向服务器发起请求,就会瞬间产生大量的垃圾文件,导致系统文件臃肿。 参看CI中国论坛:脆弱的CI缓存系统,1天攻陷你的CI网站http://codeigniter.org.cn/f...2010-01-29 06:15:23 · 173 阅读 · 0 评论 -
CakePHP 中文手册
基本概念Section1 简介 本章节篇幅很短,简单的介绍一下MVC概念以及在cake中是如何实现的。如果你对MVC模式很陌生,这个章节将会非常适合你。我们由常规的MVC概念开始我们的讨论,然后用我们的方式在CakePHP中使用MVC模式,并且展示几个简单的示例。 Section 2 MVC模式 [TODO 考虑到MVC模式是必需过桥技能,所以建议还是先看一...2010-04-14 21:04:18 · 222 阅读 · 0 评论 -
codeigniter 生成 excel
Excel Plugin The following plugin will generate a tab-delimited file, and feed it to the client as an Excel file. $this->load->plugin('to_excel');$this->db->use_t...2010-04-19 00:33:46 · 155 阅读 · 0 评论 -
CKEditor Helper for CodeIgniter
Using CKEditor as a plugin in your CodeIgniter applicationsCKEditor is a powerfull WYSIWYG text editor licensed under the GPL, LGPL and MPL open source licenses. CKEditor can easilly be adde...2010-04-19 00:37:03 · 117 阅读 · 0 评论 -
实现简单 codeigniter 缓存 (cache)
代码 class Test extends Controller { function main() { // load the library $this->load->library('simple_cache'); // key is the name you have given to the cached data /...2010-04-30 23:47:13 · 425 阅读 · 0 评论 -
codeigniter 辅助函数 - 敏感词过滤
我们都知道有些敏感的词汇是不适合出现在互联网上的,特别是在有用户留言或发帖的一些站点,如博客或者论坛,如果出现了敏感词,那将是一件十分麻烦的事情。 所以如果你打算用CodeIgniter开发这类站点,对用户输入的内容就必须加以过滤(比如说将“和谐”替换为“河蟹”),因此本人就编写了这样一个辅助函数,这可是真真正正有“中国特色”的辅助函数,呵呵。原理很简单,本质上说就...2010-05-05 06:18:50 · 251 阅读 · 0 评论 -
CI集成 ckeditor 配置
配置ckeditor1.上传下载ckeditor文件和ckckfinder到网站根目录js目录下。2.ckeditor/ckeditor_php5.php 改名为ckeditor.php 放入libraries ,ckfinder/ckfinder.php 文件放入libraries 。3.controllers 使用 $this->load...原创 2010-05-23 01:34:05 · 207 阅读 · 0 评论 -
Codeigniter Grid 使用方法 (flexigrid)
来源:http://codeigniter.com/forums/viewthread/75326/P0/ Updated: 6 September 2008Although I love CI, I’ve decided to move this thread to http://groups.google.com/group/flexigrid/ A more ...原创 2010-05-23 02:05:25 · 109 阅读 · 0 评论 -
Create an Admin panel with CodeIgniter
Create an Admin panel with CodeIgniter As I see it there are three methods to creating an admin system using the MVC framework CodeIgniter. In this article I will show examples of the struct...原创 2010-05-23 02:15:29 · 173 阅读 · 0 评论 -
CakePHP 2.x十分钟博客教程
1. CakePHP2十分钟博客教程(一):安装与配置 Cakephp 2.0依然保持着Cakephp框架的各种优良传统,其中之一就是非常易于新手入门,几乎不做任何复杂的配置即可使用。非常可惜的是,Cakephp 2.0手册竟然没有了中文翻译,1.3的翻译又是有各种老,让想学习Cakephp同时英语又不是很好的同学们非常郁闷啦。这里我给大家带来 Cakephp的经典教程,十分钟博客创建,是...原创 2012-10-07 01:27:06 · 494 阅读 · 0 评论 -
cakephp 1.3 配置CakePHP
Section 1 数据库配置 app/config/database.php 这个文件包含了所有的数据库配置。新安装的Cake是没有datebase.php这个文件的,你需要从database.php.default复制一份过来并重新命名,内容如下: //app/config/database.php var $default = array('driver' =>...原创 2012-10-09 05:31:56 · 234 阅读 · 0 评论 -
cakephp 1.3 Controller
Controller一个controller用于管理应用程序里某一方面的逻辑。大多数来说,controller被用于管理独立model的逻辑。比如,当你想构建一个管理录像带的站点,你也许会有一个VideoController和一个RentalController分别管理你的录像带和租用记录。在Cake里边,controller的名字总是复数的形式。(译注:例如刚才提到过的VideoCon...原创 2012-10-09 05:49:11 · 142 阅读 · 0 评论 -
cakephp 1.3 Models
Section 1 What is a model? 什么是model呢?model就是MVC模式中的M。Model用来做什么呢?它将领域逻辑从表现层和独立的业务逻辑中剥离出来。Model通常是数据库的访问介质,而且更明确的指定于某一张表(译注:在rails框架中model扮演着active record的角色,因此同时承担着DAO对象的职责)。默认情况下,model使用的表名为mod...原创 2012-10-09 06:07:01 · 199 阅读 · 0 评论 -
cakephp 1.3 Views
Section 1 Views 视图 一个view是一个页面模版,通常按action的名字命名。例如,PostsController::add的view位于/app/views/posts/add.thtml。Cake view是非常简单的PHP文件,因此你可以在其中使用任何PHP代码。尽管你的大多数view文件包含HTML代码,一个view可以是对一个特定数据集的任意表示,XML,...原创 2012-10-09 06:12:22 · 115 阅读 · 0 评论 -
CodeIgniter 操作PDF ( Generating PDF files using CodeIgniter )
PDF files rock! Some of the programs used to view them could use some work, but the file format itself is real handy. As a programmer I have found PDF’s to be most helpful when generating reports th...原创 2010-01-03 04:03:59 · 267 阅读 · 0 评论 -
CodeIgniter 合作 Authorize.net
function payment(){// 略... // 核心内容如下 $data['loginID'] = "72FNXjZ35cjG"; $data['transactionKey'] = "75r3JMZv6TBUe92G"; $data['testMode'] = "false"; $data['amount'] ...原创 2009-12-30 00:25:12 · 141 阅读 · 0 评论 -
codeigniter view 试图里再引入view视图
引言:$this->load->view('header'); 那么在视图header里面再来一个$this->load->view('menu'); 显然这个会产生错误,以下是解决方案~~A lot of new CodeIgniter users have at one point asked, "How to lo...2009-12-12 00:33:36 · 427 阅读 · 0 评论 -
codeigniter 操作 图标
简单型 Charting Panaci: A Charting LibraryPanaci is an application library for CodeIgniter.If your application needs to output graphic charts at run-time, such as bar, line...2009-12-12 00:58:48 · 159 阅读 · 0 评论 -
CodeIgniter中引用某一个表情(smiley)
如果我们需要把smiley中的一个表情显示出来,不需要写上具体的image url的,直接用smiley helper中的一个函数:parse_smileys()if ( ! function_exists('parse_smileys')){function parse_smileys($str = '', $image_url = '', $smileys =...原创 2009-12-12 01:01:14 · 143 阅读 · 0 评论 -
CodeIgniter 的数据安全过滤全解析
由于对CI的SQL安全这些不放心,今天寡人啃了一下午的代码,算是对其机制比较了解了,为了让各位兄弟姐妹少走弯路,特将战果公布,希望大家喜欢。1.无论如何在获取参数之时都建设将 xss过滤打开,比如 $this->input->get('username',true); 其中的true就代表打开了 xss2.不要直接使用$_GET等类似方式获得数据,如果这样获取数据的话将不会...原创 2009-12-12 02:56:30 · 407 阅读 · 0 评论 -
在 CodeIgniter 中使用 jQuery 实现 AJAX
Jquery高效的开发速度,良好的封装和简洁而灵活的语法都给我留下了很深刻的印象。 而它的ajax类让开发ajax成为了一种乐趣。 你可以ajax类轻易的POST或者GET request。它能帮助用户完成codeigniter不能完成的功能。 CI的MVC 分离也做的非常的好,令人眼前一亮。但不可否认,ci也有它存在的问题。那就是对新技术的支持不够。类似json,...2009-12-12 03:09:50 · 331 阅读 · 0 评论 -
CodeIgniter中的FCKeditor的路径问题
CodeIgniter默认的根目录是index.php所在的目录。把fckeditor放在了根目录下(index.php所在的目录),之后看以下代码: 在 application/models 下建立一个公用的取得FCK的模:editor.php ,如下: function get_editor($name = 'content', $value = '', $t...2009-12-13 01:11:58 · 146 阅读 · 0 评论 -
codeigniter:去掉 URL 中的 index.php
去掉 URL 中的 index.php首先,你要清楚自己的 Web 服务器是 Apache,支持 mod_rewrite,并且已经配置好 rewrite 相关的参数。什么是 rewrtie 可以 Google 一下。然后,在 CI 根目录(与index.php同级)下新建立一个配置文件,命名为: .htaccess在里面这样写:...原创 2009-12-13 08:31:40 · 273 阅读 · 0 评论 -
CodeIgniter中URL含有中文字符串的解决方案
codeIgniter默认的配置下是不允许URL中包含非ASCII字符的,如果我们有这样一个字符串:http://www.example.com/photo/北京/鸟巢.jpg那么CI会毫不客气的告诉你:The URI you submitted has disallowed characters.你 可能会说,那我把这个URL使用函数urlencode一下呢?不行。因为W...原创 2009-12-13 23:11:22 · 137 阅读 · 0 评论 -
codeigniter:简单创建表单验证 Simple Form Generation in CodeIgniter
If you are using CodeIgniter, aswell as any other PHP framework, you may notice that building CRUDforms is one of the most bother and routine tasks. Probably 80% ofgeneral web applications use...原创 2009-12-13 23:29:57 · 138 阅读 · 0 评论 -
codeigniter: 显示提示信息 How do I display result or error messages in CodeIgniter app
Sometimes we need to display general messages or error messages to the user noticing about certain action, for example on success or failure.Imagine you are submitting a form and then creating...原创 2009-12-14 00:23:49 · 119 阅读 · 0 评论 -
codeigniter操作xml
This Simplexml class provides an alternative implementation of theSimpleXML API that works under PHP 4, so if you have an applicationthat is running under PHP4 environment this is really helpful f...原创 2009-12-29 06:57:46 · 194 阅读 · 0 评论 -
codeigniter 操作 Rss
I wrote a codeigniter library through which you can retrieve the rss feeds from xml fileAdd the below code in Rss.php file and save the file in application library folder , <?php if ( ! de...原创 2009-12-29 07:12:09 · 148 阅读 · 0 评论 -
CodeIgniter 操作 CSV
A Comma separated values (CSV) file is a computer data file used forimplementing the tried and true organizational tool, the CommaSeparated List. The CSV file is used for the digital storage of da...原创 2009-12-29 07:17:17 · 210 阅读 · 0 评论 -
CodeIgniter 合作paypal
<?phpclass Paypal extends Controller { function Paypal() { parent::Controller(); $this->load->library('paypal_lib'); } function index() { $this->form(); } ...2009-12-30 00:15:05 · 175 阅读 · 0 评论 -
CakePHP你必须知道的21条技巧
原文链接:http://www.avatarfinancial.com/pages/cake/这篇文章可以说是CakePHP教程中最经典的了。虽然不是完整的手把手系列, 但作者将自己使用CakePHP的经验总结了21条,这些尤其是对新手十分有用。翻译时故意保留了一些CakePHP中特有的词语没有翻译, 如controller、model等。相信学过CakePHP的人应该马上就能理解它们...原创 2012-10-19 06:25:39 · 126 阅读 · 0 评论