codeigniter-2

Codeigniter multiple views in one view

允我心安 提交于 2019-12-04 05:46:57
I am working on a web application. This might be a silly question, but I want to know whether I am taking the good approach to this or not. I want to have multiple views on one single view/page. The Codeigniter documentation says that "A view is simply a web page, or a page fragment, like a header, footer, sidebar, ...". I want to have a header, some quick search view, some other view and a footer for a example. Should I implement a controller to every view (header, quick search, footer, ...), or is it better to implement every view functions in a single controller? For instance, if I know

CodeIgniter index.php URL rewriting OVH

给你一囗甜甜゛ 提交于 2019-12-04 05:09:25
问题 I readed a lot of topics about this subject but no one worked. First i share my configs: Vhost file: <VirtualHost *:80> ServerName lacangolf.raphaelaupee.fr DocumentRoot "/var/www/raphael/lacangolf/public_html" <Directory /var/www/raphael/lacangolf/public_html> Options FollowSymLinks AllowOverride All </Directory> #ErrorLog #LogLevel warn ServerSignature Off </VirtualHost> .htaccess file: RewriteEngine on RewriteCond $1 !^(index\.php|assets|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L]

How to display image from database in CodeIgniter?

会有一股神秘感。 提交于 2019-12-04 04:57:20
I am using CodeIgniter 2.1.0 and MySQL database. I have uploaded an image through a form and successfully stored it in a uploads directory and I have also successfully stored the full path of the image in my database. but i am having problem with showing the image by calling the full path from my database. Here is my code for the upload: $image_path = realpath(APPPATH . '../uploads'); $config = array( 'allowed_types' => 'jpeg|png|gif|jpg', 'upload_path' => $image_path, 'max_size' => 2097152, 'overwrite' => TRUE, 'file_name' => '_' . $i . '_' ); $this -> load -> library('upload', $config); When

codeigniter setting session variable with a variable not working

喜夏-厌秋 提交于 2019-12-04 04:44:20
问题 Using codeigniter running locally on WAMP and dealing with sessions. I tried the default session handler, db session, native session and now db session. They all result in the same issue and I can't for the life of me figure it out. The problem is that I am trying to set a session variable using a variable. I have confirmed the variable and have echoed it out and all is well in the controller. The controller calls on a view and the variable is there as well. The view calls on a uploader file

Use session data in Hook in CodeIgniter 2.1.0

别等时光非礼了梦想. 提交于 2019-12-04 04:16:33
问题 I am using CodeIgniter with version 2.1.0. I want to use Hooks for login authentication. That means I want in every controller check the session data if loggedin or not. So I want to use hooks. I do the following code for doing that: In config file $config['enable_hooks'] = TRUE; In file hooks.php $hook['post_controller_constructor'][] = array( 'class' => 'SessionData', 'function' => 'initializeData', 'filename' => 'loginHelper.php', 'filepath' => 'hooks', 'params' => array() ); In file

click jquery button + send data without form - bookmark

坚强是说给别人听的谎言 提交于 2019-12-04 03:11:19
问题 I'm working on a bookmarking function where the user clicks on a jQueryui button and certain information is sent to the database. But I'm not using a form, because there is no information for the user to enter. I'm pulling the user's ID from the session data, and I'm sending a URI segment (portion of the URL) Using codeigniter/php. I'm trying to figure out what to put in the data portion of the ajax/post function, since there's no form/no data entered, and what to do about the "submit" part

Is there any forum in codeigniter php? [closed]

和自甴很熟 提交于 2019-12-03 22:13:54
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 10 months ago . Is there any forum software based on codeigniter ? free or commercial ? John Mellor I haven't tried either of these myself but i've heard very good things and you should take the time to investigate them both: Dove Forums Dove Forum is fairly new, but growing and seems to have fairly strong support from the Code Igniter community at the moment. Pyro CMS Pyro CMS is made by some of the top

Reflect MySQL polymorphic association in Doctrine 2.2

℡╲_俬逩灬. 提交于 2019-12-03 21:51:43
I'm using Doctrine 2.2.0 together with Codeigniter. I'm new to Doctrine (or to ORM in general). I'm setting up entity and proxy classes based on YAML files which works fine. I do have problems in reflecting a polymorphic association in my DB in my Doctrine classes. I'm looking for a concrete example on how to implement the following polymorphic association in Doctrine. In my DB I have a table called products. Depending on the value of field object_type and object_id I want to relate either to a record in the table videos or the table cars (I simplified it here). I want to keep both product

CodeIgniter 2 + Zend 2 library barcode

点点圈 提交于 2019-12-03 21:26:35
Problem: rendering barcodes in CodeIgniter via Zend library barcode. I googled, and also tried all tutorials on first 2 pages. I stackoverflowed and found quiet a few topics on my problem, even few are marked as answered but no luck. Finally I tried this https://stackoverflow.com/a/15480779/1564365 but yet another error message. error: Fatal error: Class 'Zend\Barcode\ObjectPluginManager' not found that means it is actually loading Barcode library but with error. sidenote : ZF 2.2 fresh download (today), CI 2.1.3 fresh download (today) To solve this, I am forced to use ZF1. step by step:

How to detect HTTP method in CodeIgniter

你。 提交于 2019-12-03 18:57:14
问题 How can I detect HTTP method in CodeIgniter controller class? Edited: Is there any other way than using $_SERVER['REQUEST_METHOD'] in CodeIgniter? 回答1: Thanks to Branden, I've found the answer. $this->input->server($index) is identical to $_SERVER[$index] . To get method you can use: $this->input->server('REQUEST_METHOD') . UPDATE: (thanks to Ecir Hana) As of CodeIgniter 3, using of method is also possible: echo $this->input->method(TRUE); // Outputs: POST echo $this->input->method(FALSE); //