I am trying to set up a composer package but i cannot seem to get it to load when i try it from a new project
my package is here https://github.com/shorif2000/pagination and the packgist is here https://packagist.org/packages/shorif2000/pagination
in a new project i have
{
"name": "ec2-user/pagination",
"authors": [
{
"name": "shorif2000",
"email": "shorif2000@gmail.com"
}
],
"require": {
"shorif2000/pagination": "dev-master"
},
"minimum-stability" : "dev"
}
$ cat index.php
<?php
require './vendor/autoload.php';
use Pagination\Paginator;
$totalItems = 1000;
$itemsPerPage = 50;
$currentPage = 8;
$urlPattern = '/foo/page/(:num)';
$paginator = new Paginator($totalItems, $itemsPerPage, $currentPage, $urlPattern);
?>
<html>
<head>
<!-- The default, built-in template supports the Twitter Bootstrap pagination styles. -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
</head>
<body>
<?php
// Example of rendering the pagination control with the built-in template.
// See below for information about using other templates or custom rendering.
echo $paginator;
?>
</body>
</html>
it fails with error
Fatal error: Uncaught Error: Class 'Pagination\Paginator' not found in /opt/pagination/index.php:12 Stack trace: #0 {main} thrown in /opt/pagination/index.php on line 12
. I tried use shorif2000\Pagination\Paginator;
which gave same error as well