Webdesign MVC - going in the right direction?



I am trying to learn webdesign using the MVC design pattern. Right now, I am stuck at a point where my code gets more complex, and I am unsure about the structure and where to put which code parts.

I started with an index.php file as my controller, which right now does not much more than loading the Slim framework to render the different views

$app->get('/', function() use ($app){  
$app->render('header.php');  
$app->render('content.php');   
$app->render('footer.php');  
});  
$app->run();

Then I built a complex content.php where I do a lot of form data logic, reading from a server directory, and echoing the results mixed with html tags. That surely will violate the MVC pattern, right?

What is the general approach to this? Should I put all the logic inside the index.php, store the results in an array, and pass that to the framework's render function, like this:

$app->get('/', function() use ($app){ 

//Do something and store results in an Array

$app->render('header.php', anArray());  
$app->render('content.php', anArray());   
$app->render('footer.php', anArray());  
});  
$app->run();

How can I prevent index.php becoming too complex when doing so? Is there a different approach to take?


Related to : Webdesign MVC - going in the right direction?
cheap webdesign
Programming Languages
where can I go to find cheap webdesign? I was looking and everything is over $100, I'm thinking of starting a small business and have next to no money to start it but I need a website. Is there anyplace I can go for a CHEAP website? I already have hosting and my design needs are very simple. If I can't go any place to get one cheap enough is there any place I could go were I could negotiate with people i.e $30 + 5% of my company.
WebDesign Forums
Programming Languages
For anyone interested in web design, Ive created a (still beta) site for ya. lemme know what you think! -> http://webdesignforums.tk
webdesign programs
Programming Languages
Hi I was wondering if any website designers want to help me create a site, or if anyone could point me to any good tools. I have a killer website idea but no skillz or money. Mainly looking for tools I guess, unless someone wants to build it :P
webdesign !! $ !!
Programming Languages
This summer I'm going to set up a little webserver at home and start focussing on webdesign.
Now my question is if anyone knows any good forums to sign up at. I'm looking for forums which are helpful, loaded with info and with a nice community. Sort of like this one, but revolving around webdesign.
Mainly looking for php-, perl-, JS forums. Perhaps a place for the visual aspect of it all too.
Thanks in advance :)
I know next to nothing about webdesign. Assistance?
Programming Languages
I wanted to begin blogging so I got a domain then a host and I am using Wordpress 4.1 to design and as an interface for my site.

Site I am referencing: www.livetouplift.com

I have firebug but I don't know much about how to use it. I would like the secondary navigation/ the buttons that say "Home", "Contact Me" to have their own colors. I kind of wanted them to be like the colors of the uplift logo- grey and black. Or I wanted to add an "About Me" page and have the colors transition from black...

I know next to nothing about webdesign. Assistance?
Webdesign MVC - going in the right direction?
Programming Languages

I am trying to learn webdesign using the MVC design pattern. Right now, I am stuck at a point where my code gets more complex, and I am unsure about the structure and where to put which code parts.

I started with an index.php file as my controller, which right now does not much more than loading the Slim framework to render the different views

$app->get('/', function() use ($app){  
$app->render('header.php');  
$app->render('content.php');   
$app->render('footer.php');  
});  
$app->run();

Then I built a complex content.php where I do a lot of form data logic, reading from a server directory, and echoing the results mixed with html tags. That surely will violate the MVC pattern, right?

What is the general approach to this? Should I put all the logic inside the index.php, store the results in an array, and pass that to the framework's render function, like this:

$app->get('/', function() use ($app){ 

//Do something and store results in an Array

$app->render('header.php', anArray());  
$app->render('content.php', anArray());   
$app->render('footer.php', anArray());  
});  
$app->run();

How can I prevent index.php becoming too complex when doing so? Is there a different approach to take?



Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .