nanaweb / excel-selection-setter
Installs: 24 936
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- nanaweb/excel-util: ~0.9.1
Requires (Dev)
- phpunit/phpunit: ^4.8
This package is auto-updated.
Last update: 2024-11-04 15:25:17 UTC
README
Nanaweb.ExcelSelectionSetter
Sets active sheet and active cells of xlsx files.
Installation
Use composer.
$ composer require nanaweb/excel-selection-setter
Usage
AllFirst
Select first cell in each sheet, first sheet of the workbook.
<?php use Nanaweb\ExcelSelectionSetter\ExcelSelectionSetter; use Nanaweb\ExcelSelectionSetter\Strategy\AllFirst; $setter = new ExcelSelectionSetter(); $setter->addStrategy(new AllFirst()); $setter->execute($pathToYourXlsx, 'all_first');
SynchronizeToTemplate
Select the sheet which is selected in the template, cells which are selected in the template.
<?php use Nanaweb\ExcelSelectionSetter\ExcelSelectionSetter; use Nanaweb\ExcelSelectionSetter\Strategy\SynchronizeToTemplate; $setter = new ExcelSelectionSetter(); $setter->addStrategy(new SynchronizeToTemplate()); $setter->execute($pathToYourXlsx, 'synchronize_to_template');
Create your own strategy
Any classes which implement StrategyInterface
are accepted as strategy.