load a page inside a folder in codeigniter - php

I have changed the name of codeigniter and placed htdocs then in application folder I have created a new folder in that new folder again I created some folders for different web pages in each and every folder I added controllers,models,view files. Now I want to access a controller file which is in the new folder.
I tried with default route but not working..Can anyone suggest

Create as many folders as you want inside the controller model and view folders in CodeIgniter and not outside them if you really want to organise them.
Remember to set base URL in application/config/config.php file and default router inside the application/config/routes.php file.
If you have problems please comment below describing errors.

Related

I had created folder in the root directory of laravel on level of app but cannot get the laravel session in that folder files

app
config
bootstrap
resources
new folder
As you can see the level of my new folder is at the root level. The issue is how can I get all the Laravel functionality like helper function and session.
I had created a file called index.php inside my new folder and try to get the helper function and some session value in this index file in which I am using some core PHP functions which are working properly but can't get anything from the Laravel function.
Can someone help with this issue?

How do I separate Codeigniter v4 MVC for admin and public?

I want to separate Codeigniter4 MVC for admin and public. In codeigniter3 this is very easy. But I am unable to do that in Codeigniter v4. I want to use system directory for both MVC. Can anyone help me?
Example for public
http:://abc.com
Example for admin
http:://abc.com/admin
Create an admin folder inside the public folder. Copy All files and folders from public folder to the admin folder
Edit the admin/index.php file. Add extra [../] in $pathsPath value
Create a new admin folder in App folder. Copy all files and folders from App folder to admin folder
Edit adnin/Config/Paths.php. Add extra [../] in every variables except $viewDirectory veriable.
This changes will make separate the admin and public MVC from each other. But the System folder will be the same.

Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid

I have created a codeigniter project (XYZ) in hmvc. Inside a project(ABC), i created app folder and uploaded XYZ project. So ABC.com works but ABC/app does not work. It says:
If you are using .htaccess then you have to allow XYZ folder name (app in your case) in ABC project .htaccess file.
Or Sometimes CodeIgniter won't find the controller.
Go to config > routers.php
and see the value of default_controller, update this as per your default controller.

Integration of svg-edit or other programs on Laravel 4

I'm trying to integrate svg-editor with Laravel 4.
My current solution is to insert svg-editor.html file renamed as svg-editor.php inside my views folder and move the rest of files into the public folder. So now I've moved all the calls to js and css files into the edit view and all points to the public folder to let laravel load the needed files for svg-editor. js and css files are into assets folder and I call them with asset function:
<script>{{{ asset('/assets/js/ *original path from svg-editor* ') }}}</script>
public folder structure
app
public
vendor
svg-edit-2_6
Views folder: inside svg-edit-2_6 there's just svg-editor.php to be able to include on template with #include()
Of course this solution is messy because I've to modify all calls inside svg-editor code such as paths and URLs references. My question is if there's any way to let laravel to load this program without having to modify its params. I think could be possible to make some kind of calls froms start.php file but I could not find information about how to do this.
Could it be possible?

config codeigniter to run first project

I am using xampp and my document root in apache is set to htdocs directory by default. I download Codeigniter and unzip the project into this directory. It runs fine. Now I would like to use CI to create my own project. In the controllers folder I would like to create a folder named “myproject” and in the views folder of application folder, I would like to create a folder named “myproject_view” in which I will store all of my view files. My problem is I don’t know how to reset my config file (especially the route.php) for my project to work then.
CodeIgniter documentation doesn’t have a section to specify how to do this, the information given in URI Routing chapter is not enough for readers to understand this at all. Plus, What if I also would like to store my controler files in a nested folder (controllers > somefolder > someanotherfolders > etc) ? Thank you very much.
[UPDATE]
If you only leave all controller in controllers folder, and view files in the views folder, then things work out easily, what if you create a folder in teh controllers and a folder for view in the views folder. I guess you need to change your default route configuration. I would like to know HOW ?
CodeIgniter's documentation covers Sub-Folders for Controllers.
Views on the other hand, are always loaded from controllers. Therefore, you can write:
$this->load->view('my_folder_name/my_view');
Routes are not required here.

Categories