Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Still trying to understand delegation. Why do this not work?
I dont get it. From following other examples, I dont see why this doesnt work!
I have in one extension this control extended class:
and then I have this in another extension:
I have in one extension this control extended class:
class DojoFiles extends Control {
function DojoFiles(&$Context) {
$this->Name = 'DojoFiles';
$this->Control($Context);
$this->CallDelegate('Constructor');
}
function Render() {
$this->CallDelegate('PreDojoFilesRender');
[..]
and then I have this in another extension:
if ( ('extension.php' == $Context->SelfUrl)) {
function writeWikiAdd() {
echo "<div style='width:100%;border-top:1px solid #999;border-bottom:1 px solid #999;background:#ddd;color:#999;padding:10px;'>";
echo "Have you checked out the wiki lately?</div>";
}
if (isset($Context))
$Context->AddToDelegate('DojoFiles', 'PreDojoFilesRender', 'writeWikiAdd');
}
0
This discussion has been closed.
Comments
You do NOT need to use delegation with custom classes. This paradigm is made to offer hooks to the core from extensions.