Skip to content

Instantly share code, notes, and snippets.

View wdebusschere's full-sized avatar
💭
Laravel / Kirby CMS

Wannes Debusschere wdebusschere

💭
Laravel / Kirby CMS
View GitHub Profile
<?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(){
@wdebusschere
wdebusschere / SymCMS - Getting data notes.mkd
Created March 29, 2019 09:02 — forked from DavidOliver/SymCMS - Getting data notes.mkd
Notes on getting data from within Symphony CMS

Written based on hacking away at a custom event which aimed to take its data solely from entry data and $_SESSION values, and not posted values (which I understand may have been open to DOM hacking and required "ugly" frontend hidden fields).

Things I think I've learned

Use Xpath in PHP when possible

I was traversing the XMLElement object generated by SymQL (or Entry object generated by EntryManager) with the object's methods and foreach to get values, which seems to require a lot of effort and code:

php