开发者

Help to understand Joomla! code

The code line is:

    $lists['published'] = JHTML::_('select.booleanlist', 'published' , 
'class="inputbox"', $row->published);

I found it at http://www.phpeveryday.com/articles/Joomla-Component-Creating-Form-Input-Data-at-Back-End-P44.html

You can do a search on the page for the code segment.

The problem is with JHTML::_( parameters ).

I looked into this Joomla! documentation page: http://docs.joomla.org/API15:JHTML/, but as a novice Joomla! programmer I couldn't understand the parameters. Can anyone help me understand the parameters please?

I thought this forum would be quicker in response than the mentioned site.

ADDED LATER: Following two lines are from:

http://www.phpeveryday.com/articles/Joomla-Component-Saving-Data-to-Database-P45.html

$checked    = JHTML::_('grid.id', $i, $row->id);

$published  = JHTML::_('grid.published', $row, $i); 

What is the explanation of grid.id and grid.publis开发者_运维百科hed please?


$lists['published'] = JHTML::_('select.booleanlist', 'published' , 'class="inputbox"', $row->published);

Its nothing but html generation for boolean type data. This will generate the html of radio list with two options yes and no.

  • First argument is html for which type of element
  • Second is name of radio list
  • Third is any attributes need to add to html of radio list
  • Forth is for the value which should be selected

$checked = JHTML::_('grid.id', $i, $row->id);

This is used to show the check-boxes according to id. Second argu is the counter of row, and third argu is the id value of the chekbox.

$published = JHTML::_('grid.published', $row, $i);

This is used to show cross and right mar in grid display in back-end. Cross mark when value is 0(no) and right mark is for 1(Yes).
Second argu s for name of field/element and third is the current value of that element.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜