Nevermind, I was conflating namespaces and autoloading
I’m hoping it’s something I’m not getting as opposed to SS being “helpful”
Anyone use namespaced functions? I’m specifically talking about namespacing functions, not classes. I can’t get it to work, I keep getting “undefined function”. I have a file
Schema.php with the namespace
App\Schema and a bunch of functions inside.
App resolves to
Schema.php lives in there. Normally the trailing part of a namespace is the class but in this case I don’t have one, so I assume it’s just the filename. Any idea?
I’ve never seen that documented anywhere?! Doesn’t even come up in the search on the SS online doco. Does the job though, thanks @andante
What’s the deal with outputting
JSON into a template? At the mo I’ve got a function returning a regular
json_encode of an associative array, and displaying it with the
.JS escape method in the template, but it’s escaping the quotes for instance
Anyone have issues with the embed feature of the WYSIWYG returning “invalid URL … (status code 429)” for YouTube videos?
I think I ran into a similar issue earlier. Do you have a lot of Youtube videos embedded on that page?
I found if you have too many, that error will occur. I think its because it uses oembed and its sending too many requests to Youtube on the same page. Youtube has a request limit
As a workaround I used the script editor in the HTMLEdtorField instead and just added the Youtube videos as iframes, instead of directly using the embed button
Yes, we do have a heap of YouTube videos
But generally only 1 per page …
.. so any idea why iframe works? they’re both making requests from the same IP and/or domain I would have thought…
Its probably th oembed feature making the request.. I dont think iFrame would make request
Yeah I just had this happen on a large site that got a lot of requests at once. 2 embeds on a blog and it broke everywhere.
So it must be oembed making the call, right? Changing them to iframe fixed my issue
Or is Chrome’s Lighthouse audit the be-all-to-end-all
Any suggestions on good tools for testing website perf and metrics?