Skip to content
Koen edited this page Nov 2, 2015 · 5 revisions

MANUAL

So, this is the manual. Not much to see here, but that'll change in a bit!

Controllers

All Encode-controllers are listed here, with information and functions you can call.

  1. Handle your Assets
  2. Eat a Cookie
  3. Gather data from the Database
  4. Safely Read/Write Documents
  5. Get user Input
  6. Load views, models, helpers,...
  7. Log mistakes, errors, actions,..
  8. Easily send Mails with Mandrill
  9. Use Models to handle your data
  10. Start and administer a Session
  11. Have a session Storage to ...store things

Helpers

There a some useful tools that we created, and one of them is the environment variable. This variable can be "dev", "test" or "deploy" (or anything else for that matter, but it won't do much then), and helps the system to determine the speed of the application.

Minifyng Javascript and CSS

Encode will minify your Javascript (and uglify it as well) and CSS with the help of Matthias Mullie's library. Just add <!-- inject:(js | css, whatever you want) --><!-- end:(js | css) --> to the footer and header in your layout, and experience the magic.

Example:

//footer.php
</body>
<!-- inject:js --><!-- end:js -->
</html>

will become (in dev-mode)

//footer.php
</body>
<!-- inject:js -->
<script type="text/Javascript" src="assets/js/some/lib/js1.js"></script>
<script type="text/Javascript" src="assets/js/another/lib/js2.js"></script>
<!-- end:js -->

or even (in test- or deploy-mode)

//footer.php
</body>
<!-- inject:js -->
<script type="text/Javascript" src="assets/js/minified/*timestamp*_scripts.min.js"></script>
<!-- end:js -->

Awesome, right? This also works with css-files, but will exclude both '.min' and '.php' files!

Actually send mails

In dev-mode, Encode will just print out your mails instead of sending them (while still returning the real response), so you won't spam yourself. To enable, just enter test or deploy mode!

Modules

You can easily create your own Modules (or import another Module from other devs, or our Module-page. The structure of these modules are very much like the basic application-folder. They both have assets, controllers, models, views, config files, and others. If you are going to write or edit modules, best have a look at these guidelines:

  1. Use the structure from the application-folder
  2. .php-files in controllers and config-folders are loaded automatically
  3. .php-files in models and helpers-folders are loaded as normal, and automatically found inside your module-folder
  4. If you need to install tables, use an install.php script in the root of your module Please document everything good enough so any user can use your module properly

Questions

No problem, ask away, or have a look at our FAQ.

Contributions or issues

Found a bug, or just made an awesome improvement? Submit an issue, or create a PR, we'll welcome them all with open arms!

Clone this wiki locally