After using Scriptcase for about a year I have started to work with accessing External Libraries. I am a visual person and finding it difficult to locate a good tutorial that goes through the steps of referencing an External Library. Does SC have an example of this?
The instructions and blogs do mention some things, but when I look at documentation for an External library I can’t tell if I should place their code to initialize the reference in ScriptInt or ApplicationInit.
This is what I have so far:
I am using PHPSpreadsheet-1.3.1. I have installed and enabled the library in Scriptcase 9.2.
<link rel=“stylesheet” type=“text/css” href="<?php echo sc_url_library(‘prj’, ‘PHPSpreadsheet’, ‘PhpSpreadsheet-1.3.1/src/PhpSpreadsheet/style/style.php’);?>">
I created a test button called “Import” to see if the library works:
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue(‘A1’, ‘Hello World !’);
$writer = new Xlsx($spreadsheet);
When I run the app I get the following error:
Parse error: syntax error, unexpected ‘use’ (T_USE) in D:\Development\NetMake\v9\wwwroot\scriptcase\app\PersonalFinances\control\control_apl.php on line 1328
The error points to the first use statement in the Button_Import code listed above.
Any ideas anyone. Thank you for the assistance in advance.