Miscellaneous Archives | phpGrid - PHP Datagrid Create PHP grids in minutes, not hours. Sun, 01 Mar 2015 08:04:51 +0000 en-US hourly 1 CodeProjecthttps://wordpress.org/?v=7.0.3 129966043 Method Chaining https://phpgrid.com/example/method-chaining/ Sat, 14 Jul 2012 17:22:56 +0000 http://phpgrid.com/?p=2168 Method chaining is now supported starting version 5.0. It’s not required, but it provides more readable code and reduce amount of source code in a fluent interface. For example: With method chaining (v5.0 and later): 12$dg->set_col_title(“lastName”, “Last Name”)->set_col_required(“lastName”, true)->set_co_default(“lastName”, “Robert”); $dg->enable_edit(“FORM”)->enable_export(true)->enable_resize(true); Without method chaining: 123456$dg -> set_col_title(“lastName”, “Last Name”); $dg -> set_col_required(“lastName”, true); $dg -> […]

The post Method Chaining appeared first on phpGrid - PHP Datagrid.

]]>
Method chaining is now supported starting version 5.0. It’s not required, but it provides more readable code and reduce amount of source code in a fluent interface.

For example:

With method chaining (v5.0 and later):

1
2
$dg->set_col_title(“lastName”, “Last Name”)->set_col_required(“lastName”, true)->set_co_default(“lastName”, “Robert”);
$dg->enable_edit(“FORM”)->enable_export(true)->enable_resize(true);

Without method chaining:

1
2
3
4
5
6
$dg -> set_col_title(“lastName”, “Last Name”);
$dg -> set_col_required(“lastName”, true);
$dg -> set_co_default(“lastName”, “Robert”);
$dg -> enable_edit(“FORM”);
$dg -> enable_export(true);
$dg -> enable_resize(true);

The post Method Chaining appeared first on phpGrid - PHP Datagrid.

]]>
2168