mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
ListPage now inherits from WebNode.
This commit is contained in:
parent
3809ca5a38
commit
f7cbad2e96
@ -8,7 +8,7 @@
|
|||||||
#include <tinydir/tinydir.h>
|
#include <tinydir/tinydir.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
void ListPage::index(Request *request) {
|
void ListPage::handle_request_main(Request *request) {
|
||||||
String r = "";
|
String r = "";
|
||||||
|
|
||||||
for (uint32_t i = 0; i < list_entries.size(); ++i) {
|
for (uint32_t i = 0; i < list_entries.size(); ++i) {
|
||||||
@ -80,7 +80,7 @@ void ListPage::load() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ListPage::ListPage() :
|
ListPage::ListPage() :
|
||||||
Object() {
|
WebNode() {
|
||||||
}
|
}
|
||||||
|
|
||||||
ListPage::~ListPage() {
|
ListPage::~ListPage() {
|
||||||
|
@ -4,16 +4,16 @@
|
|||||||
#include "core/containers/vector.h"
|
#include "core/containers/vector.h"
|
||||||
#include "core/string.h"
|
#include "core/string.h"
|
||||||
|
|
||||||
#include "core/object.h"
|
#include "core/http/web_node.h"
|
||||||
|
|
||||||
#include "core/http/request.h"
|
#include "core/http/request.h"
|
||||||
|
|
||||||
|
|
||||||
class ListPage : public Object {
|
class ListPage : public WebNode {
|
||||||
RCPP_OBJECT(ListPage, Object);
|
RCPP_OBJECT(ListPage, WebNode);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void index(Request *request);
|
void handle_request_main(Request *request);
|
||||||
|
|
||||||
void load();
|
void load();
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ void PagedList::index(Request *request) {
|
|||||||
const String path = request->get_current_path_segment();
|
const String path = request->get_current_path_segment();
|
||||||
|
|
||||||
if (request->get_remaining_segment_count() == 0) {
|
if (request->get_remaining_segment_count() == 0) {
|
||||||
main_page->index(request);
|
main_page->handle_request_main(request);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user