uniter icon indicating copy to clipboard operation
uniter copied to clipboard

HTML Tags for Uniter

Open phpengine opened this issue 7 years ago • 3 comments

Could something like this be possible?

<script type="text/uniter">
	echo "This is a PHP statement" ;
</script>

Cheers

phpengine avatar Apr 14 '17 15:04 phpengine

Sure - do you have an example of how you'd like to use it? I'm guessing you're after a way to differentiate between the PHP code in a standalone .php file that should be interpreted on the server by Zend's engine, and the code that should be run client side.

A bit quick'n'dirty, but did you mean something like this? https://jsfiddle.net/y4o3twze/

asmblah avatar Apr 14 '17 19:04 asmblah

This is spot on for what I was looking for. I've put an example on http://www.isophp.org.uk you can see. Cheers

phpengine avatar Apr 27 '17 01:04 phpengine

<script type="php">
    test('App started!');
</script>
var scripts=document.getElementsByTagName("script");
for(var i=0; i<scripts.length; i++){
	if(scripts[i].getAttribute('type') == 'php')
	{
	    script_text=scripts[i].text;
		try{
			php.execute('<?php ' + script_text);	
		}
		catch(e)
		{
			alert(e);
		}
	} 
}

niko-donskoy avatar Jan 02 '23 06:01 niko-donskoy