Welcome Guest, Not a member yet? Register   Sign In
convert to CI
#1

Hello,

I have this html file that I would like to change to CI so that it function well.  Can anyone help me comment what I should change so that the file works well in CI?

So far The style does not work.

Original:

backend-template/index.php


PHP Code:
<!DOCTYPE html>
<
html lang="en">
    <
head>
        <
title>Upgrade</title>
        <
meta charset="UTF-8" />
 
       <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <
link rel="stylesheet/less" type="text/css" href="themes/less/bootstrap.less">
        <
script src="themes/js/less/less.js" type="text/javascript"></script>
        <
link rel="stylesheet" href="themes/style/fullcalendar.css" />    

        <
link rel="stylesheet" href="themes/style/delta.main.css" />
        <
link rel="stylesheet" href="themes/style/delta.grey.css"/>
        
        <
link rel="stylesheet" href="themes/style/add.css"/>
        
    </
head>
    <
body>
    <
br>
    <
div id="sidebar"
        <
h1 id="logo"><a href="index.php">Free Admin</a></h1 
        
<a href="#" class="visible-phone"><class="icon icon-home"></iDashboard</a>
        <
ul>
            <
li class="active"><a href="index.php"><class="icon icon-home"></i> <span>Administrator</span></a></li>
            <
li class="submenu">
                <
a href="#"><class="icon icon-th-list"></i> <span>Categories</span> <span class="label">2</span></a>
                <
ul>
                    <
li><a href="pcategories.php">Parent categories</a></li>
                    <
li><a href="scategories.php">Sub Categories</a></li>
                </
ul>
            </
li>
            <
li><a href="pages.php"><class="icon icon-tint"></i> <span>Pages</span></a></li>
            <
li><a href="#"><class="icon icon-pencil"></i> <span>Slideshow</span></a></li>
            <
li><a href="#"><class="icon icon-th"></i> <span>Content</span></a></li>
            <
li><a href="#"><class="icon icon-th-list"></i> <span>Galleries</span></a></li>
            <
li><a href="newsletter.php"><class="icon icon-th-list"></i><span>Newsletters</span></a></li>            
            <
li class="submenu">
                <
a href="#"><class="icon icon-file"></i> <span>Administrators</span><span class="label">2</span></a>
                <
ul>
                    <
li><a href="#">User</a></li>
                    <
li><a href="#">Role</a></li>                    
                </
ul>
            </
li>
            <
li><a href="#"><class="icon icon-th-list"></i> <span>Settings</span></a></li>
            <
li>
                <
a href="#"><class="icon icon-inbox"></i> <span>Logout</span></a>
            </
li>
        </
ul>
    </
div>
     
 <div id="mainBody">
            <
h1>COMPANY PROFILE CMS
                
<div class="pull-right">
                <
class="btn btn-large tip-bottom" title="Manage Users"><class="icon-user"></i></a>
                <
class="btn btn-large tip-bottom" title="Manage Comments" style="position:relative"><class="icon-comment"></i>
                <
span style="position:absolute; border-radius:12px; top:-23%; height:16px; width:16px" class="label label-important">5</span></a>
                <
class="btn btn-large tip-bottom" title="Manage Orders"><class="icon-shopping-cart"></i></a>
                <
class="btn btn-large btn-danger" title="" href="#"><class="icon-off"></i></a>
                </
div>
            </
h1>
        <
div id="breadcrumb">
            <
a href="#" title="Go to Home" class="tip-bottom"><class="icon-home"></iHome</a>
            <
a href="#" class="current">Dashboard</a>
        </
div>
        
            <
div class="row-fluid">
                <
div class="span12">
                    
                    <
button type="button" class="add" href="adminform.php">ADD ADMINISTRATOR</button
                    
                    <
div class="widget-box">
                        <
div class="widget-title"><h5>Administrator</h5></div>
                        <
div class="widget-content">
                        
                        <
table border="0" style="width: 100%; height: 90px;">
                            <
tr>
                                <
td>NAME</td>
                                <
td>EMAIL</td>
                                <
td>ROLE</td>
                                <
td>EDIT</td>
                                <
td>DELETE</td>    
                            </
td>
                            <
tr>
                                <
td>Victor</td>
                                <
td>victor@mail.com</td>
                                <
td>Administrator</td>
                                <
td><button type="button" class="edit" href="adminform.php">EDIT</button></td>
                                <
td><button type="button" class="delete" href="adminform.php">DELETE</button></td>    
                            </
td>    
                            <
tr>
                                <
td>David</td>
                                <
td>david@mail.com</td>
                                <
td>Manager</td>
                                <
td><button type="button" class="edit" href="adminform.php">EDIT</button></td>
                                <
td><button type="button" class="delete" href="adminform.php">DELETE</button></td>    
                            </
td>    
                        </
table>            
                        </
div>
                    </
div>                    
                </
div>
            </
div>
            
            
        </
div>
        </
div>

 
           <script src="themes/js/excanvas.min.js"></script>
 
           <script src="themes/js/jquery.min.js"></script>
 
           <script src="themes/js/jquery.ui.custom.js"></script>
 
           <script src="themes/js/bootstrap.min.js"></script>
 
           <script src="themes/js/jquery.flot.min.js"></script>
 
           <script src="themes/js/jquery.flot.resize.min.js"></script>
 
           <script src="themes/js/jquery.peity.min.js"></script>
 
           <script src="themes/js/fullcalendar.min.js"></script>
 
           <script src="themes/js/delta.js"></script>
 
           <script src="themes/js/delta.dashboard.js"></script>
    </
body>
</
html



After transfer to views/index.php

I cannot copy the same file exactly as it does not work as good.

Please help.  Thanks.
" If I looks more intelligence please increase my reputation."
Reply
#2

views/index.php


PHP Code:
<head>
        <
title>Upgrade</title>
        <
meta charset="UTF-8" />
 
       <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <
link rel="stylesheet/less" type="text/css" href="<?php echo base_url(); ?>themes/less/bootstrap.less">
        <
script src="<?php echo base_url(); ?>themes/js/less/less.js" type="text/javascript"></script>
        <
link rel="stylesheet" href="<?php echo base_url(); ?>themes/style/fullcalendar.css" />    

        <
link rel="stylesheet" href="<?php echo base_url(); ?>themes/style/delta.main.css" />
        <
link rel="stylesheet" href="<?php echo base_url(); ?>themes/style/delta.grey.css"/>
        
        <
link rel="stylesheet" href="<?php echo base_url(); ?>themes/style/add.css"/>
        
    </
head


A PHP Error was encountered
Severity: Error
Message: Call to undefined function base_url()
Filename: views/index.php
Line Number: 7
Backtrace:

Line 7:      <link rel="stylesheet/less" type="text/css" href="<?php echo base_url(); ?>themes/less/bootstrap.less">

Why this error still appears?
" If I looks more intelligence please increase my reputation."
Reply
#3

Load url helper in your controller:
PHP Code:
$this->load->helper('url'); 
Reply
#4

(This post was last modified: 05-12-2016, 12:41 AM by davy_yg.)

http://localhost/backend_CI/applications.../index.php

I build this code and already load the url helper but the view stilll does not seems to load the style sheet I wonder why?


views/index.php


PHP Code:
<!DOCTYPE html>
<
html lang="en">
    <
head>
        <
title>Upgrade</title>
        <
meta charset="UTF-8" />
 
       <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <
link rel="stylesheet/less" type="text/css" href="<?php echo base_url(); ?>themes/less/bootstrap.less">
        <
script src="<?php echo base_url(); ?>themes/js/less/less.js" type="text/javascript"></script>
        <
link rel="stylesheet" href="<?php echo base_url(); ?>themes/style/fullcalendar.css" />    

        <
link rel="stylesheet" href="<?php echo base_url(); ?>themes/style/delta.main.css" />
        <
link rel="stylesheet" href="<?php echo base_url(); ?>themes/style/delta.grey.css"/>
        
        <
link rel="stylesheet" href="<?php echo base_url(); ?>themes/style/add.css"/>
        
    </
head>
    <
body>
    <
br>
    <
div id="sidebar"
        <
h1 id="logo"><a href="index.php">Free Admin</a></h1 
        
<a href="#" class="visible-phone"><class="icon icon-home"></iDashboard</a>
        <
ul>
            <
li class="active"><a href="index.php"><class="icon icon-home"></i> <span>Administrator</span></a></li>
            <
li class="submenu">
                <
a href="#"><class="icon icon-th-list"></i> <span>Categories</span> <span class="label">2</span></a>
                <
ul>
                    <
li><a href="pcategories.php">Parent categories</a></li>
                    <
li><a href="scategories.php">Sub Categories</a></li>
                </
ul>
            </
li>
            <
li><a href="pages.php"><class="icon icon-tint"></i> <span>Pages</span></a></li>
            <
li><a href="#"><class="icon icon-pencil"></i> <span>Slideshow</span></a></li>
            <
li><a href="#"><class="icon icon-th"></i> <span>Content</span></a></li>
            <
li><a href="#"><class="icon icon-th-list"></i> <span>Galleries</span></a></li>
            <
li><a href="newsletter.php"><class="icon icon-th-list"></i><span>Newsletters</span></a></li>            
            <
li class="submenu">
                <
a href="#"><class="icon icon-file"></i> <span>Administrators</span><span class="label">2</span></a>
                <
ul>
                    <
li><a href="#">User</a></li>
                    <
li><a href="#">Role</a></li>                    
                </
ul>
            </
li>
            <
li><a href="#"><class="icon icon-th-list"></i> <span>Settings</span></a></li>
            <
li>
                <
a href="#"><class="icon icon-inbox"></i> <span>Logout</span></a>
            </
li>
        </
ul>
    </
div>
     
 <div id="mainBody">
            <
h1>COMPANY PROFILE CMS
                
<div class="pull-right">
                <
class="btn btn-large tip-bottom" title="Manage Users"><class="icon-user"></i></a>
                <
class="btn btn-large tip-bottom" title="Manage Comments" style="position:relative"><class="icon-comment"></i>
                <
span style="position:absolute; border-radius:12px; top:-23%; height:16px; width:16px" class="label label-important">5</span></a>
                <
class="btn btn-large tip-bottom" title="Manage Orders"><class="icon-shopping-cart"></i></a>
                <
class="btn btn-large btn-danger" title="" href="#"><class="icon-off"></i></a>
                </
div>
            </
h1>
        <
div id="breadcrumb">
            <
a href="#" title="Go to Home" class="tip-bottom"><class="icon-home"></iHome</a>
            <
a href="#" class="current">Dashboard</a>
        </
div>
        
            <
div class="row-fluid">
                <
div class="span12">
                    
                    <
button type="button" class="add" href="adminform.php">ADD ADMINISTRATOR</button
                    
                    <
div class="widget-box">
                        <
div class="widget-title"><h5>Administrator</h5></div>
                        <
div class="widget-content">
                        
                        <
table border="0" style="width: 100%; height: 90px;">
                            <
tr>
                                <
td>NAME</td>
                                <
td>EMAIL</td>
                                <
td>ROLE</td>
                                <
td>EDIT</td>
                                <
td>DELETE</td>    
                            </
td>
                            <
tr>
                                <
td>Victor</td>
                                <
td>victor@mail.com</td>
                                <
td>Administrator</td>
                                <
td><button type="button" class="edit" href="adminform.php">EDIT</button></td>
                                <
td><button type="button" class="delete" href="adminform.php">DELETE</button></td>    
                            </
td>    
                            <
tr>
                                <
td>David</td>
                                <
td>david@mail.com</td>
                                <
td>Manager</td>
                                <
td><button type="button" class="edit" href="adminform.php">EDIT</button></td>
                                <
td><button type="button" class="delete" href="adminform.php">DELETE</button></td>    
                            </
td>    
                        </
table>            
                        </
div>
                    </
div>                    
                </
div>
            </
div>
            
            
        </
div>
        </
div>

 
           <script src="<?php echo base_url(); ?>themes/js/excanvas.min.js"></script>
 
           <script src="<?php echo base_url(); ?>themes/js/jquery.min.js"></script>
 
           <script src="<?php echo base_url(); ?>themes/js/jquery.ui.custom.js"></script>
 
           <script src="<?php echo base_url(); ?>themes/js/bootstrap.min.js"></script>
 
           <script src="<?php echo base_url(); ?>themes/js/jquery.flot.min.js"></script>
 
           <script src="<?php echo base_url(); ?>themes/js/jquery.flot.resize.min.js"></script>
 
           <script src="<?php echo base_url(); ?>themes/js/jquery.peity.min.js"></script>
 
           <script src="<?php echo base_url(); ?>themes/js/fullcalendar.min.js"></script>
 
           <script src="<?php echo base_url(); ?>themes/js/delta.js"></script>
 
           <script src="<?php echo base_url(); ?>themes/js/delta.dashboard.js"></script>
    </
body>
</
html
I check the code through code inspection in firefox I wonder why the address is a little bit different?

Code:
<script src="http://127.0.0.1/backend_CI/themes/js/excanvas.min.js"></script>
" If I looks more intelligence please increase my reputation."
Reply
#5

I even already replace with: 

views/index.php


PHP Code:
<head>
        <title>Upgrade</title>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <link rel="stylesheet/less" type="text/css" href="<?php echo base_url(); ?>index.php/views/themes/less/bootstrap.less">
        <script src="<?php echo base_url(); ?>index.php/views/themes/js/less/less.js" type="text/javascript"></script>
        <link rel="stylesheet" href="<?php echo base_url(); ?>index.php/views/themes/style/fullcalendar.css" />    

        
<link rel="stylesheet" href="<?php echo base_url(); ?>index.php/views/themes/style/delta.main.css" />
        <link rel="stylesheet" href="<?php echo base_url(); ?>index.php/views/themes/style/delta.grey.css"/>
        
        
<link rel="stylesheet" href="<?php echo base_url(); ?>index.php/views/themes/style/add.css"/>
        
    
</head

and I still cannot access the style css.  I wonder why?
" If I looks more intelligence please increase my reputation."
Reply
#6

I already try typing: http://localhost/backend_CI/index.php/vi...le/add.css

it cannot shows anything.


404 Page Not Found

The page you requested was not found.


I wonder why?
" If I looks more intelligence please increase my reputation."
Reply
#7

MOVE IT OUTSIDE THE APPLICATION MODEL(eg :assets)
then access it
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/themes/style/add.css"/>
Reply
#8

views/index.php

PHP Code:
<div id="sidebar"
        <
h1 id="logo"><a href="index.php">Free Admin</a></h1 
        
<a href="#" class="visible-phone"><class="icon icon-home"></iDashboard</a>
        <
ul>
            <
li class="active"><a href="index.php"><class="icon icon-home"></i> <span>Administrator</span></a></li>
            <
li class="submenu">
                <
a href="#"><class="icon icon-th-list"></i> <span>Categories</span> <span class="label">2</span></a>
                <
ul>
                    <
li><a href="pcategories.php">Parent categories</a></li>
                    <
li><a href="scategories.php">Sub Categories</a></li>
                </
ul>
            </
li>
            <
li><a href="<?php echo base_url(); ?>index.php/views/pages.php"><class="icon icon-tint"></i> <span>Pages</span></a></li>
            <
li><a href="#"><class="icon icon-pencil"></i> <span>Slideshow</span></a></li>
            <
li><a href="#"><class="icon icon-th"></i> <span>Content</span></a></li>
            <
li><a href="#"><class="icon icon-th-list"></i> <span>Galleries</span></a></li>
            <
li><a href="newsletter.php"><class="icon icon-th-list"></i><span>Newsletters</span></a></li>            
            <
li class="submenu">
                <
a href="#"><class="icon icon-file"></i> <span>Administrators</span><span class="label">2</span></a>
                <
ul>
                    <
li><a href="#">User</a></li>
                    <
li><a href="#">Role</a></li>                    
                </
ul>
            </
li>
            <
li><a href="#"><class="icon icon-th-list"></i> <span>Settings</span></a></li>
            <
li>
                <
a href="#"><class="icon icon-inbox"></i> <span>Logout</span></a>
            </
li>
        </
ul>
    </
div


Hello,

I trying to find a way so that when people click the navigation link it directly carries me to the intended address:

<li><a href="<?php echo base_url(); ?>index.php/views/pages.php"><i class="icon icon-tint"></i> <span>Pages</span></a></li>

but this is not the case,  http://127.0.0.1/backend_CI/index.php/views/pages.php

404 Page Not Found
The page you requested was not found.


I wonder why?
" If I looks more intelligence please increase my reputation."
Reply
#9

(This post was last modified: 05-13-2016, 02:32 AM by PaulD.)

PHP Code:
<a href="<?php echo base_url(); ?>index.php/views/pages.php"

Read the documentation - Please.

http://www.codeigniter.com/user_guide/he...l#site_url
Reply
#10

I try clicking the navigation but it does not work out well.

views/index.php

PHP Code:
<div id="sidebar"
        <
h1 id="logo"><a href="index.php">Free Admin</a></h1 
        
<a href="#" class="visible-phone"><class="icon icon-home"></iDashboard</a>
        <
ul>
            <
li class="active"><a href="index.php"><class="icon icon-home"></i> <span>Administrator</span></a></li>
            <
li class="submenu">
                <
a href="#"><class="icon icon-th-list"></i> <span>Categories</span> <span class="label">2</span></a>
                <
ul>
                    <
li><a href="pcategories.php">Parent categories</a></li>
                    <
li><a href="scategories.php">Sub Categories</a></li>
                </
ul>
            </
li>
            <
li><a href="<?php echo site_url('pages'); ?>"><class="icon icon-tint"></i> <span>Pages</span></a></li>
            <
li><a href="#"><class="icon icon-pencil"></i> <span>Slideshow</span></a></li>
            <
li><a href="#"><class="icon icon-th"></i> <span>Content</span></a></li>
            <
li><a href="#"><class="icon icon-th-list"></i> <span>Galleries</span></a></li>
            <
li><a href="newsletter.php"><class="icon icon-th-list"></i><span>Newsletters</span></a></li>            
            <
li class="submenu">
                <
a href="#"><class="icon icon-file"></i> <span>Administrators</span><span class="label">2</span></a>
                <
ul>
                    <
li><a href="#">User</a></li>
                    <
li><a href="#">Role</a></li>                    
                </
ul>
            </
li>
            <
li><a href="#"><class="icon icon-th-list"></i> <span>Settings</span></a></li>
            <
li>
                <
a href="#"><class="icon icon-inbox"></i> <span>Logout</span></a>
            </
li>
        </
ul>
    </
div



controllers/Welcome.php



PHP Code:
public function pages()
    {
                
        $this
->load->view('pages');
        
    

" If I looks more intelligence please increase my reputation."
Reply




Theme © iAndrew 2016 - Forum software by © MyBB