Development Changes - Mart 2011

March 26thurl_prefix improvement

Agile Toolkit allows you to define url_prefix and url_postfix inside config. By default postfix is '.html' but you can change it into anything else. Now url_prefix can also be defined using question mark. Set it to '?page=' and you no longer need .htaccess file. This is now a default behavior for 4.0.2 branch too.

March 26thdefault-config.php support

Historically Agile Toolkit had no file with default config values. A sample use of getConfig('db/dsn','root@localhost/db'); was used where 2nd argument is providing a default value. In addition to that you can specify file with default config values inside config-default.php.

Please, do not put your SQL password in there, it's not secure.

March 25th<?page?> and <?template?>

A few updates now adds support for global tags such as <?page?> and <?template?> to ALL Views. Previously only "template" tag was supported inside shared.html template. Now any template you can (and SHOULD) use those tags. To remind — those tags substitute value inside them with the proper URL pointing to the resource. In case with page you can use values such as "index", "account/password", "./step2", or ".." which will define page relatively. Template tag will search for the file through PathFinder and substitute with the correct one.

By using those tags your software links will always work even if you deploy your software NOT in the webroot.

March 24thuniv().setTimeout() added

This function now allows you to access setTimeout function from inside PHP. Below code will submit a $form 5 seconds after $field contents are changed:


March 24thform_hybrid.html added

Agile Toolkit already got several form styles: basic, horizontal, vertical. However now you can combine them inside the same form:

$f->setClass('basic'); // style for first section
// add fields here

$f->addSeparator('vertical');//next section style
// add fields here

$f->addSeparator('basic'); //next section style
// add fields here

March 24thpage/path/to.html

If page is not defined inside a .php class, then Agile Toolkit's ApiFrontend attempts to find a static template for this page. If page you are accessing is called my/sub/page.html then normally it would have loaded template from template/jui/page/my_sub_page.html. Now if this template is not found, Agile Toolkit will attempt to load template/jui/page/my/sub/page.html. This gives you a choice to select your own convention regarding storage of multi-level page templates.

March 23rdNew Form Styles

Developers are not form designers. That's why Agile Toolkit looks to bundle some nice styles you can choose from. take a look at form styles. To use them use the following code:


//$f->setFormClass('basic atk-form-basic-2col');
//$f->setFormClass('vertical atk-form-vertical-2col');

You can check out those forms in your installation by pointing browser at /playground.html

March 23rdExpander's new ID field

If you have ever used Grid Column type 'expander', you should know that they automatically locate "id" field in the Grid and will pass them as a GET argument to your sub-page. Creation of expander within expander were producing clashes between ID fields. Now grids will also determine and pass a get argument based on the table name used inside grid. For example if you are listing users in your grid from 'user' table, then expanders will pass user_id=123 along.

The way how this is being determined is quite sophisticated and works with all variations of data sources for Grid.

class page_test extends Pafe {


// class

March 22ndAgile Toolkit uses 960gs

960 Grid System is designed for improved layouts inside your web applications. The basic idea is to divide 960 pixel width into 12 columns and provide classes with appropriate width for professional layout.

Probably the biggest impact is on the forms, which now have proper width. The width depends on form class used, but you can select best appropriate form based on your layout and space available.

By the nature 960 layout is a fixed-width layout, however for compatibility we have made a it full-screen by default. If you would like to use a proper 960 fixed-width gs, then remove "atk-fullscreen" class from your <body> tag in shared.html.

March 21stForms without submit handle

Often developers create form and forget to handle form's submit event. Because form expect to receive JavaScript when they are submitted, they wil attempt to evaluate wrongly returned HTML code and it usually comes up as AJAX parse error.

This fix will add submit handler for all forms if you forgot to specify one. They will do nothing apart from putting error into standard javascript console about missing submit handler.

March 15thExtra class for jQuery UI dialog

Normally to build a jQuery UI dialog you need a dedicated <div> element. univ().dialogURL() and similar functions are wrapper for jQuery UI dialogs and create that div automatically. However you might be willing to pass some class to that new dialog window. New Option for dialogURL() allows you to do that.

$b->js('click')->univ()->dialogURL('Frame Title',

March 14th$dq->where('val in',$array)

where() method of Dynamic Queries is used to properly escape 2nd argument. When you are performing basic comparisons it's quite straightforward where('gender','M'). However "in" operator allows to specify a number of values. Previously it was working only in this format:

$dq->where('id in','1,2,3');
In this case each value separated by coma would be quoted separately. However this wouldn't work if the value you are trying to match would contain comma. The new use format fixes that shortcoming:
$dq->where('id in',array(1,2,3));

March 14thField's->setAttr()

Historically you could add properties to Form Fields using setProperty() method. Now you can use setAttr() which matches terminology of jQuery.


March 14thuniv()->bindFillInFields()

New function of univ() library allows to automatically fill-in values into other form fields when dropdown has been changed. This relies on included "dictionary" within your dropdown with the list of pre-defined correspondences between dropdown field value and values to be filled in in other fields. Example of bindFillInFields.

March 13th<?field_type?> in form tpl.

Form's template (form.html) contains a section which defines how each field should look. This region is called <?form_line?>. Perviously same form_line was used for all filed types. Now you can use field_type tag which will be initialized to the type of the field. This allows hard-core designers to properly define field width based on field type. For example textarea can now be bigger.

atk4_loader undergone many changes

Reloading of content is always a very delicate process. This method is used when you do $g-<js()->reload(). The problem with reloading is that it should properly replace contents with new data without loosing any ID's then re-apply javascript. When you are reloading contents of an element, then newly loaded data will typically contain new initialization of that same element, so it's important to properly destroy previous element. If you find a problem with reloading, please submit a bug.

March 5thSpecifying URL for URL Class

$api-<getDestionationURL($page) can now be used with absolute URLs. It will still manage to properly append arguments to the URL (including sticky arguments).

March 5thNL2BR for Listers

If your database contains HTML code and you will try to output it through Lister, then by default your HTML code will be escaped. To avoid this, you can disable this by setting $lister-<safe_html_output=false;

You can now also set $lister->nl2br_output=true; which will convert newlines into <br/> in your output. This is handy if you are outputing user-defined text with newlines.

March 1stVersion Verification Function

If you are writing an Add-on which requires Agile Toolkit of a certain version, you now can use the method versionRequirement().

        // my addon code
If version is older, it will terminate execution. Alternatively you can specify 2nd argument "true" and function will return boolean value instead.
        // my addon code
Older Entries Newer Entries

Development History

All changes to the development version of Agile Toolkit are listed below.

Agile Toolkit Core
  • Release 4.2 NEW!
  • Release 4.1.2
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • Mart 2011
  • February 2011

    • To stay up to date, by following @atk4 on twitter. Use Git / master branch for most recent version.