I need to create a custom PHP application. Since I am so fond of Kirby, I thought it might be nice to try using the Toolkit for my application. Is there any kind of “Starter Kit” or other Getting Started documentation for the Toolkit? Started trying to pick apart Kirby, but thought would be nice to open up to the community for help as well.
I don’t think there is. I think your best source is the source code and the comments in there.
Here is a very brief getting started guide:
- Download the Toolkit from the GitHub repository or include it as a Git submodule in your project.
- Load the
bootstrap.php
file from your application. - Pick methods from the API cheatsheet or from the Toolkit source code.
What to do with the Toolkit or how to use it depends on your use-case in the application. But you can use the Toolkit just like you would in Kirby, all classes are auto-loaded.
Thanks. I’m wondering though how best to build and organize a multi-state MVC style application. I suppose I can just spend some time with the Panel code and try to emulate that but hoping for a little more of an initial direction.
You should keep in mind that the toolkit is a collection of more or less related helper classes. If you need a full featured web framework you might need to look for something different or at least find something for the MVC part. However, you will probably be able to use the toolkit’s classes with most other frameworks out there.
This my sound like a silly question but where do you add the
<?php require('toolkit/bootstrap.php') ?>???
Do you add it to the head or in the body. I don’t understand. I’m trying to add phpmailer to my site and I want to use the toolkit to help me do that.
This code goes into a php script. If your site is a Kirby site, however, you don’t need to add the toolkit explicitly, as it is part of Kirby, so all the classes are available automatically.
Thanks, I understand now.