Questions tagged [codeigniter-routing]

Questions about routing a particular URI, or pattern of URIs to a controller class and method, within the CodeIgniter PHP framework.

In CodeIgniter routes are defined in the application/config/routes.php file. Routes can simply be added to the array $route. CodeIgniter supports both wildcard and regular expression based routing rules in addition to static ones.

Read more in the CodeIgniter documentation.

245 questions
2
votes
3 answers

codeigniter autoload file issue

I have uploaded codeigniter file in my linux server using php version 5.5. I got issue on application\config\autoload.php file. $autoload['libraries'] = array(); //default code //$autoload['libraries'] = array('database'); When i run the program…
Narendra Verma
  • 195
  • 1
  • 13
2
votes
3 answers

how do i load codeigniter font awesome fontface url from outside of webroot?

I just started using codeigniter and have got it setup so that it does not require index.php as part of the URL. However, I noticed that the reference to font-awesome is not working correctly. The following is loading fine.
2
votes
3 answers

How to identify Routing rule that used that directed to my Codeigniter controller?

In my Application I have 3 routing rules (defined in routes.php file) thats directed to the one controller $route[urlencode('news')] = "news/show-news"; $route[urlencode('letters')] = "news/show-news"; $route[urlencode('papers')] …
Ahmed Nabil
  • 17,392
  • 11
  • 61
  • 88
2
votes
2 answers

Custom URI routing by query string with CodeIgniter?

I am looking to make a custom route using the CodeIgniter framework. I am trying to make the URL like so: http://localhost/accounts/Auth.dll?signin So far I have tried adding the following to my routes.php config…
2
votes
1 answer

What is the best practice to keep original URI after a function is called?

Goal: When I am on any url and I use functions like login, logout, post_Comment, etc. I want the URL to stay untouched. Example: Few parts of the code will be written in pseudo code, just to give a simple example of what is being done inside the…
2
votes
4 answers

Database driven routing in CodeIgniter 2.x

I am creating a site that will have a lot of routes that will need to be added to the routes file (800+) - obviously I do not want to manually add these one by one into the routes config file. Can anyone suggest the best practice to have my routes…
Zabs
  • 13,852
  • 45
  • 173
  • 297
2
votes
2 answers

Controller in subfolder cant be loaded

Morning all, Im having very troubles with controllers/uri and subfolders, the directory looks like this: application/ controllers/ d2/ mc/ cp/ --- login.php ... The routes.php is : $route["cp"]…
wiitohzjeh
  • 337
  • 1
  • 4
  • 15
2
votes
1 answer

remap codeigniter index method with optional arguments

In my codeigniter controller I have only index function with an optional argument. If argument exists I load a view, otherwise I load another one. I use this _remap function: function _remap($method){ $param_offset = 2; // Default to index …
pindol
  • 2,110
  • 6
  • 35
  • 52
2
votes
2 answers

codeigniter and cpanel installation

I am completely new to moving codeigniter to my web-server and im having trouble with the configuration. Where do I place my codeigniter project folder in www under myurl.com in in the very root directory? Am i supposed to move out the application…
Undermine2k
  • 1,481
  • 4
  • 28
  • 52
2
votes
2 answers

Codeigniter- How to use database functions while extending native libraries?

I want to access database functions in extending libraries. class My_Router extends CI_Router { public function __construct() { parent::__construct(); } function _set_routing() { ..... .... …
Logan
  • 1,682
  • 4
  • 21
  • 35
2
votes
2 answers

Building Codeigniter URLs with variable segments

I have searched for the solution to my problem in CI user guide and on Stackoverflow as well but couldn't find. So, here is my problem. I need to build SEO friendly URLs. I have a controller called "Outlets" and the view that I need to generate…
1
vote
1 answer

How to organize country/state/city browsing in MVC

I'm creating an ajax-based website that includes a country/state/city browsing interface. For SEO purposes, I want to include the name of the country/state/city in the URL. For example, the url may include additional variables, and would be…
Eric Di Bari
  • 3,767
  • 7
  • 40
  • 49
1
vote
2 answers

Create Custom URLs

I have a model that returns a list of artist's names from a database along with their ID. I want to loop through these artists in my view and create links to their pages with the following…
freshest
  • 6,229
  • 9
  • 35
  • 38
1
vote
1 answer

how do I access controller that is in sub directory of "application/controllers" when $config['enable_query_strings'] = TRUE

my codeigniter application config: $config['enable_query_strings'] = TRUE; $config['uri_protocol'] = 'PATH_INFO'; so I can access my application like this : index.php?c=index&m=about but I have a controller in "application/controllers/setting/"…
fr33m4n
  • 542
  • 2
  • 13
  • 31
1
vote
2 answers

Code Igniter: issue with nav & templating based on current controller/method

My controllers and methods map to sections and pages so I use that to highlight current navigation items and show page templates (via $this->router->class..). But I've struck a bit of a problem, I have the following structure for doctor test…
gio
  • 991
  • 3
  • 12
  • 24
1 2
3
16 17