あなたは、モーダルボタン
static public function getModalButtonObject($name,$text,$link,$width=750,$height=480)
{
JHTML::_('behavior.modal', "a.{$name}"); // load the modal behavior for the name u given
$buttonMap = new JObject(); // create an Jobject which will contain some data, it is similar like stdClass object
$buttonMap->set('modal', true);
$buttonMap->set('text', $text);
$buttonMap->set('name', 'image');
$buttonMap->set('modalname', $name);
$buttonMap->set('options', "{handler: 'iframe', size: {x: ".$width.", y: ".$height."}}");
$buttonMap->set('link', $link);
return $buttonMap;
}
そしてHTMLそれはどこでもその複雑近くである必要はありません
<a id="<?php echo $buttonMap->modalname; ?>" class="<?php echo $buttonMap->modalname; ?>" title="<?php echo $buttonMap->text; ?>" href="<?php echo $buttonMap->link; ?>" rel="<?php echo $buttonMap->options; ?>"><?php echo $buttonMap->text; ?></a>
ありがとうございます。私はこれに新しいので、そこに何が起こっているのか、どのように使用するのか説明してください。 – Sara
特別なことは何もありません。私はちょうどボタンのモーダル動作をロードし、HTMLで使用できるJObjectを作成しました。 – Gaurav
ありがとうございました。 – Sara