Hi, Im using slim3, using composer to load samayo/bulletproof image app. My problem is with the utils file that is only a function. I can access and use “use Bulletproof\Image”; inside slim but not the stand alone image resize function.
error im getting…Call to undefined function Bulletproof\Utils\resize()
// file inside vendor
namespace Bulletproof\Utils;
// no clase name only function
function resize($image, $mimeType, $imgWidth, $imgHeight, $newWidth, $newHeight, $ratio = false, $upsize = true) {//..}
im using a image controler with this function.
use Bulletproof\Image;
public function bulletproof1(Request $request, Response $response, Image $image) {
\Bulletproof\Utils\resize(
$image->getFullPath(),
$image->getMime(),
$image->getWidth(),
$image->getHeight(),
50,
50);
// location for the php file
// vendor samayo bulletproof src utils func.image-resize.php
namespace Bulletproof\Utils;
function resize($image, $mimeType, $imgWidth, $imgHeight, $newWidth, $newHeight, $ratio = false, $upsize = true)
controller file…
use function Bulletproof\Utils\resize;
use Bulletproof\Image;
public function bulletproof1(Request $request, Response $response, Image $image) {
\Bulletproof\Utils\resize( //,,,); // tried it with this
resize(//...); and also
}
the error Call to undefined function Bulletproof\Utils\resize()