Development Information

May 16, 2011

MiniMVC – Small Fix

Filed under: Mini MVC Information,Updates — judda @ 12:46 am

I have pushed out a small fix for the configuration file (./app/config/config.php) out to all versions of MiniMVC.  There was an issue that if you put MiniMVC a few folders deep the URLs would start losing folders.  This has been fixed as well as I added a / at the end of the index.php so that it too can be used properly (i.e. not a special case to be handled differently than if __SHOWINDEX__ was disabled).

Sorry for any inconveniences these bugs may have caused.

May 8, 2011

MiniMVC Form Builder 1.0.10 → 1.0.11

Filed under: Mini MVC Information,Updates — judda @ 10:11 pm

Small update.  As mentioned on Wednesday, this weekend’s update fixes the issue where you could only select one value.

To select more than one value all you need to do is for the value specify an array of all keys which will be marked as selected if found.

May 4, 2011

Bug Fixes Coming Soon …

Filed under: Mini MVC Information — judda @ 8:17 pm

I was informed a little while ago that there was an issue with the updated version of the Form Builder where if you select a checkbox list you can only default 1 of the values to selected, not multiple.  I will be working on fixing this issue this weekend.

I also want to mention that I believe the version of the database class included with MiniMVC currently is a bit out of date.  I had completed some updates making it work properly and not give notices when running on E_STRICT.  So you will want to update the version by downloading the database class from the link on the right named “Database Class” and then placing it into the system/libraries folder of MiniMVC.

Any bugs you find please let me by either posting it as a comment or by emailing me it through my contact page.

Tutorials now on YouTube

Filed under: Mini MVC Information — judda @ 8:14 pm

Apparently this has been up for 6 months already, but today was the first time I saw it.  Xylogeist who has been using MiniMVC has started a series on YouTube walking through how to make a CMS using MiniMVC.  The first video is available here.

Apparently the next video will be coming up within the next week or so, so I don’t know about you, but I can’t wait to see it :).

October 24, 2010

Mini MVC – Form Builder 1.0.2 → 1.0.3

Filed under: Mini MVC Information,Updates — judda @ 3:38 pm

After the previous update to the Form Builder, it was mentioned to me that the placing of each element in it’s own div was no longer required. This update removes those divs and just causes the straight HTML to be returned from the toHTML functions.

October 3, 2010

Mini MVC – Form Builder 1.0.1 → 1.0.2

Filed under: Mini MVC Information,Updates — judda @ 2:07 pm

After using the Form Builder, I realized that one part of how it was originally implemented made it extremely hard to use. This has now been fixed.

Instead of returning a string of the output from the actual object, the output is split into two sections:

  • FormBuilder::HTML – The HTML for the actual input element
  • FormBuilder::LABEL – If a label is present, the label part of the input field

September 5, 2010

MiniMVC v1.0.0 → v1.0.1 and Form Builder v1.0.0 → v1.0.1

Filed under: Mini MVC Information,Updates — judda @ 10:22 pm

Through use further use of MiniMVC and the Form Builder, I have noticed there were a few bugs in them.

MiniMVC the error handling wasn’t working correctly, so it has been fixed.

Form Builder was missing functions for setting CSS classes for the labels, so these (addLabelCSSClass, getLabelCSSClass) have been added in. These take the same parameters as the functions which are similar for the fields (addCSSClass, getCSSClass).

These updates are encouraged as they help to support the core functionality of the application.

August 22, 2010

Mini MVC – How to Use – The Base Controller

Filed under: Mini MVC Information,Tutorials — judda @ 1:33 pm

Sorry for the horribly long delay but here is a quick run down on how to extend the BaseController to write your personal controllers.

As mentioned before, the controller acts as the liaison between the model and the view. These are the classes which get looked for and called whenever your site is visited. For example, if your site is http://www.site.com and the URL is http://www.site.com/about, then Mini MVC will automatically look for the controller named ‘AboutController’ in the ‘./app/controllers/’ directory. The class name for each controller should have the name ‘Controller’ at the end, in order to prevent any namespace collisions between the controllers and the models. It also allows you to quickly and easily determine the difference between the two.

For each controller, you can have as many methods as you would like. These methods are also accessible through the web depending on the URL. For example, http://www.site.com/about/contact would call the ‘contact’ function within the ‘about’ controller. If no function name is provided in the URL, then the default function which is called will be used. This is defined in the configuration file (./app/config/config.php) as the __DEFAULTFUNCTION__. The default function which is called in ‘index’.

Please Note: if you don’t want a function to be web-accessible, prefix it with __ and it will be automatically ignored.

When making your own controller, you should always extend the base class (BaseController) because it provides a bit of additional functionality which is not available if you only make it extend the base class. For example, when you are using a model in your controller, you can then use

$this -> __loadModel ( 'ModelName' );

to load the model into memory and then access it directory through the instance of the controller (i.e. $this -> ModelName).

A sample controller will look like this:

<?php
class SampleController extends BaseController // Accessible by the web through http://www.site.com/sample
{
    public function __construct ()
    {
        parent::__construct (); // Always call the parent's constructor to initialize all information
    }
 
    public function index () // Will be called if no function name is provided (i.e. http://www.site.com/sample)
    {
         // In here you will do any of your data manipulation or generation
         // and tell it what views and models to use
         Base::__loadViews ( array (
                 // Define the 3 parts of the view (header, body and footer) - these definitions are not necessary but they are useful
                 Base::VIEW_HEADER => array ( 'header.php' /* The view name(s) to use for the header */ ),
                 Base::VIEW_BODY => array ( 'body.php' /* The view name(s) to use for the body */ ),
                 Base::VIEW_FOOTER => array ( 'footer.php' /* The view name(s) to use for the footer */ )
             ),
                 // Any variables to send in
                 array (
                     // Please Note: All variables MUST have a name associated with them.
                     'key' => 'value', // Variables to be accessible to all views (accessible through $key in the view)
                     Base::VIEW_HEADER => array ( 'Title' => 'Welcome' ) // Variables only accessible to the header view (can be done for the body and footers as well)
             )
         );
    }
 
    // The $username variable will be filled in with the value associated with information after the function name
    public function other ( $username ) // Will be called if no function name is provided (i.e. http://www.site.com/sample/other/judda)
    {
         // i.e. http://www.site.com/sample/other/judda => $username = 'judda'
         // In here you will do any of your data manipulation or generation
         // and tell it what views and models to use
         Base::__loadViews ( array (
                 // Define the 3 parts of the view (header, body and footer) - these definitions are not necessary but they are useful
                 Base::VIEW_HEADER => array ( 'header.php' /* The view name(s) to use for the header */ ),
                 Base::VIEW_BODY => array ( 'body.php' /* The view name(s) to use for the body */ ),
                 Base::VIEW_FOOTER => array ( 'footer.php' /* The view name(s) to use for the footer */ )
             ),
                 // Any variables to send in
                 array (
                     // Please Note: All variables MUST have a name associated with them.
                     'key' => 'value', // Variables to be accessible to all views (accessible through $key in the view)
                     Base::VIEW_HEADER => array ( 'Title' => 'Welcome',
                         'name' => $username ) // Variables only accessible to the header view (can be done for the body and footers as well)
             )
         );
    }
}

That is all I can think about for this topic, please feel free to ask any questions about it so I can expand on this tutorial. :)

Form Builder (Mini MVC)

Filed under: Mini MVC Information,Updates — judda @ 1:12 am

I have completed a preliminary version of a form builder. It will allow you to programmatically build forms which can be send in from the controllers to your views so that you never have to worry about different views handling the information in different ways (or changing names or anything).

I will be posting links to the documentation soon so that all of the built-in features will be displayed. Just because you are doing things programmatically doesn’t mean you can’t stylize nor have valid HTML. You can add as many attributes to the input types as you want (including specialized ones for adding CSS classes and styles).

Please Note: In this version of the form builder, arrays of fields are not permitted (i.e. they will overwrite each other). I am actively working to remove this limitation as soon as possible.

Along with the form builder, I have uploaded a small update to the Mini MVC base engine (just a little clean up thing).

July 13, 2010

Layout Manager Plugin (Mini MVC) 1.0.0 → 1.0.1

Filed under: Mini MVC Information,Updates — judda @ 12:54 am

Tiny update. Now the body can be pushed through the layout folder as well.

If you know that a file will never exist in the layouts folder, you can include LayoutManager::BYPASS => true in the array passed into each of the arrays for the __loadViews function and it will skip the extra searches.

Older Posts »

Powered by WordPress