codeigniter-2

How to get current date in codeigniter

耗尽温柔 提交于 2021-02-07 12:48:18
问题 How to get current date in codeigniter in YY-mm-dd format. I wants to get current date in YY-mm-dd frmat and put this value into input text box 回答1: You can use the PHP date function. date('Y-m-d'); Up to my knowledge, there is no separate date function in codeigniter. EDIT : But if you want date in this format 13-04-05 [ yy-mm-dd ] , Try this date('y-m-d'); For more date formats, check this link PHP Date Formats 回答2: Try to use this is a generic format of DateTime echo date('Y-m-d H:i:s');

Anyone tested Codeigniter 2.2 on php 5.6?

不羁的心 提交于 2021-01-27 21:04:09
问题 just curious to know, has anyone tested CodeIgniter application on PHP 5.6? We are upgrading our server from 5.3.3 to 5.6 currently running CodeIgniter 2.2 . Will that be fine? if yes, I would really appreciate if you post your feedback what performance change you have encountered 回答1: I have a live site using CI 2.1.3 with php 5.6 that has been running smoothly for more than a year (maybe longer). No CI related problems that I can recall. 来源: https://stackoverflow.com/questions/40051122

What is CI_Controller built_in class? whether it is abstract or not?

匆匆过客 提交于 2021-01-20 09:37:53
问题 I have searched alot that what is CI_Controller class? Actually, it is a base class and all controllers extend from CI_Controller class in codeigniter? Whether, it is abstract class or not? 回答1: in your directory structure open system->core->controller.php you will see the class name is CI_Controller 来源: https://stackoverflow.com/questions/43602164/what-is-ci-controller-built-in-class-whether-it-is-abstract-or-not

What is CI_Controller built_in class? whether it is abstract or not?

和自甴很熟 提交于 2021-01-20 09:36:49
问题 I have searched alot that what is CI_Controller class? Actually, it is a base class and all controllers extend from CI_Controller class in codeigniter? Whether, it is abstract class or not? 回答1: in your directory structure open system->core->controller.php you will see the class name is CI_Controller 来源: https://stackoverflow.com/questions/43602164/what-is-ci-controller-built-in-class-whether-it-is-abstract-or-not

function inside a view in codeigniter

十年热恋 提交于 2020-05-15 04:52:09
问题 i'm a newbie in ci , can anyone help me or give some suggestions in my code and best practice? i have a foreach statement that require to use a function for displaying a huge data. here's my sample code of view. Thank you in advance foreach($data->result() as $d){ if($d->condi){ $sample = myfunction($d->value1, $d->value2, $value->3); } else{ $d->otherdisplay; if($d->condition2){ $sample = myfunction($d->value1, $d->value2, $value->3); } } } function myfunction($a,$b,$c){ /*do something;*/ }

How do I fully refresh the page in CodeIgniter?

我的未来我决定 提交于 2020-04-15 07:22:06
问题 I am loading a form in an overlay. The overlay has a separate controller and action to the page that invokes the overlay. On form submit, if successful, I simply want to reload the referring page that the overlay was loaded from. I can get the referring page to load, but it places the content inside the overlay. header("Location: www.example.com", true, 302); does not work. Using the URL helper like this: $url = $_SERVER['HTTP_REFERER']; redirect($url); Also does not work. Every time it loads

stop page load in codeigniter jquery + ajax bookmark function

自作多情 提交于 2020-03-04 23:07:13
问题 I'm working on a bookmarking function (codeigniter, jquery, ajax). Below is the HTML for the form and the jQuery code. Here's what's happening: form is submitting the data to the database the page is reloading I'm not getting the success alert If I use e.preventDefault() or return false, the page doesn't reload and I get the success alert, but the data that gets passed to the database is 0. HTML FORM <?php echo form_open('bookmarks/addBookmark'); ?> <?php echo form_hidden('bookn', $bname); ?>

CodeIgniter Extended Core Controller

和自甴很熟 提交于 2020-01-25 21:32:07
问题 I'm stumped on this one. With my CodeIgniter application set up on a WAMP server locally, everything is fine. All of my classes extend my controller (MY_Controller) However, when the application is on the live environment which is Linux based, it throws an error that the MY_Controller class doesn't exist. Have I forgot about a configuration variable somewhere or something like that with a path to the application/core folder? I've looked for other threads with the same issue across Google,

changing url displayed to user in codeigniter

别来无恙 提交于 2020-01-25 08:13:28
问题 I don't know if this is strange request or not, but I have a page with users profiles displaying. Each user has unique username of course and those are included in links to associated with their names. when clicked it goes to their profile: profile/profile_guest/username When the user clicks on one of the profiles, it goes to user's profile and url in the address bar is: http://domain.com/profile/profile_guest/ahlam What I want to achieve is to configure routes.php to handle this. so once

How to get the class from which a request originates in codeigniter

五迷三道 提交于 2020-01-25 00:18:45
问题 My modules all extend Backend controller which checks if loggedin and redirects appropriately, now I have Class FrontEnd [responsible for pages like login, signup etc] which extends My_Controller. how can I create an exemption for FrontEnd to be able to access the modules since it needs their methods to perform tasks. this is what I have currently .... class Backend_Controller extends MY_Controller { // -------------------------------------------------------------------------- public function