PDA

View Full Version : Php scripting



espengongo
2016-09-09, 17:38
Dear All,
I wold like to know if php can be used for web application because i tried an example and go the message that the scripting language must be java script.
So it seems that Php scripting is used for desktop development. can someone confirm this? I'm using lianja 3.0

Regards,

Esperant

barrymavin
2016-09-09, 18:17
The client code for web and/or mobile apps needs to be JavaScript.

espengongo
2016-09-10, 08:30
Hi Barry,
thank you so much for your reply. However, it's a big challenge for what we learnt about php development because in classic ways we use php with mysql or mariadb to develop web application. We also learnt to use java script as scripting language for front end actions while php handles backend actions (server side programming). So I have to reconsider the way to use lianja in web development.
However can you please let me know if in can use VFP and php in the same desktop application? Let say, when I want to use webview in my application, I can use php without any fear.
Thank you so much.
Best regards

Esperant

hmischel@diligentsystems.com
2016-09-10, 20:48
Hi Esperant,


Have a look at this video I created a little while ago.

https://www.youtube.com/watch?v=_FhVyBtcWjM

It shows how you can call client side code. I was using Foxpro, but I believe you can do the same thing with php. You can use the standard sections to build the front end, then use you back end calls to php.

Also - have a look at virtual tables. I use SQL Server often as my backend and Lianja handles it very well.


Herb

barrymavin
2016-09-10, 21:08
Esperant,

a Lianja web application is not coded like you do in php.

a Lianja app is made up of pages. Pages are made up of sections of which their are many types, and form sections are made up of fields and gadgets.

if you want to hand code php you create your php files and specify them as the URL in either WebView sections or WebView gadgets. You can write this server side code in whatever you like. It generates HTML/JavaScript and sends to the client which renders it.

If you are developing desktop applications you can write in Lianja/VFP, PHP, Python, JavaScript and in 3.1 typescript. Each section or gadget can be written in a different scripting language which is specified in the attributes for the UI element.

PHP, Python, JavaScript and typescript are not database languages. In Lianja however when you design a page/section you can bind server side data to the UI elements contained within them. There is no need to write any server side CRUD code at all. It is all magically handled for you between the web client and the Lianja cloud server. This reduces a large mount of development and later on, maintenance time.

The Visual Foxpro 9 core UI classes are available in Lianja for use from any of the supported scripting languages. Take a look at lianjademo example app and you will see it has custom sections and WebView sections coded in Lianja/VFP, PHP, Python and JavaScript. All within the same app.

You visually design pages iteratively, laying them out as you see them in your mind. You customize their behavior using attributes and delegates. You can specify validation, input masks, custom actions etc etc and call either client side JavaScript code or server side Lianja/VFP or JavaScript code. Server side php and python will be added in a future release as stated on the roadmap.

Note that the Lianja cloud server has its own implementation of Lianja/VFP embedded in it as well as support for any third party ODBC data source using virtual tables. Additionally it has googles v8 JavaScript engine embedded in it (same engine that node.js) uses.

Server side pages can currently be written in Lianja/VFP (.rsp) or JavaScript (.jssp). These provide the same functionality as .php pages with many extensions to simplify development.

So just to summarize, you don't need to write oodles of php code to handle database CRUD operations as this is all handled by Lianja without the need to code anything.

The whole point of Lianja is to simplify the development and deployment of business applications and this is achieved cross platform and cross device by providing a common design and development philosophy which is...

Lianja Apps are made out of pages. Pages are built out of a wide range of sections and form sections out of formitems and gadgets.

espengongo
2016-09-12, 05:13
Thank you so much Barry. I got the point and have to consider your remark and switch to new way of thinking about programming web app in lianja with .rsp and .jssp files.

Best regards,

Esperant

espengongo
2016-09-12, 05:16
Hi Herb,
Thank you for your post and video. Very easy stuff, I was in the wrong way of thinking about what i usually did in php and javascrip standard programming. I have to go through the examples to master the concepts and move forward with .rsp and .jssp files.

Best regards,

Esperant