Codeigniter Get Multiple Parameters in URL Routing

Codeigniter Get Multiple Parameters in URL Routing

In this Post We Will Explain About is Codeigniter Get Multiple Parameters in URL Routing With Example and Demo.Welcome on Live24u.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Get Multiple Parameters in URL of CodeIgniter Example

In this post we will show you Best way to implement passing multiple parameters in url codeigniter, hear for How to Pass Data From Controller to View in CodeIgniter with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Also Read :   PHP OOP CRUD(insert update delete) Operation Using MySQLi




codeigniter – Passing multiple variables in URL

For CodeIgniter example We have a URL like below scripts

localhost/sitename/controller/function/livefirst/livesecond

sitename: the name of your CodeIgniter app
controller: the CodeIgniter controller
function: the methods or function of that CodeIgniter controller
livefirst: the livefirst CodeIgniter paramater that We are data sending
livesecond: the livesecond CodeIgniter parameter that We are data sending

And Then you can retrive access the value or parameters in your CodeIgniter controller in like $this->uri->segment() Functions same as what I did below source code in CodeIgniter.

$livefirst = $this->uri->segment(3);
$livesecond = $this->uri->segment(4);
 
echo 'First Data Param Value: '.$livefirst.'<br>';
echo 'Second Data Param Value: '.$livesecond;

Pass Data From Controller To View In CodeIgniter

Create a View

<html>
<head>
<title>Welcome</title>
</head>
<body>
        <h1>Welcome to Live24u.com</h1>
</body>
</html>

Load the View

$this->load->view('name');

Welcome.php

<?php
class Welcome extends CI_Controller {

    public function index()
    {
        $this->load->view('cwblogview');
    }
}

Load Multiple Views

<?php
class Page extends CI_Controller {
    public function index()
    {
        $data['page_title'] = 'welcome to live24u.com';
        $this->load->view('header');
        $this->load->view('menu');
        $this->load->view('content', $data);
        $this->load->view('footer');
    }

}

Sort Views in Subfolders

$this->load->view(‘live24u/file_name’);

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Also Read :   Laravel Create REST API Step By Step with Authentication





Example

I hope you have Got What is Codeigniter URL Routing & URL Enabled Query String And how it works.I would Like to have FeedBack From My Blog(live24u.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(live24u.com) Are Most Always Welcome.