Codeigniter working directory inside another working directory - codeigniter

Hi I am working on codeigniter for a while now and have met with an issue.
I use "localhost/controller/function" which is how codeigniter works.
Where controller classes are in controller folder in application.
I have a new codeigniter setup in root folder names "big" with its own controller, view, models etc. How can I run files in "big" like I do for my the original application.
I tried "localhost/big/controller/function", which obviously didn't work.
Please help, I am completely new with codeigniter.

just go to index.php of your application (big)
change/add line:
$application_folder = "applications/big";

Related

Codeigniter - dots in a controller folder name

I'm using the latest version of Codeigniter and I try to achieve specific controller folders structure.
I'm would like to create a controller folder for each of my webapp version:
/controllers/1.0.0/login (where login is the name of the controller)
/controllers/2.0.0/login (where login is the name of the controller)
the problem: it seems Codeigniter working great with controller folders but not working with controller folders that contain dot :(
Like this working good (without dots):
/controllers/100/login (where login is the name of the controller)
/controllers/200/login (where login is the name of the controller)
Is there a way to make Codeigniter work with dots on controller folders?
Thanks
Shai
I also getting the same issue.
You can use like this in your route
config/route.php
$route['Controller/1.0.0/login'] = 'Controller/100/login';
$route['Controller/2.0.0/login'] = 'Controller/200/login';
This is working fine for me

How to get new laravel 5.4 folder structure

I updated my laravel app from 5.2 to 5.3 then 5.4 (To avoid problems with direct update). The update was successful and my app is working fine. But then I can't find changes in the folder structure. A particular change I will like to see is my routes.php file leaving from root/app/Http/ to root/routes/.
I am wondering if this is normal and how I can modify it to take the new structure thanks in advance!
Well, if you update your app, those changes won't be made automatically. In upgrade guide there are only described changes that are necessary to make your application work.
When we are talking about routes, it's not so important, so you can have them as you had before or if you want you can move them and also rename those files (now there is no routes.php file but web.php, api.php and console.php files).
To move routes into new structure you should compare https://github.com/laravel/laravel/blob/5.2/app/Providers/RouteServiceProvider.php with https://github.com/laravel/laravel/blob/master/app/Providers/RouteServiceProvider.php - so you need to update your RouteServiceProvider file and move files into new locations.

Move Codeigniter's Model, View and controller folders outside Application

I would like to change/move the Model, View and Controllers folder from application folder and want them to be keep support in a new folder called app. Can someone please give me a solution which would work on CI-3*
application/
library
config
helpers
core
......
app/
model
views
controllers
index.php look for $application_folder and modify this.
You can move views separately using the $view_folder variable.
However, without changing the way the core of CI works you'd have to keep models/controllers inside of application.

What is the maximum layer of subdirectory at codeigniter controllers

I have a a project(codeigniter) where file directory is like that.
mysite
application
config
controllers
super_admin
admin.php
tasks
setup
bank.php
assets.php
Now if I try to access
http://localhost/mysite/tasks/seutp/bank
It calls codeigniter 404 page
But I can access
http://localhost/mysite/tasks/assets
Actually I can get access any controller under controllers and controllers/tasks folder.
But I cannot get access under controllers/tasks/setup folder
My question is
Is there any limitation of sub-directory at codeigniter?
If Yes: Is there any way to solve the limitation and How?
If No: Why I cannot access the third layer sub-directory controllers?Did I do something wrong?
yes there is a default for the ci controllers file folder levels. i am using this solution:
https://degreesofzero.com/article/controllers-in-sub-sub-folders-in-codeigniter.html
the author includes a lengthy mod rewrite but if you already have a working htaccess rewrite file to eliminate index.php from the url then it will probably work as is.

CodeIgniter controller in subfolder

I have a controller in a subfolder. CodeIgniter is giving a 404 page not found.
The controller works fine in the root controller folder. The controller also works fine in the 1st level subfolder. The controller breaks in the 2nd level subfolder.
Why would CodeIgniter not want you to user multiple subfolders?
Example:
Works: controllers/pages/HomeController.php
Broken: controllers/pages/users/HomeController.php
My Routes are like this:
Works: $route['default_controller'] = "pages/HomeController";
Broken: $route['default_controller'] = "pages/users/HomeController";
I wrote about this before, you just need to read the CI manual, but here is a quick blog entry I did which should get you back on track:
http://blog.biernacki.ca/2011/12/codeigniter-uri-routing-issue-with-controller-folders/
Example:
$route['account/manage/(:num)/(:any)'] = "account/manage/index/$1/$2";
CodeIgniter does not inherently allow for multiple controller folders. It may or may not work, but it is an undocumented quirk. Using the routes.php file you can virtualize any folder or controller structure you want, just take care to map your routes back to a controller and method in the Controllers folder.

Resources