D2 & Web-Framework

RedX guibufolo+dlang at gmail.com
Thu Jul 4 03:18:13 PDT 2013


On Wednesday, 3 July 2013 at 13:05:27 UTC, Adam D. Ruppe wrote:
> On Wednesday, 3 July 2013 at 09:24:03 UTC, RedX wrote:
>> is this still working on the latest git (2bfdccc)? I don't 
>> seem to be able to call anything..
>
> I found the bug, I had a static if that was too restrictive and 
> stopped reading the child object functions.
>
> It is fixed now on the newest github version.
>
>
> The regular functions and child ApiProviders are still working, 
> though the child ApiObject thing is mildly buggy, the 
> initialize and initializePerCall aren't always done right, so 
> if you override them, you need to call the parent too. Or 
> something like that, I have it working in a program but it was 
> a bug workaround hack.
>
> Regular functions work excellently though!
>
>> And do public functions really require "export" now or am i 
>> just declaring them in i wrong way?
>
> Yes, they need export now. You can easily work around it by 
> writing
>
> class MySite : ApiProvider {
>   export:
>     string hello() {}
> // etc
> }
>
> The export: at the top will apply to everything unless you 
> override it on a specific function.
>
>
> The reason it does this is to get more control over if you want 
> helper functions to show up publicly or not. Before it used a 
> leading _ in the name to skip, which still works, but now you 
> can also use other access specifiers.
>
> It uses export instead of public because public is available to 
> other modules, export I took to mean even more available to 
> outside the program.

Very nice, thank you.

I was wondering if there is a way of sending the program back to 
the form entry page if validation on the input fails in the 
function that is accepting the arguments. In the _Form function 
i'm only able to create the form but no validation can be done 
there and no _Validate automatism seems to exist, or am i 
overseeing something?


More information about the Digitalmars-d mailing list