diff --git a/docs/topics/accessing-cells.md b/docs/topics/accessing-cells.md index 6d100ebe..8ac11ec7 100644 --- a/docs/topics/accessing-cells.md +++ b/docs/topics/accessing-cells.md @@ -356,9 +356,9 @@ Note that we have set the cell iterator's `setIterateOnlyExistingCells()` to FALSE. This makes the iterator loop all cells within the worksheet range, even if they have not been set. -The cell iterator will return a **NULL** as the cell value if it is not +The cell iterator will return a `null` as the cell value if it is not set in the worksheet. Setting the cell iterator's -setIterateOnlyExistingCells() to FALSE will loop all cells in the +`setIterateOnlyExistingCells()` to `false` will loop all cells in the worksheet that can be available at that moment. This will create new cells if required and increase memory usage! Only use it if it is intended to loop all cells that are possibly available. @@ -433,14 +433,14 @@ while \$col != the incremented highest column. ## Using value binders to facilitate data entry Internally, PhpSpreadsheet uses a default -\PhpOffice\PhpSpreadsheet\Cell\IValueBinder implementation +`\PhpOffice\PhpSpreadsheet\Cell\IValueBinder` implementation (\PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder) to determine data types of entered data using a cell's `setValue()` method (the `setValueExplicit()` method bypasses this check). Optionally, the default behaviour of PhpSpreadsheet can be modified, allowing easier data entry. For example, a -\PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder class is available. +`\PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder` class is available. It automatically converts percentages, number in scientific format, and dates entered as strings to the correct format, also setting the cell's style information. The following example demonstrates how to set the @@ -469,6 +469,6 @@ $spreadsheet->getActiveSheet()->setCellValue('B5', '21 December 1983'); **Creating your own value binder is easy.** When advanced value binding is required, you can implement the -\PhpOffice\PhpSpreadsheet\Cell\IValueBinder interface or extend the -\PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder or -\PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder classes. +`\PhpOffice\PhpSpreadsheet\Cell\IValueBinder` interface or extend the +`\PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder` or +`\PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder` classes. diff --git a/docs/topics/architecture.md b/docs/topics/architecture.md index a353353f..0295d672 100644 --- a/docs/topics/architecture.md +++ b/docs/topics/architecture.md @@ -32,8 +32,8 @@ By default, the PhpSpreadsheet package provides some readers and writers, including one for the Open XML spreadsheet format (a.k.a. Excel 2007 file format). You are not limited to the default readers and writers, as you are free to implement the -\PhpOffice\PhpSpreadsheet\Reader\IReader and -\PhpOffice\PhpSpreadsheet\Writer\IWriter interface in a custom class. +`\PhpOffice\PhpSpreadsheet\Reader\IReader` and +`\PhpOffice\PhpSpreadsheet\Writer\IWriter` interface in a custom class. ![02-readers-writers.png](./images/02-readers-writers.png "Readers/Writers") diff --git a/docs/topics/autofilters.md b/docs/topics/autofilters.md index 15be56f8..9c367c3d 100644 --- a/docs/topics/autofilters.md +++ b/docs/topics/autofilters.md @@ -296,7 +296,7 @@ $columnFilter->setAndOr( ``` The valid set of operators for Custom Filters are defined in the -\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule class, and +`\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule` class, and comprise: Operator Constant | Value @@ -345,7 +345,7 @@ $columnFilter->createRule() We also set the rule type to DYNAMICFILTER. The valid set of dynamic filter categories is defined in the -\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule class, and +`\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule` class, and comprises: Operator Constant | Value @@ -458,7 +458,7 @@ $columnFilter->createRule() The option values for TopTen Filters top/bottom value/percent are all defined in the -\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule class, and +`\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule` class, and comprise: Operator Constant | Value diff --git a/docs/topics/calculation-engine.md b/docs/topics/calculation-engine.md index 6a84f8c0..dc748728 100644 --- a/docs/topics/calculation-engine.md +++ b/docs/topics/calculation-engine.md @@ -79,7 +79,7 @@ content. #### Formulas don’t seem to be calculated in Excel2003 using compatibility pack? This is normal behaviour of the compatibility pack, Xlsx displays this -correctly. Use \PhpOffice\PhpSpreadsheet\Writer\Xls if you really need +correctly. Use `\PhpOffice\PhpSpreadsheet\Writer\Xls` if you really need calculated values, or force recalculation in Excel2003. ## Handling Date and Time Values @@ -107,7 +107,7 @@ where the following constants can be used for `$returnDateType`: The method will return a Boolean True on success, False on failure (e.g. if an invalid value is passed in for the return date type). -The \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType() +The `\PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType()` method can be used to determine the current value of this setting: ``` php @@ -146,7 +146,7 @@ base date for the Mac 1904 calendar. It is possible for scripts to change the calendar used for calculating Excel date values by calling the -\PhpOffice\PhpSpreadsheet\Shared\Date::setExcelCalendar() method: +`\PhpOffice\PhpSpreadsheet\Shared\Date::setExcelCalendar()` method: ``` php \PhpOffice\PhpSpreadsheet\Shared\Date::setExcelCalendar($baseDate); @@ -160,7 +160,7 @@ where the following constants can be used for `$baseDate`: The method will return a Boolean True on success, False on failure (e.g. if an invalid value is passed in). -The \PhpOffice\PhpSpreadsheet\Shared\Date::getExcelCalendar() method can +The `\PhpOffice\PhpSpreadsheet\Shared\Date::getExcelCalendar()` method can be used to determine the current value of this setting: ``` php @@ -237,7 +237,7 @@ rather than converted to Excel date timestamp values. In addition to the `setExcelCalendar()` and `getExcelCalendar()` methods, a number of other methods are available in the -\PhpOffice\PhpSpreadsheet\Shared\Date class that can help when working +`\PhpOffice\PhpSpreadsheet\Shared\Date` class that can help when working with dates: #### \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDate) @@ -1024,7 +1024,7 @@ February 27, 2008. This could be a PHP timestamp value (integer), a PHP `DateTime` object, or an Excel timestamp value (real), depending on the value of -\PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(). +`\PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType()`. ##### Examples @@ -1229,7 +1229,7 @@ A string, representing a date value. This could be a PHP timestamp value (integer), a PHP `DateTime` object, or an Excel timestamp value (real), depending on the value of -\PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(). +`\PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType()`. ##### Examples @@ -1351,7 +1351,7 @@ $retVal = call_user_func_array( ##### Notes Note that the PhpSpreadsheet function is -\PhpOffice\PhpSpreadsheet\Calculation\Functions::DAYOFMONTH() when the +`\PhpOffice\PhpSpreadsheet\Calculation\Functions::DAYOFMONTH()` when the method is called statically. #### DAYS360 @@ -1479,7 +1479,7 @@ value yields a past date. This could be a PHP timestamp value (integer), a PHP `DateTime` object, or an Excel timestamp value (real), depending on the value of -\PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(). +`\PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType()`. ##### Examples @@ -1552,7 +1552,7 @@ value yields a past date. This could be a PHP timestamp value (integer), a PHP `DateTime` object, or an Excel timestamp value (real), depending on the value of -\PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(). +`\PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType()`. ##### Examples @@ -1646,7 +1646,7 @@ $retVal = call_user_func_array( ##### Notes Note that the PhpSpreadsheet function is -\PhpOffice\PhpSpreadsheet\Calculation\Functions::HOUROFDAY() when the +`\PhpOffice\PhpSpreadsheet\Calculation\Functions::HOUROFDAY()` when the method is called statically. #### MINUTE @@ -1704,7 +1704,7 @@ $retVal = call_user_func_array( ##### Notes Note that the PhpSpreadsheet function is -\PhpOffice\PhpSpreadsheet\Calculation\Functions::MINUTE() when the +`\PhpOffice\PhpSpreadsheet\Calculation\Functions::MINUTE()` when the method is called statically. #### MONTH @@ -1757,7 +1757,7 @@ $retVal = call_user_func_array( #### Notes Note that the PhpSpreadsheet function is -\PhpOffice\PhpSpreadsheet\Calculation\Functions::MONTHOFYEAR() when the +`\PhpOffice\PhpSpreadsheet\Calculation\Functions::MONTHOFYEAR()` when the method is called statically. #### NETWORKDAYS @@ -1830,7 +1830,7 @@ time. This could be a PHP timestamp value (integer), a PHP `DateTime` object, or an Excel timestamp value (real), depending on the value of -\PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(). +`\PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType()`. ##### Examples @@ -1843,7 +1843,7 @@ or an Excel timestamp value (real), depending on the value of ##### Notes Note that the PhpSpreadsheet function is -\PhpOffice\PhpSpreadsheet\Calculation\Functions::DATETIMENOW() when the +`\PhpOffice\PhpSpreadsheet\Calculation\Functions::DATETIMENOW()` when the method is called statically. #### SECOND @@ -1902,7 +1902,7 @@ $retVal = call_user_func_array( ##### Notes Note that the PhpSpreadsheet function is -\PhpOffice\PhpSpreadsheet\Calculation\Functions::SECOND() when the +`\PhpOffice\PhpSpreadsheet\Calculation\Functions::SECOND()` when the method is called statically. #### TIME @@ -1986,7 +1986,7 @@ $retVal = call_user_func_array( ##### Notes Note that the PhpSpreadsheet function is -\PhpOffice\PhpSpreadsheet\Calculation\Functions::WEEKDAY() when the +`\PhpOffice\PhpSpreadsheet\Calculation\Functions::WEEKDAY()` when the method is called statically. #### WEEKNUM diff --git a/docs/topics/reading-and-writing-to-file.md b/docs/topics/reading-and-writing-to-file.md index 045ccc49..2274db0a 100644 --- a/docs/topics/reading-and-writing-to-file.md +++ b/docs/topics/reading-and-writing-to-file.md @@ -4,33 +4,33 @@ As you already know from the [architecture](./architecture.md#readers-and-writer reading and writing to a persisted storage is not possible using the base PhpSpreadsheet classes. For this purpose, PhpSpreadsheet provides readers and writers, which are -implementations of \PhpOffice\PhpSpreadsheet\Reader\IReader and -\PhpOffice\PhpSpreadsheet\Writer\IWriter. +implementations of `\PhpOffice\PhpSpreadsheet\Reader\IReader` and +`\PhpOffice\PhpSpreadsheet\Writer\IWriter`. ## \PhpOffice\PhpSpreadsheet\IOFactory The PhpSpreadsheet API offers multiple methods to create a -\PhpOffice\PhpSpreadsheet\Reader\IReader or -\PhpOffice\PhpSpreadsheet\Writer\IWriter instance: +`\PhpOffice\PhpSpreadsheet\Reader\IReader` or +`\PhpOffice\PhpSpreadsheet\Writer\IWriter` instance: -Direct creation via \PhpOffice\PhpSpreadsheet\IOFactory. All examples +Direct creation via `\PhpOffice\PhpSpreadsheet\IOFactory`. All examples underneath demonstrate the direct creation method. Note that you can -also use the \PhpOffice\PhpSpreadsheet\IOFactory class to do this. +also use the `\PhpOffice\PhpSpreadsheet\IOFactory` class to do this. -### Creating \PhpOffice\PhpSpreadsheet\Reader\IReader using \PhpOffice\PhpSpreadsheet\IOFactory +### Creating `\PhpOffice\PhpSpreadsheet\Reader\IReader` using `\PhpOffice\PhpSpreadsheet\IOFactory` There are 2 methods for reading in a file into PhpSpreadsheet: using automatic file type resolving or explicitly. Automatic file type resolving checks the different -\PhpOffice\PhpSpreadsheet\Reader\IReader distributed with +`\PhpOffice\PhpSpreadsheet\Reader\IReader` distributed with PhpSpreadsheet. If one of them can load the specified file name, the -file is loaded using that \PhpOffice\PhpSpreadsheet\Reader\IReader. +file is loaded using that `\PhpOffice\PhpSpreadsheet\Reader\IReader`. Explicit mode requires you to specify which -\PhpOffice\PhpSpreadsheet\Reader\IReader should be used. +`\PhpOffice\PhpSpreadsheet\Reader\IReader` should be used. -You can create a \PhpOffice\PhpSpreadsheet\Reader\IReader instance using -\PhpOffice\PhpSpreadsheet\IOFactory in automatic file type resolving +You can create a `\PhpOffice\PhpSpreadsheet\Reader\IReader` instance using +`\PhpOffice\PhpSpreadsheet\IOFactory` in automatic file type resolving mode using the following code sample: ``` php @@ -51,8 +51,8 @@ $reader->setReadDataOnly(true); $reader->load("05featuredemo.xlsx"); ``` -You can create a \PhpOffice\PhpSpreadsheet\Reader\IReader instance using -\PhpOffice\PhpSpreadsheet\IOFactory in explicit mode using the following +You can create a `\PhpOffice\PhpSpreadsheet\Reader\IReader` instance using +`\PhpOffice\PhpSpreadsheet\IOFactory` in explicit mode using the following code sample: ``` php @@ -63,10 +63,10 @@ $spreadsheet = $reader->load("05featuredemo.xlsx"); Note that automatic type resolving mode is slightly slower than explicit mode. -### Creating \PhpOffice\PhpSpreadsheet\Writer\IWriter using \PhpOffice\PhpSpreadsheet\IOFactory +### Creating `\PhpOffice\PhpSpreadsheet\Writer\IWriter` using `\PhpOffice\PhpSpreadsheet\IOFactory` -You can create a PhpOffice\PhpSpreadsheet\Writer\IWriter instance using -\PhpOffice\PhpSpreadsheet\IOFactory: +You can create a `\PhpOffice\PhpSpreadsheet\Writer\IWriter` instance using +`\PhpOffice\PhpSpreadsheet\IOFactory`: ``` php $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, "Xlsx"); @@ -116,8 +116,8 @@ $spreadsheet = $reader->load("05featuredemo.xlsx"); You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements -\PhpOffice\PhpSpreadsheet\Reader\IReadFilter. By default, all cells are -read using the \PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter. +`\PhpOffice\PhpSpreadsheet\Reader\IReadFilter`. By default, all cells are +read using the `\PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter`. The following code will only read row 1 and rows 20 – 30 of any sheet in the Excel file: @@ -234,8 +234,8 @@ $spreadsheet = $reader->load("05featuredemo.xls"); You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements -\PhpOffice\PhpSpreadsheet\Reader\IReadFilter. By default, all cells are -read using the \PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter. +`\PhpOffice\PhpSpreadsheet\Reader\IReadFilter`. By default, all cells are +read using the `\PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter`. The following code will only read row 1 and rows 20 to 30 of any sheet in the Excel file: @@ -293,8 +293,8 @@ $spreadsheet = $reader->load("05featuredemo.xml"); You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements -\PhpOffice\PhpSpreadsheet\Reader\IReadFilter. By default, all cells are -read using the \PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter. +`\PhpOffice\PhpSpreadsheet\Reader\IReadFilter`. By default, all cells are +read using the `\PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter`. The following code will only read row 1 and rows 20 to 30 of any sheet in the Excel file: @@ -344,8 +344,8 @@ $spreadsheet = $reader->load("05featuredemo.slk"); You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements -\PhpOffice\PhpSpreadsheet\Reader\IReadFilter. By default, all cells are -read using the \PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter. +`\PhpOffice\PhpSpreadsheet\Reader\IReadFilter`. By default, all cells are +read using the `\PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter`. The following code will only read row 1 and rows 20 to 30 of any sheet in the SYLK file: @@ -389,8 +389,8 @@ $spreadsheet = $reader->load("05featuredemo.ods"); You can set the option setReadFilter on the reader, to instruct the reader to only load the cells which match a given rule. A read filter can be any class which implements -\PhpOffice\PhpSpreadsheet\Reader\IReadFilter. By default, all cells are -read using the \PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter. +`\PhpOffice\PhpSpreadsheet\Reader\IReadFilter`. By default, all cells are +read using the `\PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter`. The following code will only read row 1 and rows 20 to 30 of any sheet in the Calc file: @@ -437,14 +437,14 @@ $spreadsheet = $reader->load("sample.csv"); Often, CSV files are not really "comma separated", or use semicolon (`;`) as a separator. You can instruct -\PhpOffice\PhpSpreadsheet\Reader\Csv some options before reading a CSV +`\PhpOffice\PhpSpreadsheet\Reader\Csv` some options before reading a CSV file. The separator will be auto-detected, so in most cases it should not be necessary to specify it. But in cases where auto-detection does not fit the use-case, then it can be set manually. -Note that \PhpOffice\PhpSpreadsheet\Reader\Csv by default assumes that +Note that `\PhpOffice\PhpSpreadsheet\Reader\Csv` by default assumes that the loaded CSV file is UTF-8 encoded. If you are reading CSV files that were created in Microsoft Office Excel the correct input encoding may rather be Windows-1252 (CP1252). Always make sure that the input @@ -500,7 +500,7 @@ $writer->save("05featuredemo.csv"); Often, CSV files are not really "comma separated", or use semicolon (`;`) as a separator. You can instruct -\PhpOffice\PhpSpreadsheet\Writer\Csv some options before writing a CSV +`\PhpOffice\PhpSpreadsheet\Writer\Csv` some options before writing a CSV file: ``` php @@ -600,7 +600,7 @@ and does not yet support merged cells or nested tables cleanly ### \PhpOffice\PhpSpreadsheet\Writer\Html -Please note that \PhpOffice\PhpSpreadsheet\Writer\Html only outputs the +Please note that `\PhpOffice\PhpSpreadsheet\Writer\Html` only outputs the first worksheet by default. #### Writing a spreadsheet @@ -723,7 +723,7 @@ $writer->save("05featuredemo.htm"); #### Decimal and thousands separators -See section \PhpOffice\PhpSpreadsheet\Writer\Csv how to control the +See section `\PhpOffice\PhpSpreadsheet\Writer\Csv` how to control the appearance of these. ## PDF @@ -849,7 +849,7 @@ $writer->save("05featuredemo.pdf"); #### Decimal and thousands separators -See section \PhpOffice\PhpSpreadsheet\Writer\Csv how to control the +See section `\PhpOffice\PhpSpreadsheet\Writer\Csv` how to control the appearance of these. ## Generating Excel files from templates (read, modify, write) diff --git a/docs/topics/reading-files.md b/docs/topics/reading-files.md index 3d8f20f7..a298404c 100644 --- a/docs/topics/reading-files.md +++ b/docs/topics/reading-files.md @@ -100,9 +100,9 @@ $spreadsheet = $reader->load($inputFileName); See `samples/Reader/03_Simple_file_reader_using_the_IOFactory_to_return_a_reader.php` for a working example of this code. -If you're uncertain of the filetype, you can use the IO Factory's -identify() method to identify the reader that you need, before using the -createReader() method to instantiate the reader object. +If you're uncertain of the filetype, you can use the `IOFactory::identify()` +method to identify the reader that you need, before using the +`createReader()` method to instantiate the reader object. ``` php $inputFileName = './sampleData/example1.xls'; @@ -129,7 +129,7 @@ executing the `load()` method. If you're only interested in the cell values in a workbook, but don't need any of the cell formatting information, then you can set the reader to read only the data values and any formulae from each cell using the -setReadDataOnly() method. +`setReadDataOnly()` method. ``` php $inputFileType = 'Xls'; @@ -170,7 +170,7 @@ CSV | NO | HTML | NO If your workbook contains a number of worksheets, but you are only interested in reading some of those, then you can use the -setLoadSheetsOnly() method to identify those sheets you are interested +`setLoadSheetsOnly()` method to identify those sheets you are interested in reading. To read a single sheet, you can pass that sheet name as a parameter to @@ -242,8 +242,8 @@ CSV | NO | HTML | NO If you are only interested in reading part of a worksheet, then you can write a filter class that identifies whether or not individual cells should be read by the loader. A read filter must implement the -\PhpOffice\PhpSpreadsheet\Reader\IReadFilter interface, and contain a -readCell() method that accepts arguments of `$column`, `$row` and +`\PhpOffice\PhpSpreadsheet\Reader\IReadFilter` interface, and contain a +`readCell()` method that accepts arguments of `$column`, `$row` and `$worksheetName`, and return a boolean true or false that indicates whether a workbook cell identified by those arguments should be read or not. @@ -444,7 +444,7 @@ Xlsx | NO | Xls | NO | Xml | NO | Ods | NO | SYLK | YES | Gnumeric | NO | CSV | YES | HTML | NO -### Combining Read Filters with the setSheetIndex() method to split a large CSV file across multiple Worksheets +### Combining Read Filters with the `setSheetIndex()` method to split a large CSV file across multiple Worksheets An Xls BIFF .xls file is limited to 65536 rows in a worksheet, while the Xlsx Microsoft Office Open XML SpreadsheetML .xlsx file is limited to @@ -624,7 +624,7 @@ any problems that are encountered, and deal with them in an appropriate manner. The PhpSpreadsheet Readers throw a -\PhpOffice\PhpSpreadsheet\Reader\Exception. +`\PhpOffice\PhpSpreadsheet\Reader\Exception`. ``` php $inputFileName = './sampleData/example-1.xls'; diff --git a/docs/topics/recipes.md b/docs/topics/recipes.md index af10798c..6bfb66a1 100644 --- a/docs/topics/recipes.md +++ b/docs/topics/recipes.md @@ -96,10 +96,10 @@ $spreadsheet->getActiveSheet()->getStyle('D1') ``` The above methods for entering a date all yield the same result. -\PhpOffice\PhpSpreadsheet\Style\NumberFormat provides a lot of +`\PhpOffice\PhpSpreadsheet\Style\NumberFormat` provides a lot of pre-defined date formats. -The \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel() method will also +The `\PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel()` method will also work with a PHP DateTime object. Similarly, times (or date and time values) can be entered in the same @@ -333,7 +333,7 @@ As you can see, it is not necessary to call setFitToPage(TRUE) since setFitToWidth(...) and setFitToHeight(...) triggers this. If you use `setFitToWidth()` you should in general also specify -setFitToHeight() explicitly like in the example. Be careful relying on +`setFitToHeight()` explicitly like in the example. Be careful relying on the initial values. ### Page margins @@ -1197,7 +1197,7 @@ $spreadsheet->getActiveSheet()->insertNewRowBefore(7, 2); A drawing is always represented as a separate object, which can be added to a worksheet. Therefore, you must first instantiate a new -\PhpOffice\PhpSpreadsheet\Worksheet\Drawing, and assign its properties a +`\PhpOffice\PhpSpreadsheet\Worksheet\Drawing`, and assign its properties a meaningful value: ``` php @@ -1299,7 +1299,7 @@ foreach ($spreadsheet->getActiveSheet()->getDrawingCollection() as $drawing) { ## Add rich text to a cell Adding rich text to a cell can be done using -\PhpOffice\PhpSpreadsheet\RichText instances. Here''s an example, which +`\PhpOffice\PhpSpreadsheet\RichText` instances. Here''s an example, which creates the following rich text string: > This invoice is ***payable within thirty days after the end of the @@ -1346,10 +1346,10 @@ steps that can be followed to do this: 1. Create your PhpSpreadsheet spreadsheet 2. Output HTTP headers for the type of document you wish to output -3. Use the \PhpOffice\PhpSpreadsheet\Writer\* of your choice, and save +3. Use the `\PhpOffice\PhpSpreadsheet\Writer\*` of your choice, and save to "php://output" -\PhpOffice\PhpSpreadsheet\Writer\Xlsx uses temporary storage when +`\PhpOffice\PhpSpreadsheet\Writer\Xlsx` uses temporary storage when writing to php://output. By default, temporary files are stored in the script's working directory. When there is no access, it falls back to the operating system's temporary files location. @@ -1472,7 +1472,7 @@ $worksheet1 = $spreadsheet->createSheet(); $worksheet1->setTitle('Another sheet'); ``` -Think of createSheet() as the "Insert sheet" button in Excel. When you +Think of `createSheet()` as the "Insert sheet" button in Excel. When you hit that button a new sheet is appended to the existing collection of worksheets in the workbook. diff --git a/docs/topics/worksheets.md b/docs/topics/worksheets.md index cb3e3634..f732e6ea 100644 --- a/docs/topics/worksheets.md +++ b/docs/topics/worksheets.md @@ -76,7 +76,7 @@ guarantee that the title is unique. Alternatively, you can instantiate a new worksheet (setting the title to whatever you choose) and then insert it into your workbook using the -addSheet() method. +`addSheet()` method. ``` php // Create a new worksheet called "My Data"