class Person { public $name; public function __construct($name) { $this->name = $name; } } $person = new Person('John'); echo $person->name; //Outputs "John"
require_once 'Structures/DataGrid.php'; $options = array( 'paging' => true, 'perPage' => 10, 'pagerDelta' => 2, 'pageVar' => 'pg' ); $dataGrid = Structures_DataGrid::factory(null, $options); //Determine Package Library: Structures_DataGrid is the package libraryIn this example, we are using PEAR's DataGrid package to create a new data grid object. The "factory" method is used to create an instance of the DataGrid class with the specified options. The "null" parameter is used to indicate that we are not using any data source for now. We then assigned the returned object to the $dataGrid variable. The package library used in this example is Structures_DataGrid.