rikkimax / cmsed Goto Github PK
View Code? Open in Web Editor NEWA component library for Vibe that functions as a CMS.
License: MIT License
A component library for Vibe that functions as a CMS.
License: MIT License
What about using vibe's REST/WEB interfaces (https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/web/common.d, https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/web/web.d, https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/web/rest.d)
Definition of interface:
module blog.web;
import blog.models;
import vibe.http.server: HTTPServerRequest;
import vibe.web.web;
import vibe.web.common;
import vibe.core.log;
import std.string: format;
class PostView {
void index(){
auto posts = Post.findAll();
render!("blog/index.dt", posts);
}
void postAdd(HTTPServerRequest req){
Post post = new Post();
post.slug = req.form["slug"];
post.title = req.form["title"];
post.text = req.form["text"];
post.save();
redirect(format("/blog/%s/", post.slug));
}
@path("/:slug/")
void getView(HTTPServerRequest req){
string slug = req.params["slug"];
auto post = Post.query().slug_eq(slug).find()[0];
render!("blog/post/view.dt", post);
}
}
Registration
module blog;
import vibe.http.router: URLRouter;
import vibe.web.web;
public import blog.web;
void register(URLRouter router){
// register views
auto postViewSettings = new WebInterfaceSettings();
postViewSettings.urlPrefix = "/blog/";
registerWebInterface(router, new PostView, postViewSettings);
}
Definition
module routes.blog;
import cmsed.base;
class Home : OORoute {
@RouteFunction(RouteType.Get, "/", "index")
string index() {return "Test";}
@RouteFunction(RouteType.Get, "/test/", "index")
bool test() {
return true;
}
}
Registration
module routes;
import cmsed.base;
public import routes.blog;
shared static this() {
registerRoute!Home;
}
@RouteFunction(RouteType.Get, "/test/", "index")
, how to send to that template variablesSorry if it seems pedantic, but here are a few spelling errors immediately noticeable in the README.
Note UDA's (or attributes) are stackabe.
=> Note UDAs (or attributes) are stackable.
You can utilise RouteGroup's to append e.g. path values on.
=> You can utilise RouteGroups to append e.g. path values on.
Note shared is required part of this.
=> Note shared is a required part of this.
But here its more important as it is executed and grabbed for values
=> But here it's more important as it is executed and grabbed for values
Contains list of all widgets with routes accessible at runtime.
=> Contains a list of all widgets with routes accessible at runtime.
Hello!
Cmsed seems to be nice project! thanks for doing such great work. but there is so less documentation, especialy for first steps (i mean what to do to simply run project with few models and basic views for them).
It would be nice to write in Readme some sort of tutorial how to setup initial project, what settings should be in configuration file, and and how to create basic models and views (controllers/routes).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.