On Tuesday, 31 March 2020 at 19:34:55 UTC, Steven Schveighoffer wrote:
On 3/31/20 2:57 PM, GreatSam4sure wrote:
I am playing with the vibe.d for some days now. One thing I am struggling with is move from one page to another using web interface. The naming of the functions and proper navigation from one page to another is not clear to me.

How to move from one page to another. I will appreciate any help.

I'm not sure what you mean.

Vibe has ways to control the route names of the members of your web interface using UDAs, but primarily uses the name of the functions.

A nice way to see what is registered is to turn the log level to trace when you are setting up your routes, and then set it back to normal during runtime. This prints out all the routes as vibe registers them.

e.g.:

void main()
{
    setLogLevel(LogLevel.trace);
    auto router = new URLRouter();

    ... // set up routes

    auto listener = listenHTTP(settings, router);
    setLogLevel(LogLevel.diagnostic);

    ... // run your event loop
}

If you have more specific examples, I'm glad to help you understand. If you haven't already read it, you should read this page: https://vibed.org/api/vibe.web.web/registerWebInterface

-Steve


Thanks for your reply.

My problem is that I have two views say page1.dt and page2.dt each are HTML 5 pages with head and body. I want to click a button or a link in page to go page 2 vis-a-vis using webinterface. How do I define the web interface functions and how will reference it in the pages




Reply via email to