当前位置: 首页>>代码示例>>PHP>>正文


PHP FormUI::on_save方法代码示例

本文整理汇总了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');
    }
开发者ID:ringmaster,项目名称:habari-test-plugin,代码行数:101,代码来源:test.plugin.php


注:本文中的FormUI::on_save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。