EllisLab text mark
Advanced Search
     
Codeigniter + twitter bootstrap + html5boilerplate + MY_Controller
Posted: 09 March 2012 10:52 AM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Joined: 2011-12-26
3 posts

interested to see where you go with this.

 
Posted: 09 March 2012 11:32 AM   [ Ignore ]   [ # 12 ]   [ Rating: 0 ]
Joined: 2012-02-19
11 posts

i just want to create a simple CI skeleton app…

 
Posted: 12 March 2012 12:54 PM   [ Ignore ]   [ # 13 ]   [ Rating: 0 ]
Joined: 2012-03-12
5 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?

 
Posted: 12 March 2012 06:44 PM   [ Ignore ]   [ # 14 ]   [ Rating: 0 ]
Joined: 2012-02-19
11 posts
dstrickler - 12 March 2012 12:54 PM

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.

 

 
Posted: 13 March 2012 05:15 PM   [ Ignore ]   [ # 15 ]   [ Rating: 0 ]
Joined: 2012-03-12
5 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?

 
Posted: 13 March 2012 08:15 PM   [ Ignore ]   [ # 16 ]   [ Rating: 0 ]
Joined: 2012-02-19
11 posts
dstrickler - 13 March 2012 05:15 PM

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

 
Posted: 13 March 2012 11:18 PM   [ Ignore ]   [ # 17 ]   [ Rating: 0 ]
Joined: 2012-03-12
5 posts

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

 
Posted: 14 March 2012 04:01 AM   [ Ignore ]   [ # 18 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-01
22 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.

 
Posted: 14 March 2012 04:07 AM   [ Ignore ]   [ # 19 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-01
22 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'
 
Posted: 14 March 2012 04:15 AM   [ Ignore ]   [ # 20 ]   [ Rating: 0 ]
Joined: 2012-02-19
11 posts

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

 
Posted: 18 March 2012 02:28 AM   [ Ignore ]   [ # 21 ]   [ Rating: 0 ]
Joined: 2012-01-11
6 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.

 
Posted: 18 March 2012 10:29 AM   [ Ignore ]   [ # 22 ]   [ Rating: 0 ]
Joined: 2012-02-19
11 posts
Exeneva - 18 March 2012 02:28 AM

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. smile

 
Posted: 18 March 2012 08:38 PM   [ Ignore ]   [ # 23 ]   [ Rating: 0 ]
Joined: 2012-01-11
6 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.

 
Posted: 14 November 2012 06:06 AM   [ Ignore ]   [ # 24 ]   [ Rating: 0 ]
Joined: 2012-11-14
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 smile

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

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

 
Posted: 14 November 2012 06:26 AM   [ Ignore ]   [ # 25 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-01
22 posts

Hi Coob,

I am also a user of this extension of the CI_Controller. I have made some modifications/improvements in the past for own use. One of the modifications was integration with tank_auth in the boilerplates as default.

In nav.php you can alter the code to show a login form when the user is not logged in. You can check this with the function you mentioned above

$this->tank_auth_>is_logged_in() 

. If this returns FALSE then you can show the login form, otherwise you can show the navigation links for example.

nav.php

<?php

if($this->tank_auth->is_logged_in())
{
    
// show navigation links
    
echo anchor(base_url(), 'Home');
    echo 
anchor('admin''Admin area');
}
else
{
    
// show login form
    
echo form_open();
    ....

Make sure that the tank_auth library is autoloaded since you will be using the library on every page of your website.