Nilkamal Gotarne
Nilkamal Gotarne

Reputation: 395

How to find the view page from the url in codeigniter?

I have downloaded a project from server which is in codeigniter. I want to edit some pages.

The problem is I am unable to find a specific page from the URL. How can I find a specific page from the URL to make changes to that specific page?

There are multiple folders inside view, e.g., http://localhost/TMO/CMS/company/6/admin/store

How do I find which page is viewed at this URL?

Upvotes: 0

Views: 3539

Answers (2)

Naveed Ramzan
Naveed Ramzan

Reputation: 3593

You need to follow few steps :

  • Check the routes and map route with controller and its function
  • Trace that controller file and find the function's code
  • In that function, check the loaded view file
  • Then Move to that view file in Views

Upvotes: 2

Pacio
Pacio

Reputation: 543

The URL in Codeigniter is not related to the name or location of the views. Views are called from within the controller, so if it's the view you're interested in, you will have to find the controller that calls it first.

By default the url is domain.com/[controller]/[method] where [controller] and [method] are the name of the controller and method responsible for generating a specific web page.

However, the example URL you gave does not follow this pattern so it must have been created using a custom route. To find the custom routes look in the file application/config/routes.php, in that file will be a list of all URL routes and the controller and method they point to.

Upvotes: 1

Related Questions