0

I've been working with the awesome Codeigniter framework for PHP for a while. Anyways, i've still got some questions.

It's easy to make an URL look like (domain.com/about) etc, but how can i make this combined with the news? something like domain.com/news/war/this_is_war etc? or maybe domain.com/war/123

Os there any good articles for this? Thanks anyway :)

3 Answers 3

3

With CI, a page controller function function1(param1, param2) corresponds to the URL domain.com/page/function1/param1/param2, assuming you've configured .htaccess to get rid of the index.php

If you want specific url formats to load specific controllers/functions, you can configure your routing parameters in config/routes.php - see this for more.

Sign up to request clarification or add additional context in comments.

Comments

0

Take a look at this :

http://www.phpeveryday.com/articles/CodeIgniter-Getting-Parameters-From-GET-P151.html

I think it's what you are looking for.

Comments

0

The URI Class in CodeIgniter is probably best for handling this.

http://codeigniter.com/user_guide/general/controllers.html

http://codeigniter.com/user_guide/libraries/uri.html

It allows you to dissect the URI the person has entered (or linked to). You can then load content based on these parameters.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.