? Success

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
23 May 2015

The Proposal

To demonstrate a feature of JHtml::_(), I'm suggesting to rename the JHtml helper class in the install app to demonstrate how that method can use a three part key.

Details

JHtml::_() calls JHtml::extract() to turn the key supplied in the _ method's first argument into a class and method name. A standard two part key like bootstrap.modal will try to locate and call JHtmlBootstrap::modal(). A three part key like my proposed installationhtml.helper.stepbar will try to locate and call InstallationHtmlHelper::stepbar(). When three keys exist, the first key is used as the class name prefix (defaults to JHtml if not provided).

Why Make This Change?

There are a lot of features in JHtml that aren't well documented or used. By trying to demonstrate some of those features in the core code, we can show developers the advanced use cases of its internal API.

How to Test

Apply the patch and run the installer. Should still have a stepbar and no errors.

avatar mbabker mbabker - open - 23 May 2015
avatar nikosdion
nikosdion - comment - 23 May 2015

:+1: It does not affect backwards compatibility and makes life easier.

PS: I'd much rather have an autoloader and use the JHtml* classes directly without going through JHtml::_() but I know that this can't happen in Joomla! 3.

avatar mbabker
mbabker - comment - 23 May 2015

You can use the JHtml classes directly. But, one of the massively underdocumented features in JHtml is its register and unregister API which can allow you to specify functions to be called for different keys (as in you can overload the core JHtmlBootstrap class with a custom version supporting Bootstrap 3). And that's the only reason I actually suggest JHtml::_() actually be used. Without that feature, I'd deprecate all that key handler stuff and go for direct loading.

avatar nikosdion
nikosdion - comment - 23 May 2015

If only template developers would have caught wind and use it :)

avatar joomla-cms-bot joomla-cms-bot - change - 23 May 2015
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 23 May 2015
Labels Added: ?
avatar mbabker
mbabker - comment - 23 May 2015

Feel free to point those devs over to https://github.com/mbabker/bs3-demo

avatar zero-24 zero-24 - change - 23 May 2015
Status New Pending
avatar zero-24 zero-24 - change - 23 May 2015
Category Installation
avatar zero-24 zero-24 - change - 23 May 2015
Easy No Yes
avatar jwaisner
jwaisner - comment - 23 May 2015

@test

Applied patch and install completed with no errors.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7017.

avatar jwaisner jwaisner - test_item - 23 May 2015 - Tested successfully
avatar wilsonge wilsonge - change - 25 May 2015
Milestone Added:
avatar designbengel
designbengel - comment - 11 Jun 2015

i took your branch and installation went well :)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7017.

avatar designbengel designbengel - test_item - 11 Jun 2015 - Tested successfully
avatar Bakual Bakual - change - 11 Jun 2015
Labels Added: ?
avatar Bakual Bakual - change - 11 Jun 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 11 Jun 2015
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 11 Jun 2015

RTC :smile:


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7017.

avatar mbabker mbabker - reference | e692048 - 12 Jun 15
avatar zero-24 zero-24 - close - 12 Jun 2015
avatar Bakual
Bakual - comment - 12 Jun 2015

Merged into 3.5-dev with e692048

Thanks!

avatar Bakual Bakual - close - 12 Jun 2015
avatar Bakual Bakual - change - 12 Jun 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-06-12 13:41:16
Closed_By Bakual
avatar Bakual Bakual - close - 12 Jun 2015
avatar shre001
shre001 - comment - 13 Jul 2015

@test works fine

avatar mbabker mbabker - reference | 17e9b68 - 6 Aug 15
avatar mbabker mbabker - head_ref_deleted - 1 Oct 2015
avatar zero-24 zero-24 - change - 14 Oct 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment