Свертывание кода Scintilla для PHP немного отличается от остальных, поскольку обрабатывается лексером HTML.Код ниже включит свертывание кода в PHP.Сгиб будет выглядеть как Visual Studio (коробка со знаком плюс внутри)
wxStyledTextCtrl *ctrl = // from somewhere ....
wxColour backgroundColor = // the background color
wxColour color = // the foreground color
ctrl->SetProperty(wxT("fold"), wxT("1"));
ctrl->SetProperty(wxT("fold.comment"), wxT("1"));
ctrl->SetProperty(wxT("fold.html"), wxT("1"));
ctrl->SetFoldFlags(wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED | wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED);
int marginNum = 1; // can be 0-5 I believe
ctrl->SetMarginType(marginNum, wxSTC_MARGIN_SYMBOL);
ctrl->SetMarginWidth(marginNum, 16);
ctrl->SetMarginSensitive(marginNum, true);
ctrl->SetMarginMask(1, wxSTC_MASK_FOLDERS);
ctrl->SetFoldMarginColour(true, backgroundColor);
ctrl->SetFoldMarginHiColour(true, backgroundColor);
ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, backgroundColor, color);
ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, backgroundColor, color);
ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, backgroundColor, color);
ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, backgroundColor, color);
ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, backgroundColor, color);
ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, backgroundColor, color);
ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, backgroundColor, color);