Directly using the internal classes rather than template keys is a hack from the skinning perspective. So I didn't include any documentation on doing stuff like that. Though maybe we should.
You do not want to use $wgUser to get the user. That should actually be $this->getSkin()->getUser() that'll get the User object from the relevant request context.
But the template actually has some keys in it directly related to the user: username, userpage, userpageurl, loggedin
Besides that you can also access the generated links like the personal urls userpage directly instead of looping over and outputting them all.
Okay that's cool. I did look briefly through some of the classes but didn't realize you could get the user from the skin instance. I'll do some refactoring on the skin later on and fix up some of this.
I guess I forgot about things like custom scripts when I wrote the tutorial. Rather than putting the scripts inline the typical practice is to create a second ResourceLoader module (like the skins.laravel-io-wiki-skin one) as something like 'skins.laravel-io-wiki-skin.**js' and instead of defining a 'styles' array define a list of 'scripts' then use $out->addModules( 'skins.laravel-io-wiki-skin.**js' ); inside the initPage method in your skin.
This also has the advantage of your JS being minified, combined, cached, and delivered with any dependencies you need.
For some reason I thought about this but must have forgotten as I did see something similar in another article. I'll have to add this in to the skin as well.
Some other random tips:
- bootstrap.php shouldn't really be the name you use, our practice for
extensions and skins is for that file to have the same name as the folder it's in, so `laravel-io-wiki-skin/laravel-**io-wiki-skin.php`. In the future when we start auto detecting things for you, providing helpers to make loading skins easier, etc... this is very likely the only pattern we'll support.
- The url in $wgExtensionCredits should really just be a url. It's not a
link, it's used as a url when turning the 'name' of the extension/skin into a link on Special:Version. So your Special:Version looks a little broken now http://wiki.laravel.io/Special:Version
Thanks for the heads up. I don't know why I made it a link like that either, I swear I saw that mentioned somewhere. It's on the list to change.
Thanks very much for the feedback. Your tutorial was very useful during the process.