3
I cannot attack the properties of the SVG image with include php. Is there another method? Therefore, I need to call the bank images dynamically through include(). Here is a functional example, when the svg image is in its pure code on the page in question.
<style>
#produto > svg > g{
fill: #fff;
}
</style>
<html>
<body>
<div id="produto">
<svg...>
<g>..</g>
</svg>
</div>
</body>
</html>
I wish it worked this way:
<style>
#produto > svg > g{
fill: #fff;
}
</style>
<html>
<body>
<div id="produto">
<?php include('image/my-img.svg');?>
</div>
</body>
</html>
I tried the methods of inclusion of images in sgv ( embed, Object) and was unsuccessful.
what exactly is in that file . svg?
– Daniel Omine
is an array, exported in svg image, with tags, svg, g and path, which attribute css properties
– Henrique Mendes Silveira Rodri
as you did when you tried to
<object>
? something like this doesn’t work?<object data="<?php include('image/my-img.svg');?>" type="image/svg+xml" id="id_qualquer" />
– Daniel Omine
No effect, just nothing appears, as in <?php include('image/my-img.svg');?>
– Henrique Mendes Silveira Rodri
the file path is correct? test this:
<?php echo file_exists('image/my-img.svg')? 'ok': 'ng';?>
– Daniel Omine
I tested and gave ok! I think include php simply doesn’t recognize the . svg extension...
– Henrique Mendes Silveira Rodri
the extension does not have to do.. can be a . exe that php normally includes the content. Have you tried seeing the result by the browser source code.. in Chrome , run the php page normally and then press CTRL+U. Probably you will find the
<svg>
in the code– Daniel Omine
by source code does not appear svg, similarly in front-end, the page code stops at include and does not display anything from then on...
– Henrique Mendes Silveira Rodri
A fatal type error is occurring. Check the log and error view options to mitigate the actual problem. This can help you set up: http://answall.com/a/117145/4793
– Daniel Omine