if_on_server
The ifonserver statement performs the statement block if the code ends up lying on the server. It does not affect the decision making as to weather or not the code will be placed on the server, but simply reacts to it. In most cases, ifonserver will be paired with and ifonclient statement and explic code statements in order to specify how to perform the same action regardless of location. In other cases, the user may wish to make sure that the performance of a piece of code happenm, but not disrupt other code as far as location assumptions.
Statements must always be enclosed in a block
Individual statement are not allowed as the body of an ifonserver statement. The body must always be a block (one or more statements enclosed in curly braces }
Format:
ifonserver { [statements] }
Examples
// sleep one second no matter where we are
if_on_client {
JS<P new Promise(function(resolve,reject){ setTimeout(resolve,1000); }) >JS
}
if_on_server {
PHP< sleep(1); >PHP
}