本文整理匯總了PHP中FormUI::on_save方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormUI::on_save方法的具體用法?PHP FormUI::on_save怎麽用?PHP FormUI::on_save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FormUI
的用法示例。
在下文中一共展示了FormUI::on_save方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: theme_route_submit_addon
//.........這裏部分代碼省略.........
"forced":false,
"after":"7b9775cb1f23068c6b37f05d9557ad318fce5f5f",
"head_commit":{
"modified":[
"secretfile.plugin.xml"
],
"added":[
],
"timestamp":"2013-01-22T13:00:00-08:00",
"author":{
"name":"ringmaster",
"username":"ringmaster",
"email":"a_github@midnightcircus.com"
},
"removed":[
],
"url":"https://github.com/ringmaster/secretfile/commit/7b9775cb1f23068c6b37f05d9557ad318fce5f5f",
"id":"7b9775cb1f23068c6b37f05d9557ad318fce5f5f",
"distinct":true,
"message":"Add GUID and help. Fixes #1",
"committer":{
"name":"ringmaster",
"username":"ringmaster",
"email":"a_github@midnightcircus.com"
}
},
"deleted":false,
"ref":"refs/heads/master",
"commits":[
{
"modified":[
"secretfile.plugin.xml"
],
"added":[
],
"timestamp":"2013-01-22T13:00:00-08:00",
"author":{
"name":"ringmaster",
"username":"ringmaster",
"email":"a_github@midnightcircus.com"
},
"removed":[
],
"url":"https://github.com/ringmaster/secretfile/commit/7b9775cb1f23068c6b37f05d9557ad318fce5f5f",
"id":"7b9775cb1f23068c6b37f05d9557ad318fce5f5f",
"distinct":true,
"message":"Add GUID and help. Fixes #1",
"committer":{
"name":"ringmaster",
"username":"ringmaster",
"email":"a_github@midnightcircus.com"
}
}
],
"before":"092e6178fba5289d5820506b7cde3e67edc956f3",
"compare":"https://github.com/ringmaster/secretfile/compare/092e6178fba5...7b9775cb1f23",
"created":false
}
JSON;
$xml = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<pluggable type="plugin">
\t<name>Secret File</name>
\t<license url="http://www.apache.org/licenses/LICENSE-2.0.html">Apache Software License 2.0</license>
\t<author url="http://owenw.com/">Owen Winkler</author>
\t<version>1.0</version>
\t<url>http://redalt.com/</url>
\t<description><![CDATA[This plugin allows the insertion of links to files into a post such that access to those links is only allowed if you are also allowed access to the post they appear in.]]></description>
\t<copyright>2013</copyright>
\t<help>
\t\t<value><![CDATA[
\t\t<p>Install and activate the plugin. Create a post. Find a file in the Habari Silo to insert as a link into the post. Choose the new menu option "insert secret_link" from the menu under that file. A shorttag will appear in the editor. Save the post.
\t\t<p>The shorttag that is created will be rendered as a link by Habari when the post is displayed to a user. When the user clicks on the link, the selected file downloads.
\t\t<p>Displaying the link in the post saves a value to that user's session. As a result, the user must visit the post immediately prior to attempting the download. If the user attempts to go directly to the download URL without visiting the post, they will first be redirected to the post. If they are not logged in, it's possible that the post will "not exist" for them, and they will instead be directed to the home page. If permissions prevent the user from viewing the post, they will not be able to download the file.
\t\t]]></value>
\t</help>
\t<guid>bca39cf7-602c-4f98-87a0-3a98bea2a168</guid>
</pluggable>
XML;
$form->append(new FormControlTextArea('json', 'null:null', 'JSON'));
$form->json->value = $json;
$form->append(new FormControlTextArea('xml', 'null:null', 'XML'));
$form->xml->value = $xml;
$form->append(new FormControlSubmit('submit', 'Submit'));
$form->on_save(array($this, 'addon_success'));
$form->out();
$theme->display('footer');
}