Issue with usage, example doesnt work after installing with composer
petrk94 opened this issue · 3 comments
petrk94 commented
Hello,
Im facing an, hopefully easy to solve issue, but I really dont know what the problem is.
Im using the example of the github repository, the first one and installed it in the parent directory now using in the same directory the test.php file and its telling me
PHP Fatal error: Uncaught Error: Class 'Cocur\Slugify\Slugify' not found
Attached a screenshot, hopefully someone can help.
Im using PHP 7.4
florianeckerstorfer commented
If you use this example with Composer do you have auto-loading enabled? More information: https://getcomposer.org/doc/01-basic-usage.md#autoloading
kktsvetkov commented
@petrk94 You need to include the composer beforehand
require '/vendor/autoload.php';
use Cocur\Slugify\Slugify;
$slugify = new Slugify();
echo $slugify->slugify('Hello World!'); // hello-world
petrk94 commented
Shame on me, thank you, I totally forgot that^^