codeigniter-2

Layout.php is not showing the header.php part

孤街醉人 提交于 2020-01-07 09:04:06
问题 I have Html like below. <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <!-- Meta, title, CSS, favicons, etc. --> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> </head> <body style="background:#F7F7F7;"> <div class=""> </div> </body> </html> I divided this html in two PHP files. So.There is Header.php . Like Below. <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <!-- Meta,

Dropdown required not working in codeigniter

喜欢而已 提交于 2020-01-07 03:01:11
问题 I want to make the mail is field required, but somehow its not working, am i missing something? <div class="col-md-5 "> <div class="control-group form-group"> <label class="control-label"> Escalation Email Ids </label> <div class="controls"> <?php $options=a rray(); if(count($useridsoptions)){ foreach($useridsoptions as $key=>$val){ $options[$key]=$val; } } echo form_dropdown('esc_users[]', $options, explode(",",$row->esc_users),'id="esc_users" class="form-control function col-md-12 select2",

Codeigniter template class: check if pseudo variables have a value

ぃ、小莉子 提交于 2020-01-07 02:36:08
问题 Not sure if it's possible, but can you use if statements inside a template? So if a phone number does not have a value I don't want to display that sentence at all... <!DOCTYPE html> <html lang='en'> <head> <meta charset="utf-8"/> <title>{form_title}</title> </head> <body> <p>You received the following message from {name} through the Gossip Cakes' contact form.</p> <p>Their email is {email}</p> <p>Their phone number is {phone}</p> <p>The message: {message}</p> </body> </html> I guess I could

CodeIgniter Rewrite URL: remove index.php from url

点点圈 提交于 2020-01-06 20:01:50
问题 My apps url is http://localhost/myapp/admin/index.php/projects and I want to rewrite it as http://localhost/myapp/admin/projects I followed user guide RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] for this but not work for me. 回答1: Please follow these steps: 1- If you work on localhost please enable mode_rewrite in php.ini 2- Create a .htaccess file under project folder and paste this (please change 'project' to your project folder name

How do I get php-mysql for php 5.4.23 while it's conflicting with php-common 5.3.28?

社会主义新天地 提交于 2020-01-06 18:12:12
问题 Php-mysql package for php 5.4.23 is conflicting Debuging line by line into the framework I now have found that the constructor at 1 level goes to initialize database() and finally it tries connection with mysqli_connect but I now see that my php5.4.23 generates undefined mysqli_connect()..wow! Now I'm trying to install php-mysql for php 5.4.23 but it gives ~>sudo yum -y php54 php-mysql Error: php54-common conflicts with php-common-5.3.28-1.2.amzn1.x86_64 You could try using --skip-broken to

how to implement react js in codeigniter

☆樱花仙子☆ 提交于 2020-01-06 18:08:43
问题 can i implements react.js in codeigniter i have try but if i load file.js there is a 403, i'm new in react.js can someone help me this is my structure file if i load header.js i see error 403 access denied: this my header.php file <div class = "tes"> </div> <script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.min.js'></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.min.js'></script> <script src="<?php echo base_url('application/views

Unable to access assets folder in Codeigniter

孤街醉人 提交于 2020-01-06 09:57:30
问题 My directory structure is as follows: -application -system -assets --images --downloads --css index.php I created assets as suggested on stackoverflow ,I wanted to restrict access to downloads so placed .htaccess file in assets folder with the following directive Deny from all now its protected but as assets has css files and those are also not accessible too. 回答1: Try to put the htaccess file to downloads file 来源: https://stackoverflow.com/questions/18316445/unable-to-access-assets-folder-in

Unable to access assets folder in Codeigniter

情到浓时终转凉″ 提交于 2020-01-06 09:56:31
问题 My directory structure is as follows: -application -system -assets --images --downloads --css index.php I created assets as suggested on stackoverflow ,I wanted to restrict access to downloads so placed .htaccess file in assets folder with the following directive Deny from all now its protected but as assets has css files and those are also not accessible too. 回答1: Try to put the htaccess file to downloads file 来源: https://stackoverflow.com/questions/18316445/unable-to-access-assets-folder-in

CodeIgniter returns 404 for all routes but works

别说谁变了你拦得住时间么 提交于 2020-01-05 10:10:04
问题 I have strange problem with CodeIgniter and routing system and can't find solution for it, so: I have several routes such as 'forum/(:num)' => 'forum/category/$1', 'forum/(:num)/(page:any)' => 'forum/category/$1/$2', and them works, but return 404 code in header. I mean I don't get 404 page, correct HTML returns and page's content displays correctly for my forum's categories. But I'm getting 404 in header (Network tab in Firebug), so I can't work with POST data correctly. If I request /forum/

CodeIgniter Undefined property when loading a model [duplicate]

蓝咒 提交于 2020-01-05 08:13:34
问题 This question already has answers here : Codeigniter - I am looking to use/connect to a different database for one of my controllers and one model (3 answers) Closed 6 years ago . I'm receiving the following errors whilst trying to implement a very simple model controller in codeigniter. I'm new to the framework but as far as I can see this should work. I've also tried auto loading the model. I am autoloading the database library. Message: Undefined property: User::$user_model Fatal error: