- FrontendInitialised
- FrontendPrePageResolve
- FrontendPageResolved
- FrontendParamsResolve
- FrontendProcessEvents
- EventPreSaveFilter (for each Event executed)
- EventPostSaveFilter (for each Event executed)
- EventFinalSaveFilter (for each Event executed)
While looking for a more manageable way to maintain my Mustache templates, I came across the icanhaz, which promotes putting your templates in your DOM using:
<script type='text/html' id='your-template>
// Template in here
</script>
Being a bit of a performance nut, I was nervous about putting my templates into the DOM like this for a couple of reasons:
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| <!-- Core styles --> | |
| <link rel="stylesheet" type="text/css" media="screen" href="http://example.com/symphony/assets/css/symphony.css"> | |
| <link rel="stylesheet" type="text/css" media="screen" href="http://example.com/symphony/assets/css/symphony.legacy.css"> | |
| <link rel="stylesheet" type="text/css" media="screen" href="http://example.com/symphony/assets/css/symphony.grids.css"> |
Forms have been an integral part of any interactive site since the dawn of time, they promote interactivity and are usually the most common way users interact with a site. It's commonplace that when a form is submitted, the website will take 'action' and do something with the data and then provide a user with the result. Symphony provides this logic layer via Events.
This tutorial assumes you have a basic understanding of how Events work in Symphony (if not, this may be a good introduction) and are semi comfortable writing some PHP code. I'll be showing you some of the lesser known features of Symphony Events, including event priority, event chaining and a brief demonstration of how to write a custom Event. The difficulty level progresses as we go through, but with any luck you'll be able to learn a thing or two :)
Our client requires a form that allows a user to submit some details about their new car purchase. Th
| <?php | |
| /** | |
| * @package toolkit | |
| */ | |
| /** | |
| * URL rewriter for use in conjunction with the PHP 5.4 internal HTTP server and `rounter.php`. | |
| */ | |
| namespace Rewrite; |
| <?php | |
| Class contentExtensionReferencelinkAutocomplete extends AjaxPage{ | |
| public function handleFailedAuthorisation(){ | |
| $this->_status = self::STATUS_UNAUTHORISED; | |
| $this->_Result = json_encode(array('status' => __('You are not authorised to access this page.'))); | |
| } | |
| public function view(){ |
| <data> | |
| <people> | |
| <item id='1'>Fred</item> | |
| <item id='2'>Jane</item> | |
| <item id='3'>Bob</item> | |
| <item id='4'>Mary</item> | |
| <item id='6'>Tom</item> | |
| </people> | |
| <people-details> | |
| <entry id='1'> |
| // Connect 4 | |
| // 7 across, 6 down | |
| // | |
| // | | | | | | | | | |
| // | | | | | | | | |
| // | |
| const board = [ | |
| [0, 0, 0, 0, 0, 0, 0], |
- #706 - Previously when deleting a large number of entries using 'Delete Entries' which caused PHP to reach it's maximum memory usage, no entries would be deleted making it impossible to delete entries through the Symphony administration. Entry deletion is now processed in batches of 2500, so should the memory limit be hit, at least some of the entries will be deleted. The
entryDataCleanupfunction also now supports an array ofentry_idrather than a singleentry_id - The
EventPreSaveFilternow gets passed the$entry_idwhen an Event is editing entries. This will be null on new entries - Sometimes '0' was interpreted as empty by the default
checkPostFieldDataimplementation - Add
__get()to theEmailGatewayallowing variables to be accessed once they are set - Ongoing documentation tweaks
Forms have been an integral part of any interactive site since the dawn of time — they promote interactivity and are usually the most common way users interact with a site. It's commonplace that when a form is submitted (input), the website will take 'action' and do something with the data (processing) and then provide a user with the result (output). Symphony provides this logic layer via events.
This tutorial is about customising Symphony events. You will learn about:
- event execution conditions (
loadand__trigger) - field naming and the
$_POSTarray - creating related entries in two or more sections at the same time, aka. event chaining
- event priority (execution order)
- entirely custom events