ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Codeigniter + twitter bootstrap + html5boilerplate + MY_Controller

March 09, 2012 5:16am

Subscribe [9]
  • #1 / Mar 09, 2012 5:16am

    vesparny

    9 posts

    I’ve pushed on github a skeleton application based on codeigniter, bootstrap and html5boilerplate.

    The project is under development and the ideas is to have a base web app using the most interesting goodies available (in my opinion of course 😊)

    take a look
    https://github.com/vesparny/codeigniter-html5boilerplate-twitter-bootstrap

    The project is also using a MY_Controller for a smart view rendering.


    ...and let me know 😊

  • #2 / Mar 09, 2012 9:52am

    co[dezyne]

    2 posts

    interested to see where you go with this.

  • #3 / Mar 09, 2012 10:32am

    vesparny

    9 posts

    i just want to create a simple CI skeleton app…

  • #4 / Mar 12, 2012 12:54pm

    dstrickler

    4 posts

    I’d like to start testing this, but I can’t find any docs on getting started. Can you provide just the basics, and I’ll figure out the rest?

  • #5 / Mar 12, 2012 6:44pm

    vesparny

    9 posts

    I’d like to start testing this, but I can’t find any docs on getting started. Can you provide just the basics, and I’ll figure out the rest?

    I’ve just finished to push a new version on github with a bit more exaustive documentation.

    Redownload the project, in the home view i’ve just created a single static but complete html page like bootstrap documentation.

    - edit .htaccess file in order to match your server config (see line 5 in the file); if you have http://localhost/site you nedd to set RewriteBase /site/
    -set up yor defaults values in application/config/development/custom.php
    -take a look to home controller and template view files to understand how does rendering works.
    -create your template: i’ve set up an header, footer, nav, and main for example purpose. Skeleton.php contains the scaffolding page.


    let me know if i may help you in some way.  fell free to fork my projects and contribute with pull requests.

     

  • #6 / Mar 13, 2012 5:15pm

    dstrickler

    4 posts

    I gabbed a copy of your latest code, and have begun to read through it. While I only understand a bit of it as this point, it looks to be a way via using MY_Controller to template a View so that as you create new Controllers you don’t need to worry about the JS/CSS in the header of each file.

    Am I understanding this right?

  • #7 / Mar 13, 2012 8:15pm

    vesparny

    9 posts

    I gabbed a copy of your latest code, and have begun to read through it. While I only understand a bit of it as this point, it looks to be a way via using MY_Controller to template a View so that as you create new Controllers you don’t need to worry about the JS/CSS in the header of each file.

    Am I understanding this right?

    exactly, and if you want to use another main template you just need to create a new file like main.php that include your new page structure, and in your controller set it via $this->template = “new_template”, in this way your new template will be pushed to skeleton.php ann page rendered.
    you can also push another javascript or css in your view $this->css = array(“path/to/file/file.css”).

    take a look to skeleton.php and main.php

  • #8 / Mar 13, 2012 11:18pm

    dstrickler

    4 posts

    Thanks - I’ll check it out some more tomorrow.

  • #9 / Mar 14, 2012 4:01am

    Go-Trex

    21 posts

    Hi Vesparny,

    I grabbed a copy of your latest code and have begun to read though the code. While I understand most of it I have still got one question I could not find in the given comments and documentation on the Github page;

    Is it possible to pass variables to the template though the controller. Normally you would use something like:

    $data['variable1'] = 'My variable1 output';
    $data['variable2'] = 'My variable2 output';
    $this->load->view('welcome_message', $data);

    Can you tell me and the community how to achieve this?! Thanks in advance.

  • #10 / Mar 14, 2012 4:07am

    Go-Trex

    21 posts

    ** Bump **

    I have did another good look at the code and figured it out. For anyone who likes to know:

    $this->data['variable1'] = 'My variable1 output';
  • #11 / Mar 14, 2012 4:15am

    vesparny

    9 posts

    That is the right way…if you Want you can fork the repo and help me to improve the documentatio. Thanks

  • #12 / Mar 18, 2012 2:28am

    Exeneva

    5 posts

    I’ve just downloaded this and will be playing around with it. So far it seems you’ve done a very nice job of integrating the three. The documentation could certainly be improved, but once that is done I believe you will have a very good ‘base’ set for web apps.

  • #13 / Mar 18, 2012 10:29am

    vesparny

    9 posts

    I’ve just downloaded this and will be playing around with it. So far it seems you’ve done a very nice job of integrating the three. The documentation could certainly be improved, but once that is done I believe you will have a very good ‘base’ set for web apps.

    are you experiencing trouble?
    i really apreciate every kind of contribution : if you would improve the docs send me a pull req. 😊

  • #14 / Mar 18, 2012 8:38pm

    Exeneva

    5 posts

    I’ll play around with it a bit.

    I’m not a very experienced CI developer, but once I start to understand your framework more, I’ll pitch in some documentation.

    For now, I suggest explaining your view setup more.

  • #15 / Nov 14, 2012 5:06am

    coob

    1 posts

    Hello @vesparny and all CI coders.

    I just got started my journey with this framework and it’s great - even for newbies like me.

    Although, I have a problem with integrating Tank auth library with your bootstrap pack.

    I mean, I know that there’s a template view for every website element like header, footer etc.

    But I can’t figure out how to make login form in the navbar.

    I discovered that TankAuth has a following code in home controller:

    if (!$this->tank_auth->is_logged_in()) {
       redirect('/auth/login/');
      } else {
       $this->data['user_id'] = $this->tank_auth->get_user_id();
       $this->data['username'] = $this->tank_auth->get_username();
       $this->data['role']  = $this->tank_auth->get_role();
       
       $this->_render('pages/home'); 
      }

    And I already connected it with your _render method, which is awesome at the point 😊

    But, still can’t put the login form inside the navbar without making crappy code 😊

    Do I have to write a method in nav_helper (like isLoggedIn) ? Or is there a better way to make it work?

    Thank you in advance
    Cheers

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases