douhu8851 2014-02-26 18:20
浏览 96
已采纳

CodeIgniter + Bootstrap集成[关闭]

My understanding of a framework like CodeIgniter is that it helps streamline the process of creating an app's front end via views and backend via the models and controllers. Is it possible/easy/acceptable to use something such as Bootstrap or some other front end framework and integrate that with CodeIgniter? Does it make sense when using a framework to build the front end separately from the back end then integrate, or build them at the same time?

  • 写回答

2条回答 默认 最新

  • dongyou8701 2014-02-26 20:26
    关注

    bootstrap and codeigniter are awesome together. also if you have bootstrap code that gets repeated often you can make configs for them. for example if you have forms and are using codeigniter form helpers you can make configs that handle both the bootstrap code and the form field code. Using a quick example from the bootstrap page http://getbootstrap.com/css/#forms

    // in your config
    $config['btformgroup'] = '<div class="form-group">';
    
    $config['emailfield'] = array(
    'name' => 'email',
    'class' => 'form-control', // Bootstrap specific 
    'id' => 'exampleInputEmail1', 
    'placeholder' = 'Enter email' );
    
    // in your form   
    echo $btformgroup . form_input($emailfield);
    
    // etc etc - can also include set_value(), error messages, closing divs...
    

    that way you can do your forms with pure php, and its very easy to change.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题