Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 210

Echo a string inside of an echo statement?

$
0
0

This is probably a very simple one to be answered...

I have a piece of code which I need to pull a certain piece of information.

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('XXXX')->toHTML();?>

For this to work I need the XXXX part to pull the result of the following query:

<?php echo $_product->getAttributeText('warranty') ?>

So the output from the above query will then be the information needed to go in to XXXX.

This markup is completely wrong below but should demonstrate the idea I am trying to achieve:

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('<?php echo $_product->getAttributeText('warranty') ?>')->toHTML();?>

Viewing all articles
Browse latest Browse all 210

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>