Ability to run PHP script on the server action (Very Useful)

The ability to add an action step on the server to run php script with an output option.

Example:
the developer add the action on the server with this settings:

script: $myVar = 6+5; echo $myVar;
output: $script_output

now the developer can use the output in any place he wants (conditions, repeat, database insert, etc)

if wappler team was able to implement this feature this will open up the ability to plug thousands of API services into wappler without the need for a custom extension to every single service (witch is impossible)

Being able to use other APIs within the Wappler interface (or by handcoding) will make Wappler a super dooper, oh my God this is freaking unbeliavable application. If you do this, well don’t know what will happen, you will be superpoderosos chicos machos, tacos for everyone.

2 Likes

Actually I just read this and was stumped why you aren’t just using the server connect expressions?

In server connect action you can reproduce and code, workflow or complicated expression that you will ever need to make.

That is visual programming.

Much easier to do, gives you a great overview of the real actions happening and workflow.

It has all the constructs that a language like PHP has, loops, conditionals , variables and expressions.

And it is cross platform! So if you want to switch from PHP to ASP.NET or to NodeJS ( under development) you can still use the same actions!

So stop thinking in gluing spagetti code snippets you find on internet, but start thinking bigger in components, workflow and things that really needs to be done!

4 Likes

i have no idea what are you referring to :sweat_smile:
could you please show how to run a PHP snippet on the a server action?

That’s what exactly George is saying - just create the expressions you need in server connect panel. Why would you need to run some PHP codes when you can create it in Server Connect?

1 Like

hmmm
ok please recreate this in server connect:

<?php

 //get JSON
 $json = file_get_contents('http://api.openweathermap.org/data/2.5/find?q=Calabar,NG&type=accurate&mode=jso‌​n');

 //decode JSON to array
 $data = json_decode($json,true);

 //show data
 var_dump($data);

 //description
 echo $data['weather'][0]['description'];
 //temperature
 echo $data['main']['temp'];


?> 

with my feature request i want to write this code THEN use server connect to complete my logic with conditions and expressions from the echoed PHP data

You don’t need that on the server you need it on the client with App Connect. It is just a JSON feed that you want to use to populate data

That was an example not my use case.

and beside i want the code to run with sever actions so i can use it with insert and update. and its more logical to keep my server code on one place don’t you think?

i want to use the power of server connect with my custom PHP code :slightly_smiling_face:

3 Likes

Hi @mrbdrm, did you get to achieve this by editing the server action php files in the editor?

I’m dealing with JSON posted from client-side form and can’t deal with it at server-side, as there is no wappler way of decoding the json and use it further in other server connection action steps.