PHP Namespaces Support

In PHP, you can’t have two classes that share the same name. It becomes a problem when your code grows such as a third party class library could happen to have a class the same as yours. Introduced in version 5.3, PHP namespaces allow us to circumvent this issue. Namespace helps to avoid naming collision and also organizes our code into “packages”. Modern PHP frameworks such as Laravel and CodeIgniter also use namespace to package code into smaller components. It is necessary for phpGrid to support namespace as more people are integrating phpGrid with those frameworks.

We are happy to announce that PHP namespaces support in phpGrid is coming soon. Still not sure what that means? Don’t be alert! The good news is that it requires little changes in your existing phpGrid code. All you will need is to add the following in the first line.

Prior to version 7.5

1
use phpGrid\C_DataGrid;

Update (8/28/2021)

Since version 7.5, there has been a minor but critical change in namespace. The new namespace is now phpCtrl to accommodate other PHPControls software products.

1
use phpCtrl\C_DataGrid;

Stay tuned!