本文整理汇总了PHP中FORM::js_name方法的典型用法代码示例。如果您正苦于以下问题:PHP FORM::js_name方法的具体用法?PHP FORM::js_name怎么用?PHP FORM::js_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FORM
的用法示例。
在下文中一共展示了FORM::js_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param FORM $form The form to which these commands belong.
* @param string $field_name The name of the field to select/de-select.
*/
public function __construct($form, $field_name)
{
$this->assert(isset($form), "[form] cannot be empty.", '__construct', 'SELECTION_COMMANDS');
parent::__construct($form->context);
$ctrl_name = $form->js_name($field_name);
$command = $this->app->make_command();
$command->id = 'select_all';
$command->caption = 'Select all';
$command->link = '#';
$command->executable = true;
$command->on_click = "select_all ({$ctrl_name})";
$this->append($command);
$command = $this->app->make_command();
$command->id = 'select_none';
$command->caption = 'Select none';
$command->link = '#';
$command->executable = true;
$command->on_click = "select_none ({$ctrl_name})";
$this->append($command);
}