codeigniter - 如何使用 CodeIgniter 应用程序实现 WrapBootstrap 主题?

标签 codeigniter twitter-bootstrap

我刚刚购买了 WrapBootstrap 主题,并尝试将其插入我的 CodeIgniter 应用程序中。我从未使用过 WrapBootstrap,并且不确定下一步是什么,因为许多文件中都有 ruby​​(它们是 .erb 文件)。

这是我发现的:

First open your CSS files and replace all calls to ../img/ dir with plain images/ to make pipeline find the graphic elements of the theme .

For using the glyph you should create a new directory, fonts, to copy the glyph images there and expand the usable assets in application directory

如果我只复制 JavaScript、图像、字体和样式表,我可以使用它吗? (如果我拿走了所有 Assets )

最佳答案

这样做:

  • 将css、js、img等资源文件夹放入Codeigniter的index.php同级的一个名为assets的文件夹中。这些文件夹中的文件将从 html 文件中引用,如下所示(带有 css 的示例):<link rel="stylesheet" type="text/css" media="all" href="<?php echo base_url();?>assets/css/style.css" />
  • html 文件位于views 文件夹中。您将看到每个 html 文件都重复页眉和页脚结构,因此您可以将此结构隔离到页眉和页脚 View 中。通常,页眉从文档类型声明开始,到主要部分(正文内)结束,页脚从主要部分的末尾开始,以 </html> 结束。 。其余部分(主要部分)将是该 html 的 View 。因此,您最终将拥有:一个 header View 、每个 html 文件的 View 和一个页脚 View 。
  • 标题 View :包含<head>部分和(通常)导航栏。在 head 部分中,您引用文件(css、js、img),就像我在第一点中编写的那样。更改导航栏链接以链接到正确的 Controller (请参阅最后一点)。
  • 每个html的 View :包含页面的内容。您应该在顶部加载页眉 View ,在底部加载页脚 View 。您可以将 View 命名为 html 文件,但要小心主页 (index.html)。你最好将其命名为“家”。
  • 页脚 View :包含页脚内容和 JavaScript 文件,您应该像页眉中的文件一样引用它们。
  • 要调用每个 View ,请创建一个具有 html 名称的 Controller ,并将 View 加载到 Controller 的索引函数中。对于主页 View ,请使用routes.php 中的default_controller。

.erb 文件可能用于联系表单的后端处理,因此如果您使用 Codeigniter,它们就没有用处。您应该用 Controller 和模型替换它们。

关于codeigniter - 如何使用 CodeIgniter 应用程序实现 WrapBootstrap 主题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18245062/

相关文章:

css - 如何减小页脚处使用的超大屏幕的尺寸?

javascript - 在继续通过单独的功能之前等待 AJAX

php - 不唯一的表/别名 : 'request

javascript - 动态加载图像缓慢,jquery,php

javascript - bootstrap 4使用js隐藏元素

html - 添加 bootstrap css 时全高不起作用

javascript - 我们可以在 javascript 中嵌入 form_dropdown 函数吗?

php - 如何循环遍历两个不同的表?

css - 使用 Sprite 时响应式背景图像

html - 如何覆盖 Twitter Bootstrap 中按钮的链接颜色和边距/填充?