drogonframework / drogonframework/drogon

Drogon template request for POST handling

Open
#2,266 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 12h
Merged PRs (30d)
15

Description

I want a Drogon template for handling POST that looks like the README page below.

https://github.com/elanatframework/Web_forms_classes/blob/elanat_framework/php/README.md

The above page shows how to use WebForms Core technology in PHP.

WebForms Core is a modern technology for manipulating HTML tags through server code. In this technology, the WebForms class from the server communicates with the WebFormsJS library from the client automatically.

At Elanat, we want to make WebForms Core technology available to everyone for all programming languages. We did this for most of the popular programming languages ​​and were able to test them. Unfortunately, after several days of trying for the programming language and C++, we were unable to test.

Now, we are asking Drogon developers or experts to use WebForms Core technology and test the PHP example in the Drogon framework.

The WebForms.h for C++ class is available via the link below.

https://github.com/elanatframework/Web_forms_classes/blob/elanat_framework/cpp/WebForms.h

The WebFormsJS library is also available at the link below.

https://github.com/elanatframework/Web_forms/blob/elanat_framework/web-forms.js

The example below is an implementation of WebForms Core in a hypothetical framework in C++. The code related to WebForms is written correctly.

```cpp
#include
#include

#include "backendframework.h" // A hypothetical framework
#include "WebForms.h"

using namespace std;

int main() {
// If is post method by submit form
if (responseForm.hasKey("btn_SetBodyValue")) {
int fontSize = std::stoi(responseForm.getValue("txt_BackgroundColor"));
std::string backgroundColor = responseForm.getValue("txt_BackgroundColor");
std::string name = responseForm.getValue("txt_Name");

WebForms form;

form.SetFontSize(InputPlace::Tag("form"), fontSize);
form.SetBackgroundColor(InputPlace::Tag("form"), backgroundColor);
form.SetDisabled(InputPlace::Tag("btn_SetBodyValue"), true);

form.AddTag(InputPlace::Tag("form"), "h3");
form.SetText(InputPlace::Tag("h3"), "Welcome " + name + "!");
form.AssignDelay(78);

std::cout << form.Response() << std::endl;
return 0;
}

// If is get method
std::cout << backEndRender("view")) << std::endl;

return 0;
}

##End

@@view

Using WebForms Core

Your Name



Set Font Size



Set Background Color



```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.