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.
Dictionaries/Languages in extension
Krak
New
What is the proper term to use? I've looked in the wiki and was a little confused. I have also dug through some extensions and noticed a few different methods. For the life of me i can not get them to work (in my hidden text extension). I have tried a few ways and can't get it. I am sure I am missing something small and stupid. Any ideas?
0
This discussion has been closed.
Comments
Like told on this page, I use and and it works fine. Could you post some come please?
$Context->SetDefinition('IamUnique', 'This is my message');
And I am trying to get it to show using:
$Replacements = array( '<span class="HiddenWarning"><a href="javascript:handleParent('.$RowNumber.')">('.$this->Context->GetDefinition('ContactFormNotes').')</a></span><div class="Hidden" id="'.$RowNumber.'">$1</div>', );
Could you try a simple extension with only this code in the default.php:
// basic Vanilla declarations // ... $Context->SetDefinition('IamUnique', 'This is my message'); echo $Context->GetDefinition('IamUnique');
Then try to separate those two lines until it breaks.
Fatal error: Call to a member function on a non-object. Which is what my problem is, I figured it was something dumb I did (probably still is). It appears that it breaks when I stick it in a class. Works anywhere else but there. How would I get it to work form inside a class?
class MyClass { var $Context; function MyClass(&$Context) { $this->Context = &$Context; // ... } // ... }
The & is important since you want the grab the same Context object throughout the execution of Vanilla.
Then you create your new object passing the $Context object to the constructor.