Welcome Guest, Not a member yet? Register   Sign In
Codeigniter + twitter bootstrap + html5boilerplate + MY_Controller
#1

[eluser]vesparny[/eluser]
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 Smile)

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

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


...and let me know Smile
#2

[eluser]co[dezyne][/eluser]
interested to see where you go with this.
#3

[eluser]vesparny[/eluser]
i just want to create a simple CI skeleton app...
#4

[eluser]dstrickler[/eluser]
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

[eluser]vesparny[/eluser]
[quote author="dstrickler" date="1331571273"]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?[/quote]

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

[eluser]dstrickler[/eluser]
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

[eluser]vesparny[/eluser]
[quote author="dstrickler" date="1331673307"]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?[/quote]

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

[eluser]dstrickler[/eluser]
Thanks - I'll check it out some more tomorrow.
#9

[eluser]Go-Trex[/eluser]
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:

Code:
$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

[eluser]Go-Trex[/eluser]
** Bump **

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

Code:
$this->data['variable1'] = 'My variable1 output';




Theme © iAndrew 2016 - Forum software by © MyBB