thedigicraft / Atom.CMS

Atom.CMS
56 stars 52 forks source link

ajax series question #217

Open bidjan opened 7 years ago

bidjan commented 7 years ago

Hi Creptor:

php function fails to show a fontawesome feature.

Bob Ghodsi

http://pastebin.com/WacUzLd6

creptor commented 7 years ago

PHP doesn't behave in that way, the script is only handled once by the server. Calling a function after the page has been loaded will give no results...

If you're looking for "action -> action" you must rely only on JavaScript, though if you're going for a "action -> call page -> action" I recommend you do a if($_POST[]){echo i('play);} to output the desired code.

Also return sets a value for the function and closes it, but the PHP will not know what to do with it, you must use a echo or give it to a variable.

creptor commented 7 years ago

Also <?= will be unrecognizable by the PHP (I think, it depends on the properties set for PHP), you should always use <?php for compatibility.