Home Backend Development PHP Tutorial 用CI该如果部署目录?小弟我原来通用的管理后台还可以直接用吗

用CI该如果部署目录?小弟我原来通用的管理后台还可以直接用吗

Jun 13, 2016 pm 01:51 PM
base com system url

用CI该如果部署目录?我原来通用的管理后台还可以直接用吗?
之前没有用过MVC,这个星期大致了解了下CI,有一些疑问,请帮忙解答下
1. 用CI该如何部署网站目录结构: 如我原来在根目录下可能是这样的
/images放公共图片 (我想应该是与system同级目录?)
/css放共用样式 (我想应该是与system同级目录?)
/Js放通用JS (我想应该是与system同级目录?)
/admin放后台管理文件 (不知道该如何放,另外这里的目录都是URL的,在CI下还能直接使用吗,我一直都用这个后台架构的,该如何用)
/news 放前台新闻显示文件 (相当于CI的视图),我觉得应该是在VIEWS下新建文件夹吧
/product (相当于CI的视图) 我觉得应该是在VIEWS下新建文件夹吧
那么如果按照CI的架构,该如何部署这些结构呢???
2. 之前我们都很习惯于用URL传递参数, 但是CI默认情况下好像把这个给屏蔽了,那这个屏蔽有什么好的办法代替吗?还是就是不用的比较好?

请帮忙解答我这个初次接触CI,也是头次接触MVC框架结构的新手的忙, 不胜感激!!

------解决方案--------------------
CI config文件里有个base_url设置。那里指定了默认其实uri。
那三个文件夹可以放在system同级,在显示层的路径就是 base_url() . 'css/' base_url() . 'js/' 以此类推。
如果是用默认的话,view就是存放视图文件的地方。
url参数传递并不是屏蔽了,只是被重写,静态化了而已。其实还是一样的。
如果有一个控制器在控制器文件夹里是处于这样的位置。
controllers_
|----base.php

//
class Base extends Controller

function index()
{
}

function blah($p1,$p2,$p3)
{
}
...

假设 base_url="www.xxx.com/"

那么www.xxx.com/base 就会调用这个名叫base的控制器的默认方法index()

想要调用blah方法vURI就是
www.xxx.com/base/xx/xx/xx
后面三个就是参数。

大略的讲一下。还有很多注意事项,这里很难讲清楚了。
你去 www.codeigniter.org.cn 有中文手册。
一般的问题,仔细看看基本能找到答案。
 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hongmeng native application random poetry Hongmeng native application random poetry Feb 19, 2024 pm 01:36 PM

Hongmeng native application random poetry

PHP function introduction—get_headers(): Get the response header information of the URL PHP function introduction—get_headers(): Get the response header information of the URL Jul 25, 2023 am 09:05 AM

PHP function introduction—get_headers(): Get the response header information of the URL

Base DEX Faucet: Aerodrome VS Curve Base DEX Faucet: Aerodrome VS Curve Mar 26, 2024 pm 04:31 PM

Base DEX Faucet: Aerodrome VS Curve

Why NameResolutionError(self.host, self, e) from e and how to solve it Why NameResolutionError(self.host, self, e) from e and how to solve it Mar 01, 2024 pm 01:20 PM

Why NameResolutionError(self.host, self, e) from e and how to solve it

How to get your Steam ID in a few steps? How to get your Steam ID in a few steps? May 08, 2023 pm 11:43 PM

How to get your Steam ID in a few steps?

How to use URL encoding and decoding in Java How to use URL encoding and decoding in Java May 08, 2023 pm 05:46 PM

How to use URL encoding and decoding in Java

Use regular expressions in golang to verify whether the input is a legal base64 string Use regular expressions in golang to verify whether the input is a legal base64 string Jun 24, 2023 am 10:01 AM

Use regular expressions in golang to verify whether the input is a legal base64 string

How to encode and decode using Base64 functions in Java How to encode and decode using Base64 functions in Java Jun 26, 2023 pm 02:24 PM

How to encode and decode using Base64 functions in Java

See all articles