Categories > TinyButStrong general >

Organizing logic outside View?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Marc
Date: 2011-09-01
Time: 06:18

Organizing logic outside View?

I have a really basic beginner's PHP setup, like:

assets
  css
  js
  images
docs
  docs for classes
lib
  classes
templates
  view files
index.php

I have a lot of functionality piling up inside of index.php. :-) How do I figure out what to separate into a Model, etc.? For example, setting up a query to load into TBS -- should I put that somewhere else? Organize it by the type of operation?

Any advice welcome, thanks. TBS has made me more aware of code organization, but I don't feel ready for framework use yet...they seem too complex for getting simple work done.
By: Skrol29
Date: 2011-09-02
Time: 23:07

Re: Organizing logic outside View?

Hello Marc,

They are several ways to roganize your code using a Template Engine. Even FrameWork integration is possible.

For a simple application, I usually have a main "index.php" file that call sub_script depending to the screen to display. Then I have one couple of script(php)/template(html) per screen.
I use TbsSQL or PDO for the connectivity tool.
I hope that help.