Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

The Basics

#1 User is offline   Riley Wiebe 

  • Faintmedia CTO
  • Icon
  • View blog
  • Group: Admin
  • Posts: 209
  • Joined: 06-May 08
  • Gender:Male
  • Location:Canada
  • Creator of Faintmedia Raive Studios/Decade Creations Member Northern Storms Admin Creator of Led Salad Coffee Addict Most Posts Purchased 1 - 3 products Reported a bug

Posted 13 June 2009 - 06:08 PM

Broken Framework User Manual
The Basics

This manual is not complete yet.

File Structure

/
  • application/
    • cache/
      • lang/
        • en/
    • config/
    • libs/
    • logs/
    • public/
      • controllers/
      • errors/
      • models/
      • templates/
    • settings/
  • system/
    • bundles/
      • drivers/
        • account_methods/
      • sources/
        • account_methods/
        • jquery/
        • recaptcha/
        • tinymce
    • libs/
    • sources/
      • smarty/



Basic Structure
When building an application you will spend most of your time in the public folder. The public folder contains four folders: controllers, errors, models and templates. The controller folder is at the top of the food chain. When the script is being run the controller will always be called first and then any function inside that controller. The controllers will handle most of the data. For example, if you post a form the controller will handle the post and add the information to the database or do anything else you wish to do with that data. They are also used to get data and pass it to the models.

Models are used to control the template. They will select what template file you are using and define different variables that can be called by the template file. The controller is able to pass data to the model via an array. So when a controller gets a piece of data you need for your model you can add that data into the data array and pass it to the model from there the model can call for that data and do what it needs with it. It could be as easy as saying you want to display an error on the current page or you don't.

Template files are what the user sees. They are fully customizable so it is easy to create the look you want. All template variables and blocks are set in the model and then you can use them inside your template.

Paths
The path setup is simple for the whole script. When you visit index.php it will run the entire script for you. No other pages are needed. In order to call a controller you would do something like this, assuming your not using .htaccess to change it.

index.php?/p/controllerName/

"p" stands for path and it means everything after it inside the slashes is a way to call a file or set variables.

If you want to call a different function inside the controller controllerName it would look like this:

index.php?/p/controllerName-functionName/

That is the basic URL structure. If you want to define variables so that they will work better with .htaccess you can do so like this.

index.php?/p/controllerName-functionName.variableName-value/

In order to call this variable you will need to use the $this->do_this->get_vars() function. That function would tell you that variableName = value. If you want to add more variables you can do so like this:

index.php?/p/controllerName-functionName.variableName-value-var-example-another-yesAnother/

Now the variables are:

variableName = value
var = example
another = yesAnother

Security
We built in security with the framework. Once thing is we clean all of the text that is either being posted or your getting. This is automatically done for you. If you have some value that you wish for this not to be done to we have that feature as well. You can use $this->cleaners->undo($string); then you will have the raw string.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users