Welcome Guest, Not a member yet? Register   Sign In
trying to use phpSpreadsheet
#10

(02-08-2018, 12:00 PM)daveĀ friend Wrote:
(02-08-2018, 11:31 AM)Wouter60 Wrote: "Require" and "Use" shouldn't be used inside a function, but before the class definition, at the top of the controller.

That is true of "use" but not of "require".

Not germane here, but important to know that (per the PHP manual) "A file containing a namespace must declare the namespace at the top of the file before any other code - with one exception: the declare keyword."

Right, that's why in this case, the require statement must be used at the top of the controller. The namespace can't be used if the third party php file wasn't included with require or require_once.
Reply


Messages In This Thread
trying to use phpSpreadsheet - by richb201 - 02-07-2018, 02:58 PM
RE: trying to use phpSpreadsheet - by dave friend - 02-07-2018, 04:03 PM
RE: trying to use phpSpreadsheet - by richb201 - 02-07-2018, 04:20 PM
RE: trying to use phpSpreadsheet - by dave friend - 02-07-2018, 08:24 PM
RE: trying to use phpSpreadsheet - by Wouter60 - 02-07-2018, 11:09 PM
RE: trying to use phpSpreadsheet - by richb201 - 02-07-2018, 11:29 PM
RE: trying to use phpSpreadsheet - by dave friend - 02-08-2018, 07:05 AM
RE: trying to use phpSpreadsheet - by Wouter60 - 02-08-2018, 11:31 AM
RE: trying to use phpSpreadsheet - by dave friend - 02-08-2018, 12:00 PM
RE: trying to use phpSpreadsheet - by Wouter60 - 02-08-2018, 01:54 PM
RE: trying to use phpSpreadsheet - by dave friend - 02-08-2018, 07:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB