controllers, models and views. When you want to use the CodeIgniter primitive class in your custom class, you can do this:First, define the CodeIgniter object to assign to a variable:$CI = get_instance();Once you define an object as a variable, you can replace it with that variable name $this :$CI = get_instance();$CI->load->helper(‘url‘);$
primitive class in your custom class, you can do this:First, define the CodeIgniter object to assign to a variable:$CI = get_instance();Once you define an object as a variable, you can replace it with that variable name $this :$CI = get_instance();$CI->load->helper(‘url‘);$CI->load->library(‘session‘);$
Load the editor under the CI Framework and now review the content. My frame filename is called CI1. Download Baidu Editor ueditor,http://ueditor.baidu.com/In general, download version ubuilder and copy the Ueditor to the root of the CI framework.The download Good editor directory is:-ueditor----Dialogs Popup dialog with the corresponding resources and JS file----Lang Editor internationalization-displayed fi
CI to index.php
Ci default rewrite URL is similar to this, for example, your CI root directory is under/codeigniter/, your below level two URL is similar to this http://localhost/CodeIgniter/index.php/welcome. Not too good-looking, how to take out the index.php?
1. Open the Apache configuration file, conf/httpd.conf:
LoadModule rewrite_module modules/mod_rewrit
In this paper, a complete implementation method of database fetching data for the introduction of CI framework is described. is for beginners to see, this is the simplest can be adjusted to the example. Share to everyone for your reference. The implementation method is as follows:
1. Download the CI framework
2. Configuration
database.php configuration:
To set the connection parameter for the database serv
We use the database configuration in the Laravel or CI framework and then take the data out of each controller. This is not with each native PHP single page write a mysql_contact, that is, each page to connect to the database once. The essence is different, that is, the PHP framework can be configured for us to configure a persistent data connection, reduce the database duplicate connection cost per page? Some people say that the frame is also connect
class blog_lib{ var $CI; var $posts_path; var $file_ext='.md'; var $_all_posts; var $_all_tags; var $_all_pockets; public function __construct($pathselect) { if (!isset($this->CI)) { $this->CI = get_instance(); } $this->posts_path = FCPATH.$pathselect; }
Controller:
public function index(){ $this->load->library('blog_lib');$data
CI framework AR operations (array form) implement the method of inserting multiple SQL data, ciar. CI framework AR operations (array form) to insert multiple SQL data. ciar this article describes how to insert multiple SQL data using CI framework AR operations. For your reference, the CI framework AR operation (array f
The current project is placed under the root directory to build the. htaccess file
Rewriterule ^ (. *) $/index.php/$1 [L]
This path can be removed index.php
But I put it under the CI file in the Level 2 directory.
Rewriterule ^ (. *) $/index.php/$1 [L]
Switch
Rewriterule ^ (. *) $/ci/index.php/$1 [L]
But I can't find the file directory.
What's the solution?
Reply to discussion (solution)
. htaccess fi
The so-called CI, is borrowed in terms of advertising. (CI is the abbreviation of the English corporate identity), which means to unify the image of the enterprise through vision. Real-life CI planning abounds, outstanding examples such as: Coca-Cola Company, the Global unity of the logo, color and product packaging, give us a very deep impression. More examples
The difference between site_url () and base_url () in the CI framework is site_urlbase_url. Differences between site_url () and base_url () in the CI framework. when using the CI framework, site_urlbase_url often encounters jump and Path Problems. site_url () and base_url () are easy to confuse, the differences between site_url () and base_url () in the
CI source code analysis (1)-config configuration file module, ciconfig(1) Usage(A) system-level configuration language, character encoding, session, cookie, and other configuration items
File Location: application/config. php
Loading Method: automatic loading
Call method: $ this-> config-> item ('config _ item_key ');
(B) configuration items used in the actual business at the business level, or constants, such as 1
File Location: application/c
CI go to index. php introduction: This is the detailed page of CI go to index. php. it introduces php, related knowledge, skills, experience, and some php source code.
Class = 'pingjiaf' frameborder = '0' src = 'http: // biancheng.dnbc?info/pingjia.php? Id = 339584 'Rolling = 'no'>
The default rewrite url of CI is similar to this. for example, if your
Let's take a simple look at the CI framework mvc. The sample code is as follows//CI controller file home.phpPHPdefined(' BasePath ') ORExit(' No Direct script access allowed '); To prevent the user from accessing the controller directly through the file path, it can effectively prevent the cross-site attack.classHomeextendsci_controller{//Inherit CI control class
controller reused.
So the task of each layer is clear:Model (DAO): The work of the data persistence layer, which is encapsulated in the operation of the database.Service: Business logic layer, responsible for business module logic application design, controller can invoke service interface to achieve business logic processing, improve the common business logic reuse, design to specific business implementation will call model interface.Controller: Control layer, responsible for specific busines
When the CI framework was first used, it was intended to write a series of CI-source reading notes, which, unfortunately, had not been acted on. Recently there are few projects, and finally there is some time to write something. Then prepare to record some of the previous notes and experience, on the one hand, the right to make a memo, on the other hand remind yourself: learn from learning and have a way ou
'', `value` mediumtext NOT NULL, `group` varchar(55) NOT NULL DEFAULT 'site', `autoload` enum('no','yes') NOT NULL DEFAULT 'yes', PRIMARY KEY (`id`,`key`), KEY `name` (`key`), KEY `autoload` (`autoload`)) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
Then, create setting. php In the application/libraries directory. The content is as follows:
* */Public function item ($ key) {if (! $ Key) {return FALSE;} // first check whether the system has automatically loaded if (isset ($ this->
This article mainly introduces the CI framework integration Smarty method, compares and analyzes and improves the existing methods on the Internet, and introduces in detail the specific steps and related skills of CI framework inheriting the Smarty template, for more information about how to integrate Smarty with the CI framework, see the example in this article.
This article mainly introduces how to use Hook to interpret the source code of the CI framework. the Function Extension Method of PHP files is analyzed. The Hook principle and the related skills of extending the CI framework are analyzed. If you need a friend, refer to the example in this article to describe how to use the Hook to interpret the source code of the CI
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.