Answer the question
In order to leave comments, you need to log in
How to display image in Yii view?
Images used to load normally on the local machine, but now they are not displayed on the hosting.
It throws out such a miracle:
I try to display it with a regular container:
<div>
<img src="/frontend/web/img/bootles.jpg">
</div>
Answer the question
In order to leave comments, you need to log in
Are you sure that here the state is correctly updated?
this.setState({
[e.target.id]: { inputValue: e.target.value },
});
updateInputValue({ target: { id, value } }) {
this.setState(prevState => ({
[id]: {
...prevState.id,
inputValue: value,
},
}));
}
PHPjedi error where setting and fetching from the state occurs.
this.setState({
[e.target.name]: e.target.value
});
value={this.state.name}
<input type="text"
className="floating-label-input"
id="name"
value={this.state.name.inputValue || ''}
onFocus={this.activateField}
onBlur={this.disableFocus}
onChange={this.updateInputValue}
Url::to(['/img/bootles.jpg'])
Open the documentation, there is a whole page on this subject.
And there is. The fact is that it only works if you set the path:
<div>
<img src="http://xxx.ru/img/bootles.jpg">
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question