1. Go to this page and download the library: Download zfcampus/zf-versioning 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/ */
// Set v2 as default version for all routes
'zf-versioning' => [
'default_version' => 2,
],
// Set default version to v2 and v3 for the users and status routes respectively
'zf-versioning' => [
'default_version' => [
'myapi.rest.users' => 2,
'myapi.rpc.status' => 3,
],
],