本文整理汇总了PHP中Forge::textarea方法的典型用法代码示例。如果您正苦于以下问题:PHP Forge::textarea方法的具体用法?PHP Forge::textarea怎么用?PHP Forge::textarea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forge
的用法示例。
在下文中一共展示了Forge::textarea方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Forge
function no_group_test()
{
$form = new Forge("test/controller", "", "post", array("id" => "g-test-group-form"));
$form->input("title")->label(t("Title"));
$form->textarea("description")->label(t("Text Area"));
$form->submit("")->value(t("Submit"));
$csrf = access::csrf_token();
$expected = "<form action=\"http://./index.php/test/controller\" method=\"post\" " . "id=\"g-test-group-form\">\n" . "<input type=\"hidden\" name=\"csrf\" value=\"{$csrf}\" />" . " <ul>\n" . " <li>\n" . " <label for=\"title\" >Title</label>\n" . " <input type=\"text\" name=\"title\" value=\"\" " . "class=\"textbox\" />\n" . " </li>\n" . " <li>\n" . " <label for=\"description\" >Text Area</label>\n" . " <textarea name=\"description\" rows=\"\" cols=\"\" " . "class=\"textarea\" ></textarea>\n" . " </li>\n" . " <li>\n" . " <input type=\"submit\" value=\"Submit\" class=\"submit\" />\n" . " </li>\n" . " </ul>\n" . "</form>";
$this->assert_same($expected, (string) $form);
}
示例2: Forge
static function get_tag_form($itemids)
{
$tagPane = new Forge("organize/__FUNCTION__", "", "post", array("id" => "gEditTags", "ref" => "edit_tags"));
$tagPane->hidden("item")->value(implode("|", $itemids));
$item_count = count($itemids);
$ids = implode(", ", $itemids);
$tags = Database::instance()->query("SELECT t.name, COUNT(it.item_id) as count\n FROM {items_tags} it, {tags} t\n WHERE it.tag_id = t.id\n AND it.item_id in({$ids})\n GROUP BY it.tag_id\n ORDER BY t.name ASC");
$taglist = array();
foreach ($tags as $tag) {
$taglist[] = $tag->name . ($item_count > $tag->count ? "*" : "");
}
$taglist = implode("; ", $taglist);
$tagPane->textarea("tags")->label(t("Tags"))->value($taglist);
return $tagPane;
}
示例3: Forge
static function get_tag_form($itemids)
{
$tagPane = new Forge("organize/__FUNCTION__", "", "post", array("id" => "gEditTags", "ref" => "edit_tags"));
$tagPane->hidden("item")->value(implode("|", $itemids));
$item_count = count($itemids);
$ids = implode(", ", $itemids);
// Lame stopgap security check. This code is going to get rewritten anyway.
foreach ($itemids as $id) {
$item = ORM::factory("item", $id);
access::required("view", $item);
access::required("edit", $item);
}
$tags = Database::instance()->query("SELECT t.name, COUNT(it.item_id) as count\n FROM {items_tags} it, {tags} t\n WHERE it.tag_id = t.id\n AND it.item_id in({$ids})\n GROUP BY it.tag_id\n ORDER BY t.name ASC");
$taglist = array();
foreach ($tags as $tag) {
$taglist[] = $tag->name . ($item_count > $tag->count ? "*" : "");
}
$taglist = implode("; ", $taglist);
$tagPane->textarea("tags")->label(t("Tags"))->value($taglist);
return $tagPane;
}