I need to help. I have some projects on yii2, but in each of them I can't to display images everything looks but it's still not working...
Also:
<img src="<?= \Yii::getAlias('#web/images/home.png') ?>" />
Seems you have wrong url for image try
use yii\helpers\Url;
<?php echo "<img src='". Url::base() . "/images/home.png' alt='your_alt' />" ;
try this
<img src="<?=Yii::$app->request->baseUrl?>/images/home.png" />
Related
I have an image that i want do display alongside with the label.
<?php
echo $this->Form->input('ticketdays',['label'=>'Ticket days']);
?>
<img src="/img/help-round-button.png">
This is what happens now. I want do display it where the blue "circle" is.
How to achieve this? I accept any solution I can get. Already searched stackoverflow and Google and didn't find the answer.
Thanks.
Try something like this:
<div>
<label>Ticket days</label>
<span style="top:50%" class="glyphicon glyphicon-info-sign"></span>
<?php
echo $this->Form->input('ticketdays', ['label' => false]);
?>
</div>
I have an issue with firefox, it doesn't load an image.All the other,Chrome, Opera and IE can load this but firefox fails, it does not display any picture and if i go check with firebug it displays the following error on the image link: "Failed to load the given URL". I did clear my cache, also, if i open the image link in another tab it works.
THe code:
<ul class="nav navbar-nav navbar-right">
<li>
<a style='padding:4px' href="<?php echo $login_url?>">
<img src="<?php echo base_url(); ?>img/facebook_log22.png" class='facebookLogin' />
</a>
</li>
</ul>
Also in style:
.facebookLogin
{
height:40px;
}
I'm using codeigniter(if u wonder about base_url() function) and bootstrap(but i don't think that matters so much.
Edit: I also see that it adds another class to the code...
Also,the error:
Ok,i finally know what the problem was,and it is called adblock plus.Damnit,totally forgot i have that installed on my firefox.
Thanks a lot guys.
If you are referencing image from domain, it will not work, unless you:
put http:// in front of your link: src="http://<?php echo base_url(); ?>/img/facebook_log22.png", or
create a relative link: src="/img/facebook_log22.png" .
I also ha a similar error , i opened it again with a different browser it was working .
right click >View Image > you must be able to see your image if the link is correct .
I once had a similar problem and after a frustrating time of checking and rechecking my path, I realized the problem was the images were uploaded as ".JPG" but my css had ".jpg" It was a capitalization issue.
I seem to have problems with my links, they are not doing anything in Internet Explorer
<a style="text-decoration:none;" href="<?php echo base_url();?>index.php/person/create/<?php echo $this->uri->segment(4);?>" >
If I look at the source my link is href="http://localhost/index.php/person/create/2".
This is working in Mozilla but in IE the link is going nowhere.
It looks like you didn't mean to put index.php in your url - I doubt that you can traverse into /person/create/2 after index.php. Try removing that?
Try this:
<?php $url = $this->uri->segment(4); ?>
<a style="text-decoration:none;" href="<?php echo base_url("index.php/person/create/$url");?>">click</a>
If you have an index page specified in your 'config.php' you don't have to add /index.php/ to your url.
Hope it helps.
I am using Joomla 2.5 and I have been trying to load a bunch of images in a page. They load just fine in FF/Safari but don't load in chrome.
Originally my code is something like this:
<div id="sponsors">
<img src ="<?php echo $apath; ?>/images/ads/ad__03.png" />
<img src ="<?php echo $apath; ?>/images/ads/ad2.png" />
<img src ="<?php echo $apath; ?>/images/ads/ad3.png" />
<img src ="<?php echo $apath; ?>/images/ads/ad4.png" />
<img src ="<?php echo $apath; ?>/images/ads/ad5.png" />
<img src ="<?php echo $apath; ?>/images/ads/ad6.png" />
<img src ="<?php echo $apath; ?>/images/ads/ad7.png" />
</div>
which is rendered as:
in chrome.
I also checked the network tab in dev tools. There are two attempts made for the images to load:
The template works perfectly in other browsers. I have tried moving the images into other folders, but chrome just refuses to show the images.
I guess you have some ad blocking plugin (AdBlockPlus)? This will occur also on FF with similar plugins.
The issue is that you have the word ads in your images' urls.
The only solution I could find was to rename the "ads" part of the url, from what you write it seems like it shouldn't be hard.
In the code below, I am using an image images/newlogo.PNG for a logo. I am trying to add the same logo to a WordPress blog, but WordPress can't seem to find the logo. Any idea where I should put the image so that WordPress can find it?
Thanks in advance,
John
<div class="newlogo">
<a href="index.php">
<img src="images/newlogo.PNG" alt="Books" border="0"/>
</a>
</div>
My experiece with WordPress is many times you need the full path for images called outside of the style sheet, because your full path is something like username/public_html/wordpresshere
Best to put images in your theme so they stay put whn you change themes or go along when you download/backup themes
So, hardcode your full path from your URL, or:
Use this to return site URL:
<?php bloginfo('url'); ?>/wp-content/themes/default/images/newlogo.png
Or this to return the current template directory:
<?php bloginfo('template_directory'); ?>/images/newlogo.png
Like this:
<img src="<?php bloginfo('template_directory'); ?>/images/newlogo.PNG" alt="Books" border="0"/>
If you use an 'absolute' path (relative to the server) like this:
<img src="/images/newlogo.PNG" alt="Books" border="0"/>
You just need to put the image in the images folder in the root of the server
I think you need to have the file in the wp-content folder.
If you are adding this code into a theme file, you need to use the path to the image directory within the theme directory. This can be done by using get_template_directory_uri().
Here is an example:
<div class="newlogo">
<a href="index.php">
<img src="<?php echo get_template_directory_uri(); ?>images/newlogo.PNG" alt="Books" border="0"/>
</a>
</div>