PHP snippets


If you want to use the passed argument to a view as a dynamic element in an URL:
<div align='right'><a href="/print/price-list/<?php print arg(1) ?>/usd" target="_blank">PRINT</a></div>
The above code results in the link "PRINT" alligned to the right which directs to the pricelist of a specific branch (the argument) in US dollar.

Returns all available variables to be used in other pieces of code:
&lt;?php<br />print var_export($data, TRUE);<br />?&gt;
Let well, the $data variable gets returned from a View so it should be used only there at row level. In other words, create a customfield PHP to be effective. In other cases it returns NULL. In the Views preview it doesn't always return the value at the first time, so hit the preview button.