-
Notifications
You must be signed in to change notification settings - Fork 2
Hello World
In your Content Management System create a new page with a WYSIWYG section.
Insert the kitCommand
~~ HelloWorld ~~
save the page and view the result in the front end, you will see:
Hello World!
as result.
If you open the file
/kit2/extension/thirdparty/thirdParty/HelloWorld/bootstrap.include.php
in your editor you will find the following controller:
$app->post('/command/helloworld', function ()
{
return 'Hello World!';
})
which return Hello World!.
The route of this controller starts with /command/ and this indicate the kitFramework that this route is a
- kitCommand
- with the name helloworld
So, all you have to do to create a kitCommand is to add a controller into the bootstrap.include.php of your extension, using a route starting with /command/.
Open the empty bootstrap.include.php of your extension and insert:
<?php
$app->post('/command/myextension', function ()
{
return 'Hello, this is my extension!';
});
Save the file. Switch to your CMS and change the ~~ HelloWorld ~~ kitCommand to:
~~ MyExtension ~~
save the page and look for the result:
Hello, this is my extension!
You see, it's very easy to create your own extension and using kitCommands.
- If you spot a typo or want to contribute an article, a how-to or a tip, please feel free to edit the Wiki directly
- If you you have any question or suggestion, please contact the phpManufaktur Support Group
© 2013 by phpManufaktur, kitFramework & kfHelloWorld are published under MIT license.