M
M
Michael2019-04-15 20:04:25
Yii
Michael, 2019-04-15 20:04:25

How to disable placeholder output in yii2-images?

Hello everybody! Please tell me, maybe someone has already encountered a similar issue, when displaying images using the yii2-images widget using the display all images function getImages(), provided that the images were not loaded, the placeholder is always displayed, how to make it not displayed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
elliot, 2019-04-15
@elliot

https://github.com/CostaRico/yii2-images/issues/50 - seems like a solution to the problem.

F
Fedor Grebennikov, 2019-04-15
@grebennikovf

Mikhail Balagura , anyway, the solution in such cases is similar, which is indicated by the link elliot ... We
inherit from yii2-images, look for the place where the placeholder is given, override the method with our own.
If we consider a very special case directly, then now there is such a code:

public function getPlaceHolder(){
        if($this->placeHolderPath){
            return new PlaceHolder();
        }else{
            return null;
        }
    }

Those. if placeHolderPath is not set/nulled in the module config, then it will return null
. If this does not help, then the advice from the beginning will definitely do the trick.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question