Development Changes - Apr 2011

April 4thform_body Tag Renamed

Default Form template used to contain <?form_body?> tag. That's the place in the form.html template, where fields are located. It's now been renamed into standard <?Content?> tag making addition of other elements into form body much easier:

$f->add('H2')->set('appears after last field');

April 4thAlign "money" column type in the grid to the right

Properly aligns not only the money, but also the title

Result

Name Salary
John 2,000.00
Peter 4,200.00
Minus -200.00
 

Code

$grid=$page->add('Grid');
$grid->addColumn('text','name');
$grid->addColumn('money','salary');
$grid->setStaticSource(array(
            array(
'name'=>'John','salary'=>'2000'),
            array(
'name'=>'Peter','salary'=>'4200'),
            array(
'name'=>'Minus','salary'=>'-200'),
            ));

April 7thDSQL debug output is better

Setting debug mode on DSQL object will output breakdown of parameters

$str=$page->api->db->dsql()->debug()
    ->
table('foo')
    ->
field('bar')
    ->
where('x>',123)
    ->
limit(10)
    ->
select();

April 9thGrowl (ui.atk_notify.js) shows messages better

Result

 

Code

$page->add('Button')->js('click')
    ->
univ()
    ->
successMessage
        
('Yey, it works!');

April 11thremoved object->getName(), use object->name instead

Result

AgileWeb_whatsnew_apr2011_doc_example_3_view
 

Code

$page->add('Text')
  ->
set($page->name);

April 11thNew way for handling exceptions

Introducing new way of producing exception in Agile Toolkit. Calling exception() method will return object of the right exception class. For example calling $db->exception() will properly return database-related exceptino and might also include some object-related information, while exception generated in model, would generate validity exception.

Be sure to not include any variables into 1st argument to exception, this string will be localized. Instead specify relevant arguments by calling addMoreInfo()

throw $this->exception('Something went wrong')
    ->
addMoreInfo('niceinfo',$info);

April 13thAdd zebra template for grid

use 4nd argument of array('grid_stripped') to use this new template. Remember that you can always add your own templates to further ehance look of your objects.

Result

Name Salary
John 2,000.00
Peter 4,200.00
Minus -200.00
 

Code

$grid=$page->add('Grid',null,null,array('grid_striped'));
$grid->addColumn('text','name');
$grid->addColumn('money','salary');
$grid->setStaticSource(array(
            array(
'name'=>'John','salary'=>'2000'),
            array(
'name'=>'Peter','salary'=>'4200'),
            array(
'name'=>'Minus','salary'=>'-200'),
            ));

April 15thImplement Auto-complete

use 4nd argument of array('grid_stripped') to use this new template. Remember that you can always add your own templates to further ehance look of your objects.

Result

 

Code

$form=$page->add('Form');
$form->addField('autocomplete','test')
    ->
setValueList(
            array(
'John','Peter','Jane'));

April 15thadd ability to disable full-screen mode (for true gs960)

By default your Agile Toolkit application uses full width of the screen. If you want to have true 960gs, then you should add the following to your Api's init() method.

$this->template->del('fullscreen');

April 19thShowing timestamps

To change format, add $config['locale']['timestamp']='Y-m-d'; or $config['locale']['datetime'].

Result

Ts Dt
18/04/2014 00:00:00 18/04/2014 00:00:00
 

Code

$grid=$page->add('Grid');
$grid->addColumn('timestamp','ts');
$grid->addColumn('datetime','dt');
$grid->setStaticSource(array(
            array(
'ts'=>date('Y/m/d'),'dt'=>date('Y/m/d')),
            ));

April 25thAllow to substitute "Grid" class

Many components rely on Grid component. Often a developer would want to make system-wide changes to the Grid component. Push mechanism allows for all the components to use the new version. Push is implementing by redefining "Grid" class. By default it's defined like this:

class Grid extends Grid_Basic{}

All of the documentation, addons and user code must use "Grid" and not "Grid_Basic". This allows you to define this class locally inside your lib/Grid.php and redefine some of the methods there.

April 26thImprove "link" format in Grid

You can use <?_link?> or any other field tag as a template for "link" column, in setTemplate().

Result

Name Details Proflie
John John Details xx
Peter Peter Details xx
 

Code

$grid=$page->add('Grid');
$grid->addColumn('text','name');
$grid->addColumn('link','details');
$grid->addColumn('link','proflie')
    ->
setTemplate('<a href="..">xx</a>');
$grid->setStaticSource(array(
            array(
'id'=>1,'name'=>'John',
                
'details'=>'John Details'),
            array(
'id'=>2,'name'=>'Peter',
                
'details'=>'Peter Details'),
            ));

April 27thOur standard menu is joined by Menu_Light

This menu operates entirely on templates.

// Regular
$menu=$page->add('Menu');
$menu->addMenuItem('hello');
$menu->addMenuItem('world');

// Lightweight
$menu=$page->add('Menu_Light',null,null,array('mymenu'));
// items are defined in mymenu.html

April 28thRemoved "jui" theme, added "default" and "elephant"

Look into your index.php file. It might still be using "jui" theme. We suggest to remove argument alltogether or set to "elephant" for the older look of Agile Toolkit.

$api=new Frontend('myapp');
$api->main();

April 29thLogin form looks much cooler

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.