1. Go to this page and download the library: Download moln/gzfextra library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace User\Model;
use Zend\Db\TableGateway\TableGateway as ZendTableGateway;
/**
* UserTable
*
* 默认带有公共函数特性
* @method int fetchCount($where)
* @method \ArrayObject|\Zend\Db\RowGateway\RowGateway find($id)
* @method \Zend\Paginator\Paginator fetchPaginator($where = null)
* @method int deletePrimary($key)
*/
class UserTable extends ZendTableGateway
{
}
public function indexAction()
{
$users = $this->getServiceLocator()->get('UserTable');
$row = $users->find(1);
}
class Module
{
public function onBootstrap(MvcEvent $e)
{
$eventManager = $e->getApplication()->getEventManager();
$gListener = new GlobalModuleRouteListener();
$eventManager->attach($gListener);
}
public function getConfig()
{
return GlobalModuleRouteListener::getDefaultRouterConfig();
}
}