namespaces Archives | phpGrid - PHP Datagrid Create PHP grids in minutes, not hours. Sun, 29 Aug 2021 22:13:07 +0000 en-US hourly 1 CodeProjecthttps://wordpress.org/?v=7.0.3 129966043 PHP Namespaces Support https://phpgrid.com/announcements/php-namespaces/ Thu, 17 Mar 2016 03:07:05 +0000 http://phpgrid.com/?p=8769 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 […]

The post PHP Namespaces Support appeared first on phpGrid - PHP Datagrid.

]]>
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!

The post PHP Namespaces Support appeared first on phpGrid - PHP Datagrid.

]]>
8769