The first approach is commonly known as Page Controller because each page is responsible for
its execution, while the latter is known as Front Controller, because the website has a single entry point.
Of course there is a middle ground; you can have one Front Controller for every big section of your site,
for example, one for the administration section and one for the front - end.
Using Neko as a Page Controller
A very basic example could be the classic Hello World!
Create a helloworld directory somewhere in your disk and two subdirectories, web and src . The first
directory is the project directory; web will contain the compiled code and will be used by the web server
as the site root, and src will contain the code files.
Inside the src directory a file HelloWorld.hx with the following code is created:
class HelloWorld
{
public static function main()
{
var content = ???
< !DOCTYPE HTML PUBLIC ???-//W3C//DTD HTML 4.01//EN???
???http://www.w3.org/TR/html4/strict.dtd??? >
< html >
< head >
< title > Hello World! < /title >
< /head >
< body >
< h1 > Hello World! < /h1 >
Current time is < b > ??™ + Date.
Pages:
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467