| <!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>Formatting Code</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> |
| <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\nFormatting Code"); |
| addAvenueInfo("Tasks","using_templates.htm","using_code_folding.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> > Formatting Code<\/p>"); |
| |
| |
| if (window.setRelStartPage) |
| { |
| setRelStartPage("ide_help.htm"); |
| |
| autoSync(0); |
| sendSyncInfo(); |
| sendAveInfoOut(); |
| } |
| |
| } |
| else |
| if (window.gbIE4) |
| document.location.reload(); |
| //--> |
| //]]></script> |
| </head> |
| |
| <body leftmargin="5" topmargin="5" rightmargin="5" bottommargin="5"><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>Formatting Code |
| </h1> |
| <p>PDT can |
| auto-format your code according to set standards in order to make it easily |
| navigable and readable.</p> |
| <p>Your code will be automatically formatted according to the settings |
| defined in the <a href="formatter.htm">PHP Formatter Preferences</a> page, |
| accessed from <span style="font-weight: bold;"><b>Window | Preferences | |
| PHP Formatter</b></span>.</p> |
| <p>This procedure demonstrates how to format your scripts.</p> |
| <table cellspacing="0" width="100%"> |
| <col style="width: 9.304%;"> |
| <col style="width: 90.696%;"> |
| <tr valign="top"> |
| <td style="width: 9.304%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-size: 6pt;"> </p></td> |
| <td style="width: 90.696%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-weight: bold;"> </p></td> |
| </tr> |
| <tr valign="top"> |
| <td style="width: 9.304%; 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: 90.696%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-weight: bold;">To format your whole script:</p> |
| <ol type="1"> |
| <li class="p" style="margin-left: -20px;"><p>Open the required |
| file.</p></li> |
| <li class="p" style="margin-left: -20px;"><p>Go to <span style="font-weight: bold;"><b>Source |
| | Format Document</b></span> or press <span style="font-weight: bold;"><b>Ctrl+Shift+F</b></span>.</p></li> |
| </ol></td> |
| </tr> |
| <tr valign="top"> |
| <td colspan="2" style="width: 100%; padding-right: 10px; padding-left: 10px;"><p>Your |
| code will be automatically formatted.</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-style: italic; color: #0000ff; 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-style: italic; color: #0000ff; font-size: 6pt;"><img src="txt_file_icon.png" alt="Usage Example" title="Usage Example" style="border: none;" width="28" height="41" border="0"></p></td> |
| <td style="width: 92.907%; padding-right: 10px; padding-left: 10px;"><p |
| style="font-weight: bold;">Example:</p> |
| <div align="left" > |
| <table cellspacing="0" width="77.95%"> |
| <col style="width: 52.059%;"> |
| <col style="width: 47.941%;"> |
| <tr valign="top"> |
| <td style="border: Solid 1px #000000; width: 52.059%; padding-right: 10px; |
| padding-left: 10px;"><p><img src="unformatted_code.png" alt="unformatted_code.png" style="border: none;" width="361" height="108" border="0"></p></td> |
| <td style="border-top: Solid 1px #000000; border-right: Solid 1px #000000; |
| border-bottom: Solid 1px #000000; width: 47.941%; |
| padding-right: 10px; padding-left: 10px;"><p><img src="formatted_code.png" alt="formatted_code.png" style="border: none;" width="331" height="245" border="0"></p></td> |
| </tr> |
| <tr valign="top"> |
| <td style="border-left: Solid 1px #000000; border-right: Solid 1px #000000; |
| border-bottom: Solid 1px #000000; width: 52.059%; |
| padding-right: 10px; padding-left: 10px;"><p class="FIgureCaption">Unformatted |
| Code</p></td> |
| <td style="border-right: Solid 1px #000000; border-bottom: Solid 1px #000000; |
| width: 47.941%; padding-right: 10px; padding-left: 10px;"><p |
| class="FIgureCaption">Formatted Code</p></td> |
| </tr> |
| </table> |
| </div> |
| </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;"><span style="font-weight: bold;"><b>To |
| format only selected lines within the script:</b></span></p> |
| <ol type="1"> |
| <li class="p" style="margin-left: -20px;"><p>Select the relevant |
| lines.</p></li> |
| <li class="p" style="margin-left: -20px;"><p>Go to <span style="font-weight: bold;"><b>Source |
| | Format Active Elements</b></span> -or- press <span style="font-weight: bold;"><b>Ctrl+I</b></span>.</p></li> |
| </ol></td> |
| </tr> |
| <tr valign="top"> |
| <td colspan="2" style="width: 100%; padding-right: 10px; padding-left: 10px;"><p>Only |
| the selected lines will be formatted.</p></td> |
| |
| </tr> |
| </table> |
| <p class="Note">Note:</p> |
| <p class="NoteText">Code Formatting will also be available in JavaScript |
| editors.<br> |
| JavaScript Formatting preferences can be configured from <span style="font-weight: bold;"><b>Window |
| | Preferences | Web | JavaScript | Code Style | Formatter</b></span>.</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 style="font-weight: normal;"><a href="formatter.htm" style="font-weight: normal;">Formatter 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> |