Codeigniter Display "Index of Page" of Directory inside view - php

In Codeigniter php framework, I want to show directory files as Apache index of structure,
domain.com/controller/index_directory
Adding View won't be working, as I need to show directory not view using controller,
Like above

Related

How to set up codeigniter?

I'm trying to set up Codeigniter in my mac, but with no luck. When loading every page, appears a blank page.
I'm following the Codeigniter tutorial from the official site.
Checked the base URL configured in config.php, but seems to be ok, now: http://localhost:8080/
Also, the directory where there is the file that I'm trying to open seems to be in the correct folder: nfs://192.168.64.2/opt/lampp/htdocs/application/views/pages
The pages.php code is the next:
<?php
class Pages extends CI_Controller {
public function view($page = 'home')
{
}
}
I expected to load about.php and appear the header, about page and footer.
to load the view in codeigniter, you need to add below line of code in your controller function.
$this->load->view($page);
note: I am assuming that you have all the view pages are located at the route of application/views/ folder.
When you download Codeigniter and is extracted, generate a "Codeigniter xxx" folder with files. Is necessary to copy this folder to htdocs folder and rename with the name that you want for your project.
If you copy the files instead the folder inside htdocs, could produce this problem.

how to create module inside module in codeigniter

I have implemented HMVC for creating modules in codeigniter . Now I want to create modules inside module but unfortunately I am getting 404 page.
My current directory structure
modules/api/v1
when I am putting controller inside api/controller folder then it's working fine but when I put a controller file under api/v1/controller folder then it showing me 404 error. I want this because after implementing this all the version of my api will be inside a single folder
Please give me your suggestion how can I do This

load a page inside a folder in codeigniter

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.

Unable to access controllers of codeigniter which is installed under a wordpress site

I have a Wordpress site. So all i wish is to fetch the information from those database tables and create my own custom API's. For that i opted CodeIgniter Framework.
The file directory system looks like this in my FTP
My codeigniter files are placed in apps folder
The problem is the pages are not loading, It always returns 404 Error
or No Input file specified/found etc.
I tried changing .htaccess file but no luck.
But if i specify
applications/apps
i.e controller/method in default_url in routes.php it works fine.
and if i click on the Hyperlink, i am trying to load another view or call another View(a web page) but this returns 404 error page not found.
What might be the reason behind this.

How to configure internal url's content on Symfony

I am new to Symfony and I am trying to understand how a Symfony project works. Right now I am trying to change the content of an internal url. For example, in the layout.php file, I can put a sentence like:
Suecia
This works fine, when I press 'Suecia' "Button" it changes the content, and it adds viajesDeusto/new to the url. My question is, where can I change the content that the "viajesDeusto/new' url displays?
Thanks a lot
If you split the url in your url_for() function it breaks out to MODULE/ACTION
So go into your app (%SF_ROOT_DIR%/apps/%APP_NAME%)
inside that folder you have a modules folder
inside that you have the module name
inside that you have an actions folder and a templates folder
the actions folder is where your code to retrieve/process data resides
the templates folder is where the presentation code resides
For instance, if your app is called frontend the location of the code is:
%SF_ROOT_DIR%/apps/frontend/modules/viajesDeusto/actions
%SF_ROOT_DIR%/apps/frontend/modules/viajesDeusto/templates
This is the standard setup for syfony 1.x apps

Categories