codeigniter-url

Codeigniter Dynamic Routing

心已入冬 提交于 2019-12-06 09:27:37
Hi i wont to make something like that. http:// example.com/ - Main Controller http:// example.com/rules/ - Main Controller where content get from database, but if not exist return 404 page. (It's ok, isn't problem.) But if i have subfolder in application/controlles/rules/ I want to redirect it to Main Contorller at Rules folder. This follow code can solve problem, but i don't know how it right realise. At routes.php: $route['default_controller'] = "main"; $route['404_override'] = ''; $dirtest = $route['(:any)']; if (is_dir(APPPATH.'controllers/'.$dirtest)) { $route['(:any)'] = $dirtest.'/$1';

Are non-english characters 100% supported in codeigniter urls by default?

血红的双手。 提交于 2019-12-06 09:23:33
问题 I want to be sure if this behavior is 100% supported in CodeIgniter. What doubts me is that in config.php the permitted_uri_chars is as followed: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; It says that only English chars are allowed. BUT consider the results of following urls: http://localhost/codeigniter/index.php/controller/method/hell0-there+++ Result: The URI you submitted has disallowed characters. http://localhost/codeigniter/index.php/controller/method/hello-سلام Result: No

Add URI Segment for Language in Codeigniter

不羁的心 提交于 2019-12-06 06:16:29
I have a site; I need to develop to support multiple languages, for example en, tr, ar, sp, etc. But the problem is , what is the best way to do it with Codeigniter? I have a controller ( SITE ). I have a lot of functions LIKE ( hotel , city , page , blog ) I want to before this method add a segment ( language ). This is old links http://example.com/hotel/mariot http://example.com/hotel/hilton http://example.com/city/london http://example.com/city/paris ... .. and I want the links to be like this http://example.com/en/hotel/mariot http://example.com/ar/hotel/mariot http://example.com/sp/hotel

mod_rewrite to remove index.php from Codeigniter in subdirectory

爱⌒轻易说出口 提交于 2019-12-05 09:27:06
问题 Codeigniter applications commonly use mod_rewrite to exclude the string index.php from the url. I have two Codeigniter applications within the same domain. One Codigniter application is in the web root folder, another Codigniter application is in a subfolder of the web root folder. Codeigniter application 1: http://domain.com/index.php Codeigniter application 2 (the landing page application): http://domain.com/land/index.php The two Codeigniter applications are each atomic and do not share

array_unique showing error Array to string conversion

时光怂恿深爱的人放手 提交于 2019-12-04 22:14:48
For getting the unique values i am using unique values. Below is the code i am using array_unique($results_external); aasort($results_external,"created_on"); $returns_buy_external[]=array_reverse($results_external, true); If i use the code like this, below is the error i am getting A PHP Error was encountered Severity: Notice Message: Array to string conversion Filename: models/product_model.php Line Number: 3550 3550 line is array_unique($results_external); Can anyone help me, why it is getting error like this and how to solve it? results_external sample format coming is below Array ( [0] =>

Passing multiple optional parameter/value pairs with user defined pair order

人盡茶涼 提交于 2019-12-04 19:59:41
Say user is going to search on 4 or 5 fields, ok? eg. he might want to search by firstname, email, mobile or even page number I want that codeigniter's url be like this: site.com/Controller/Method/variable1/value1/variable2/value2/variable3/value3 or site.com/Controller/Method/variable2/value2/variable3/value3/variable1/value1 (that they should have the same result) or in this format site.com/Controller/Method/variable2/value2/variable4/value4 some examples to clarify my question: site.com/user/search/firstname/John/mobile/123/page/2 or: site.com/user/search/lastname/Smith/email/gmail.com In

Are non-english characters 100% supported in codeigniter urls by default?

给你一囗甜甜゛ 提交于 2019-12-04 17:16:38
I want to be sure if this behavior is 100% supported in CodeIgniter. What doubts me is that in config.php the permitted_uri_chars is as followed: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; It says that only English chars are allowed. BUT consider the results of following urls: http://localhost/codeigniter/index.php/controller/method/hell0-there+++ Result: The URI you submitted has disallowed characters. http://localhost/codeigniter/index.php/controller/method/hello-سلام Result: No problem!!! The word سلام (which is in Persian and means "hello") cannot be accepted by the pattern 'a-z 0

Route to redirect to a controller + an action by default on CodeIgniter?

偶尔善良 提交于 2019-12-04 15:05:42
I'm currently working on a project with Codeigniter. I have one controller called Cat class Cat extends CI_Controller { function __construct(){ parent::__construct(); } function index($action){ // code here } } and a route (in routes.php) $route['cats/:any'] = 'cat/index/$1'; And that works if I use this URL for example: http://www.mywebsite.com/cats/display Nevertheless, if the user changes the URL to http://www.mywebsite.com/cats/ it doesn't work anymore. Codeigniter writes: 404 Page Not Found - The page you requested was not found. So my goal is to redirect him to http://www.mywebsite.com

mod_rewrite to remove index.php from Codeigniter in subdirectory

旧街凉风 提交于 2019-12-03 21:40:25
Codeigniter applications commonly use mod_rewrite to exclude the string index.php from the url. I have two Codeigniter applications within the same domain. One Codigniter application is in the web root folder, another Codigniter application is in a subfolder of the web root folder. Codeigniter application 1: http://domain.com/index.php Codeigniter application 2 (the landing page application): http://domain.com/land/index.php The two Codeigniter applications are each atomic and do not share any files between them. Every file in the Codeigniter framework is in public_html/ and again in public

How would i create a vanity url in codeigniter

雨燕双飞 提交于 2019-12-03 21:22:56
How can i create a vanity url in codeigniter. Im having real trouble doing this in the framework. And there doesnt seem to be any good answers out there. It's possible, I'm using this in one of my projects... Here is a thread on the CodeIgniter forums showing how to do it... http://codeigniter.com/forums/viewthread/113962/ According to Personalized User Vanity URL's in CodeIgniter , you can accomplish this by modifying your routes file: $handle = opendir(APPPATH."/modules"); while (false !== ($file = readdir($handle))) { if(is_dir(APPPATH."/modules/".$file)){ $route[$file] = $file; $route[