Skip to main content

Codeigniter php frameworks: codeigniter URLs part 2

codeIgniter
Codeigniter php frameworks will be next to part two of codeigniter URLs. If you have not read the part one of codeigniter URLs, please follow this link to read it. Okay back to the lesson, now we talk about Adding a URL suffix. To active it you can find this configuration at config/config.php, you can specify that will be added to all URLs generated by codeigniter. for example, if the URL is example.com/index.php/products/view/shoes, you can optionally add a suffix, like .asp, making the page appear to be of a certain type like this example.com/index.php/products/view/shoes.asp.

And the last lesson of codeigniter URLs is Enabling Query Strings, in some cases you might prefer to use query strings URLs like this index.php?c=products&m=view&id=345. Codeigniter optionally supports this capability, which can be enabled in your application/config.php file. Codeigniter php frameworks will be show you the config file preview. The preview will be like this.

$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';

If you change “enable_query_strings” to TRUE this feature will become active. Your controllers and functions will then be accessible using the “trigger” words you’ve set to invoke your controllers and methods like this index.php?c=controller&m=method. I think enough for this post of codeigniter URLs, see you in the next post in Codeigniter php frameworks.

Please note this, If you are using query strings you will have to build your own URLs, rather than utilizing the URL helpers (and other helpers that generate URLs, like some of the form helpers) as these are designed to work with segment based URLs.


This post of Codeigniter php frameworks: codeigniter URLs part 2 is references from http://codeigniter.com/user_guide/general/urls.html

Comments

Popular posts from this blog

Basic naming idea in codeigniter

File Naming Class files must be named in a Ucfirst-like manner, while any other file name (configurations, views, generic scripts, etc.) should be in all lowercase. INCORRECT: somelibrary.php someLibrary.php SOMELIBRARY.php Some_Library.php Application_config.php Application_Config.php applicationConfig.php CORRECT : Somelibrary.php Some_library.php applicationconfig.php application_config.php Furthermore, class file names should match the name of the class itself. For example, if you have a class named  Myclass , then its filename must be Myclass.php. Class and Method Naming Class names should always start with an uppercase letter. Multiple words should be separated with an underscore, and not CamelCased. INCORRECT : class superclass class SuperClass CORRECT : class Super_class class Super_class {           public function __construct ()        ...

Codeigniter php frameworks: codeigniter URLs part 1

codeIgniter Codeigniter php frameworks will teach you about codeigniter URLs. If you not understand about installing codeigniter, please follow the previous post . The codeigniter URLs feature is designed to be search engine and human friendly. For the example is example.com/ news / article / my_article . Firstly is URI Segment, the segment in the URL is following with the Model-View-Controller(MVC). And for the structure  is example.com/ class / function / ID . Class is the first segment represents the controller class that should be invoke. Function is the second segment represents the class function, or method, that should be called. And ID is the third, and any additional segment, represents  the ID and any variables that will be passed to the controller. For the second learn about codeigniter URLs is How to removing the index.php. what is index.php? index.php is the main file to default appear to your URL. The actually codeigniter URL is example.com/ index....

How to setup CodeIgniter in your localhost with WAMP server

I've been developing a couple of website using codeIgniter framework. I only learned about this framework early this year 2011. Basically, I've tried installing codeIgniter from localhost and on the host server itself. How to make codeigniter work is very simple and easy. Below are the steps to kick start your first website using codeigniter. 1. Installing WAMP First and foremost, before you can have your website running on your localhost you should get a copy of WAMP(Windows Apache MySQL and PHP). It is where you can manage your server settings and Apache/MySQL services. So start downloading Wampserver now! As you can see there are 2 buttons to download between 32bits and 64bits that would be basing on your system type. To check what OS type is running click Windows logo on your keyboard + Pause/Break and a window will appear. After download, double click the file and follow the instructions given. Everything will be installed automatically  with the ...