| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> |
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| <meta name="generator" content="Adobe RoboHelp 8"> |
| <title>Using Code Folding</title> |
| <link rel="StyleSheet" href="default.css" type="text/css"> |
| <style type="text/css"> |
| <!-- |
| body { border-left-style:None; |
| border-right-style:None; |
| border-bottom-style:None; |
| background-color:Transparent; |
| border-top-style:None; } |
| --> |
| </style> |
| <script type="text/javascript" language="JavaScript"> |
| //<![CDATA[ |
| function reDo() { |
| if (innerWidth != origWidth || innerHeight != origHeight) |
| location.reload(); |
| } |
| if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) { |
| origWidth = innerWidth; |
| origHeight = innerHeight; |
| onresize = reDo; |
| } |
| onerror = null; |
| //]]> |
| </script> |
| <style type="text/css"> |
| <!-- |
| div.WebHelpPopupMenu { position:absolute; |
| left:0px; |
| top:0px; |
| z-index:4; |
| visibility:hidden; } |
| p.WebHelpNavBar { text-align:right; } |
| --> |
| </style> |
| <script type="text/javascript" language="javascript1.2" src="whmsg.js"></script> |
| <script type="text/javascript" language="javascript" src="whver.js"></script> |
| <script type="text/javascript" language="javascript1.2" src="whproxy.js"></script> |
| <script type="text/javascript" language="javascript1.2" src="whutils.js"></script> |
| <script type="text/javascript" language="javascript1.2" src="whlang.js"></script> |
| <script type="text/javascript" language="javascript1.2" src="whtopic.js"></script> |
| <script type="text/javascript" language="javascript1.2">//<![CDATA[ |
| <!-- |
| if (window.gbWhTopic) |
| { |
| var strUrl = document.location.href; |
| var bc = 0; |
| var n = strUrl.toLowerCase().indexOf("bc-"); |
| if(n != -1) |
| { |
| document.location.href = strUrl.substring(0, n); |
| bc = strUrl.substring(n+3); |
| } |
| |
| if (window.setRelStartPage) |
| { |
| addTocInfo("Tasks\nUsing Code Folding"); |
| addAvenueInfo("Tasks","formatting_code.htm","searching_for_php_elements.htm"); |
| |
| } |
| |
| document.write("<p style=\"text-align:left\"> "); |
| AddMasterBreadcrumbs("ide_help.htm", "", ">", "Home", "pdt_table_of_contents.htm"); |
| document.write("<a href=\"tasks.htm\">Tasks<\/a> > Using Code Folding<\/p>"); |
| |
| |
| if (window.setRelStartPage) |
| { |
| setRelStartPage("ide_help.htm"); |
| |
| autoSync(0); |
| sendSyncInfo(); |
| sendAveInfoOut(); |
| } |
| |
| } |
| else |
| if (window.gbIE4) |
| document.location.reload(); |
| //--> |
| //]]></script> |
| </head> |
| |
| <body><script type="text/javascript" language="javascript1.2">//<![CDATA[ |
| <!-- |
| if (window.writeIntopicBar) |
| writeIntopicBar(4); |
| //--> |
| //]]></script> |
| <div style="width: 100%; position: relative;" id="header"> |
| |
| |
| <p align="right"><a |
| title="Documentation Survey" href="http://spreadsheets.google.com/viewform?formkey=dC1scEswTjFia2tDQ3Y5TVJBbkNQcWc6MQ">Documentation |
| Survey</a> |
| | <a href="javascript:crlf="";h=location.href;t=document.title;e = "" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (e!=null) location="mailto:documentation@zend.com" + "?Subject= Feedback on PDT for page " + escape(t) + "&Body=" + escape(e).replace(/ /g, "+") + crlf + " "; void 0"><span |
| style="background-color: #ffffff;">Submit Documentation</span><span |
| style="background-color: #ffffff;"> Feedback</span></a><span |
| style="background-color: #ffffff;"></span><span style="background-color: #ffffff;"> |
| </span><span style="background-color: #ffffff;">| |
| </span><span |
| style="background-color: #ffffff;"><a title="View Latest Version and Get PDF Online" |
| href="http://www.zend.com/en/resources/zend-documentation/" |
| target="_blank">View Latest |
| Version and Get PDF Online</a></span></p> |
| </div> |
| |
| |
| <h1>Using Code Folding |
| </h1> |
| <p>Code Folding collapses or "folds" the display of a block of |
| code.</p> |
| <p>To enable code folding, go to the <a href="folding.htm">Folding Preferences</a> |
| page, accessible from <span style="font-weight: bold;"><b>Window | Preferences |
| | PHP | Editor | Using Code Folding</b></span> |
| .</p> |
| <p>If Code Folding is enabled, minus signs will appear in the Annotation |
| Bar next to code blocks which can be folded. In addition, certain elements |
| will be folded by default according to the Folding Preferences settings.</p> |
| <table cellspacing="0" width="100%"> |
| <col style="width: 7.093%;"> |
| <col style="width: 92.907%;"> |
| <tr valign="top"> |
| <td style="width: 7.093%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-size: 6pt;"> </p></td> |
| <td style="width: 92.907%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-weight: bold;"> </p></td> |
| </tr> |
| <tr valign="top"> |
| <td style="width: 7.093%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-size: 6pt;"><img src="ref_icon.png" alt="Instructions on how to complete a procedure" title="Instructions on how to complete a procedure" style="border: none;" width="28" height="33" border="0"></p></td> |
| <td style="width: 92.907%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-weight: bold;">To fold a block of code:</p> |
| <ol type="1"> |
| <li class="p" style="margin-left: -20px;"><p>Stand within a |
| class, function or PHPDocBlock.</p></li> |
| <li class="p" style="margin-left: -20px;"><p>Click the <span |
| style="font-weight: bold;"><b>minus sign</b></span> on the marker |
| bar to the left of the editor.</p></li> |
| </ol></td> |
| </tr> |
| <tr valign="top"> |
| <td colspan="2" style="width: 100%; padding-right: 10px; padding-left: 10px;"><p>The |
| first line of code will remain visible but the other lines will |
| not be displayed. A fold indicator <img src="code_folding_indicator.png" alt="code_folding_indicator.png" style="border: none;" width="14" height="19" border="0">will appear |
| at the end of the line when the code is folded to indicate that |
| there is hidden code.</p> |
| <p class="ListBullet1">To temporarily view folded code, hover over |
| the <span style="font-weight: bold;"><b>plus sign</b></span> that denotes |
| a folded block. The folded code will be displayed in a floating |
| block.</p> |
| <p class="picture"><img src="code_folding_hover.png" alt="code_folding_hover.png" title="Folded Code Hover" style="border: none;" width="380" height="117" border="0"></p></td> |
| |
| </tr> |
| </table> |
| <table cellspacing="0" width="100%"> |
| <col style="width: 7.093%;"> |
| <col style="width: 92.907%;"> |
| <tr valign="top"> |
| <td style="width: 7.093%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-size: 6pt;"> </p></td> |
| <td style="width: 92.907%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-weight: bold;"> </p></td> |
| </tr> |
| <tr valign="top"> |
| <td style="width: 7.093%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-size: 6pt;"><img src="ref_icon.png" alt="Instructions on how to complete a procedure" title="Instructions on how to complete a procedure" style="border: none;" width="28" height="33" border="0"></p></td> |
| <td style="width: 92.907%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-weight: bold;">To unfold a block of code:</p> |
| <ol type="1"> |
| <li class="p" style="margin-left: -20px;"><p>Click the <span |
| style="font-weight: bold;"><b>plus sign</b></span>.</p></li> |
| <li class="p" style="margin-left: -20px;"><p>The folded code |
| will become visible again and the fold indicator will disappear.</p></li> |
| </ol> |
| <p style="font-weight: bold;">To view the scope of a fold:</p> |
| <ol type="1"> |
| <li class="p" style="margin-left: -20px;"><p>Hover over the |
| <span style="font-weight: bold;"><b>minus sign</b></span>.</p></li> |
| <li class="p" style="margin-left: -20px;"><p>A vertical line |
| will be displayed from the first to the last line of the fold, |
| indicating its range.</p></li> |
| </ol></td> |
| </tr> |
| <tr valign="top"> |
| <td colspan="2" style="width: 100%; padding-right: 10px; padding-left: 10px;"><p> </p></td> |
| |
| </tr> |
| </table> |
| <table cellspacing="0" width="98.119%"> |
| <col style="width: 50%;"> |
| <col style="width: 45.885%;"> |
| <tr valign="top"> |
| <td style="width: 50%; padding-right: 10px; padding-left: 10px;"><p |
| class="picture" align="left"><img src="code_folding_unfolded.png" alt="code_folding_unfolded.png" style="border: none;" width="457" height="139" border="0"></p></td> |
| <td style="width: 45.885%; padding-right: 10px; padding-left: 10px;"><p |
| class="picture" align="left"><img src="code_folding_folded.png" alt="code_folding_folded.png" style="border: none;" width="342" height="51" border="0"></p></td> |
| </tr> |
| <tr valign="top"> |
| <td style="width: 50%; padding-right: 10px; padding-left: 10px;"><p |
| class="FIgureCaption">An unfolded function</p></td> |
| <td style="width: 45.885%; padding-right: 10px; padding-left: 10px;"><p |
| class="FIgureCaption">A folded function</p></td> |
| </tr> |
| </table> |
| <table style="left: 0px; top: 927px; height: 329px;" cellspacing="0" width="577"> |
| <col style="width: 7.093%;"> |
| <col style="width: 92.907%;"> |
| <tr valign="top"> |
| <td style="width: 7.093%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-size: 6pt;"> </p></td> |
| <td style="width: 92.907%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-weight: bold;"> </p></td> |
| </tr> |
| <tr valign="top"> |
| <td style="width: 7.093%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-size: 6pt;"><img src="ref_icon.png" alt="Instructions on how to complete a procedure" title="Instructions on how to complete a procedure" style="border: none;" width="28" height="33" border="0"></p></td> |
| <td style="width: 92.907%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-weight: bold;">To fold/unfold nested functions:</p> |
| <ol type="1"> |
| <li class="p" style="margin-left: -20px;"><p>Click on one of |
| the <span style="font-weight: bold;"><b>minus signs</b></span> of |
| a nested function. All levels below this level will be folded |
| into it. You can continue to fold until all levels have been |
| folded into the topmost level.</p></li> |
| <li class="p" style="margin-left: -20px;"><p>To unfold nested |
| functions, click on the <span style="font-weight: bold;"><b>plus |
| sign</b></span>. The folded code will open in the same order that |
| it was folded.</p></li> |
| </ol></td> |
| </tr> |
| <tr valign="top"> |
| <td colspan="2" style="width: 100%; padding-right: 10px; padding-left: 10px;"><p |
| class="picture"><img src="folding_nested_functions.png" alt="folding_nested_functions.png" title="Nested Function Folding" style="border: none;" width="223" height="140" border="0"></p></td> |
| |
| </tr> |
| </table> |
| |
| <p class="Note">Note:</p> |
| <p class="NoteText">Line numbers are folded together with the code. Folding |
| and unfolding does not change line numbers, it can only hide/display them.</p> |
| <p class="Note">Note:</p> |
| <p class="NoteText">If the folded code contains an error, the displayed |
| window will be syntax highlighted on both the left and right Annotation |
| bars.</p> |
| <table cellspacing="0" width="100%"> |
| <col style="width: 7.093%;"> |
| <col style="width: 92.907%;"> |
| <tr valign="top"> |
| <td style="width: 7.093%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-size: 6pt;"> </p></td> |
| <td style="width: 92.907%; padding-right: 10px; padding-left: 10px;"><p> </p></td> |
| </tr> |
| <tr valign="top"> |
| <td style="width: 7.093%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-size: 6pt;"><img src="link_icon.png" alt="link_icon.png" style="border: none;" width="32" height="40" border="0"></p></td> |
| <td style="width: 92.907%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-weight: bold;">Related Links:</p> |
| <p><a href="code_folding.htm">Code |
| Folding</a></p> |
| <p><a href="folding.htm">Code Folding Preferences</a> |
| </p></td> |
| </tr> |
| <tr valign="top"> |
| <td style="width: 7.093%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-size: 6pt;"> </p></td> |
| <td style="width: 92.907%; padding-right: 10px; padding-left: 10px;"><p> </p></td> |
| </tr> |
| </table> |
| <div style="width: 100%; position: relative;" id="footer"> |
| |
| <p style="text-decoration: underline; " |
| align="center">PHP Development |
| Tools</p> |
| |
| |
| </div> |
| <script type="text/javascript" language="javascript1.2">//<![CDATA[ |
| <!-- |
| if (window.writeIntopicBar) |
| writeIntopicBar(0); |
| |
| highlightSearch(); |
| //--> |
| //]]></script> |
| </body> |
| </html> |