Welcome Guest, Not a member yet? Register   Sign In
Composer, php-diff and Class Not Found problems
#1

Hoping someone can point out the error of my ways. Haven't used composer very much, but it appears to have properly loaded the files, but I am still getting the dreaded "Class "DiffHelper" not found" error.
1) Installed the library with composer: "composer require jfcherng/php-diff"
2) Verified the files are there (/_site/vendor/jfcherng/php-diff/src/DiffHelper.php)
3) Added to the top of my controller: "use Jfcherng\Diff\DiffHelper;" (also tried "use DiffHelper;")
4) In my view file called: 

PHP Code:
<?php
 $changes 
DiffHelper::calculate($oldRecord[0]['comments'], $oldRecord[count($oldRecord)-1]['comments'], 'Unified');
 echo 
$changes;
 
?>

Ran the page and got the "Class not found" error! Feeling like I missed a step somewhere.

Thanks in advance!
Reply


Messages In This Thread
Composer, php-diff and Class Not Found problems - by SoccerGuy3 - 11-08-2021, 12:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB