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.

Function to call for parsing?

I'm wondering if there's a function I can call to automatically format a string using all loaded parsers (like what is done to all comments). I've tried snooping around and figured it might be StringManipulator->GlobalParse(), but that's not giving me any results (either that or the parameters are set up to cater to comments only). Any help would be appreciated.

Comments

  • You're close--I believe the global formatters are formatters that should be applied to all comments, whereas the standard formatters don't do anything unless they have been selected by the user. $Context->StringManipulator->Formatters should be an array of all the formatters installed. If you loop through that, just like you see is done for ChildFormatters in that stringManipulator class, you should be able to call each formatter and return the parsed string.
  • That worked, thanks! For anyone else who might find this and are having the same problem, I ran

    foreach ($this->Context->StringManipulator->Formatters as $Formatter){ $Description = $Formatter->Parse($Description, $this, FORMAT_STRING_FOR_DISPLAY); }

    Also, I think things like this need to be in documentation (maybe they are and I just can't find them), but while developing for about a week, I've encountered a few problems that required a lot more reverse engineering than should be needed.
  • Yes, documentation is a bit lacking for programmers... but it is a wiki, so you can share what you learned. (something I've been meaning to do...) Otherwise, post here and someone else could add to the wiki.
  • I think I'll start contributing to it soon, though there are still some things that I'm not sure I'm doing "the vanilla way" (like form validation). I approached vanilla's extension capabilities as a development platform, much like Drupal's modules, and it's not quite there yet. I actually like the way Vanilla is set up, but it's somewhat lacking and I think that leads to extensions being less consistent.
This discussion has been closed.