How to Create Simple Website in Codeigniter
Hello Friends Ajj Me Apko Btaunga Ki Ham Codeignitor Framework Ka Use Karke Simple Website Kese Bana Sakte Hai.
Aap Niche Diye Gye Stepps Ko Follow Karke 5 Minute Me Codeignitor Framework Use Karke Apni Website Teyar Kar Sakte Ho.
Steps-
1-Sabse Pehle Aap Niche Diye Gye Link Se Letest Codeignitor Version Download Ka Lijiye
2- Ab Aap Download Ki Hue File Ko Wamp Ya Xamp Me Extract Kar Lijiye Yanha Aap Apne Extract Folder Ka Name codeignitor Rakhiye.
3-Ab Apko Sabse Pehle Apne Website/Project Ka Base Url Set Kijiye-
Base Url Kese Setup Kare-
· Sabse Pehle Aap Config Folder Me config.php File Open Kijiye Yanha
· */
· $config['base_url'] = 'http://localhost/codeignitor/';
· Is Trah Se Setup Kar Lijiye
· Or Save Kar Dijiye File Ko.
· Is Trah Apki config.Php File Me Base Url Means Apke Project Ka Address Setup Ho Jayega
Ab Aap Controller Me Jakar home.php Name Se Ek Controller Bana Lijiye
Is File Me Aap Niche Diye Gye Code Ko Paste Karke Save Kar Dijiye.
home.php in controller folder-
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
$this->load->view('header');
$this->load->view('home');
}
}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
Ab Aap Is Code Ko Home.Php Me Controller Folder Ke Ander Save Kar De.
ab aap route.php file open karke wanha
$route['default_controller'] = "home";
$route['404_override'] = '';
set kar lijiye.
Ab Next Step Me Apko View Folder Open Karna Hai Or Yanha Apko Apne Website Ke Liye Page Create Karne Hai Jese About Us ,Contect Us,Home,Header, Services,Portfolio Page Etc
Aab Niche Se Code Ko Copy Karke Apne View Folder Me Ye Sare File Create Kar Lijiye.
· home.php- This Is Home Page(Yanha Aap Apni Marji Se Content Dal Sakte Hai Jo Be Aap Apne Homepage Par Show Karwana Chahte Ho.)
· aboutUs .php- This Is About Us Page(Yanha Be Aap Apna Content Dal Sakte Hai Apne Marji Ka)
· header.php-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Create simple website using codeigniter</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src='https://code.jquery.com/jquery-2.1.1.min.js'></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <a class="navbar-brand" href="<?php echo base_url() ?>">CodeIgniter</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">
<a href="<?php echo base_url() ?>">Home</a>
</li>
<li>
<a href="<?php echo base_url() ?>home/portfolio">Portfolio</a>
</li>
<li>
<a href="<?php echo base_url() ?>home/services">services</a>
</li>
<li>
<a href="<?php echo base_url() ?>home/about_us">About us</a>
</li>
<li>
<a href="<?php echo base_url() ?>home/contact_us">Contact us</a>
</li>
</ul>
<ul class="nav navbar-nav pull-right">
<li>
<a href="http://facebook.com/"><img style="height: 17px;" src="https://cdn0.iconfinder.com/data/icons/small-n-flat/24/678128-social-facebook-32.png"/></a>
</li>
<li>
<a href="http://twitter.com/"><img style="height: 17px;" src="https://cdn1.iconfinder.com/data/icons/logotypes/32/square-twitter-32.png"/></a>
</li>
<li>
<a href="https://plus.google.com/"><img style="height: 17px;" src="https://cdn1.iconfinder.com/data/icons/logotypes/32/square-google-plus-32.png"/></a>
</li>
</ul>
</div>
</nav>
</div>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Create simple website using codeigniter</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src='https://code.jquery.com/jquery-2.1.1.min.js'></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <a class="navbar-brand" href="<?php echo base_url() ?>">CodeIgniter</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">
<a href="<?php echo base_url() ?>">Home</a>
</li>
<li>
<a href="<?php echo base_url() ?>home/portfolio">Portfolio</a>
</li>
<li>
<a href="<?php echo base_url() ?>home/services">services</a>
</li>
<li>
<a href="<?php echo base_url() ?>home/about_us">About us</a>
</li>
<li>
<a href="<?php echo base_url() ?>home/contact_us">Contact us</a>
</li>
</ul>
<ul class="nav navbar-nav pull-right">
<li>
<a href="http://facebook.com/"><img style="height: 17px;" src="https://cdn0.iconfinder.com/data/icons/small-n-flat/24/678128-social-facebook-32.png"/></a>
</li>
<li>
<a href="http://twitter.com/"><img style="height: 17px;" src="https://cdn1.iconfinder.com/data/icons/logotypes/32/square-twitter-32.png"/></a>
</li>
<li>
<a href="https://plus.google.com/"><img style="height: 17px;" src="https://cdn1.iconfinder.com/data/icons/logotypes/32/square-google-plus-32.png"/></a>
</li>
</ul>
</div>
</nav>
</div>
contacUs.php
<center><form action="" method="post"/>
Name<input type="text" name="name"/><br>
Massage<input type="text" name="massage"/><br>
<input type="submit" name="submit" value="submit"/>
</form>
<h3>
Contact us
</h3> <address> <strong>chandigarh</strong><br /> sector 17 market <br /> india 160017<br /> <abbr title="Phone">Phone
</abbr> 9987878777</address>
</div>
</div>
</div>
</div>
</div></center>
Name<input type="text" name="name"/><br>
Massage<input type="text" name="massage"/><br>
<input type="submit" name="submit" value="submit"/>
</form>
<h3>
Contact us
</h3> <address> <strong>chandigarh</strong><br /> sector 17 market <br /> india 160017<br /> <abbr title="Phone">Phone
</abbr> 9987878777</address>
</div>
</div>
</div>
</div>
</div></center>
services.php-
This Is Services Page
portfolio.php- This Is Portfolio Page
In Sab File Create Karne Ke Bad Aap Apne Kisi Be Browser Me
Localhost/codeignitor/
Dalker Apne Simple Codeignitor Website Ko Run Karwa Sakte Ho.
Demo- laptop view
Demo-Mobile View
Ye Website Mobile Responsive Hogi Kiunki Tanha Mene Bootstrap Ka Use Karke Ise Mobile Responsive Bnaya Hai.Me Apko Mere Ane Wali Post Me Codeignitor Me Database Ke Sath Work Karna Sikhaunga.Me Ummid Karta Hu Ki Mere Ye Post Apke Liye Helpful Hogi .Agar Apko Isme Koi Be Problem A Rhe Hai To Aap Mujse Comment Section Me Puch Sakte Hai Me Apki Puri Sahyata Karne Ki Koshish Karunga
Thank You
Team Gajabwap Web In Hindi
Also Read-
Codeigniter Kya Hai-Full Detail In Hindi
ConversionConversion EmoticonEmoticon