Image
Image copied to clipboard
Custom filter
I would like to create a custom filter so I have this:
abstract class Adapter implements AdapterInterface
{
//....
private function myFilter()
{
die("Entering in my myFilter");
$this->negate();
$this->sepia();
}
}
I have this code in my view:
src="{{ image('images/' ~ producto.imageName).myFilter
but Entering in myFilter is never shown..
Hello You have to change the adapter used by the image to do such things
thanks, but what do you mean exactly? what should I change in the adapter? why it is not entering to the adapter myFilter?
You just created a new class implementing AdapterInterface, right?
no, by the moment (just to check if the filter works) I added myFilter() to this class: https://github.com/Gregwar/Image/blob/master/Adapter/AdapterInterface.php
any help?
You mean you wrote it in the base Adapter class? Your method should be public
I have changed the function to public:
public function myFilter()
{
die("jfkasld");
$this->negate();
$this->sepia();
}
but it still not entering to it, since "jfkasld" is not shown.
I have tried to add it to Adapter.php and Common.php.
Any example that shows what I'm trying to get?