承接 formatd/useractionhistory 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

formatd/useractionhistory

Composer 安装命令:

composer require formatd/useractionhistory

包简介

A request history for Neos FLow applications.

README 文档

README

A request history for Neos FLow applications. This package was mainly build for CRUD like backend interfaces but can be used for a lot of use cases.

What does it do?

It provides a session scope object with the possibility to add requests into a history stack. With this history it is possible for example to handle back-links or redirects back to the previous page after some action.

Adding Entries

Inject the UserActionHistory into your controller and add entries like that. You should not add unsafe requests (e.g. POST) to the history because if you redirect to them later it will have unexpected results.

    $this->userActionHistory->addEntry('Edit Backend-User: ' . $user->getName(), $this->request, $user);

Redirecting to previous request

If you want to redirect to the previous request for example in an updateAction you can do the following. Notice that you can provide action patterns to skip (for example if you do not want to redirect to the editAction but to the request previous to that).

    if ($lastRequest = $this->userActionHistory->getLastActionRequest('UserManagement->edit')) {
        $this->redirectToRequest($lastRequest);
    } else {
        $this->redirect('index');
    }

Displaying a linked list of history items

If you want to build a menu of your last visited pages (or last edited records in a CRUD application) you would to it like that.

In Controller:

    $this->view->assign('userActionHistoryEntries', $this->userActionHistory->getLastEntries(15, '*->index'));

In Template:

    <ul>
        <f:for each="{userActionHistoryEntries}" as="entry">
            <li>
                <f:link.action controller="History" action="redirectToActionHistoryEntry" package="FormatD.UserActionHistory" arguments="{entryId: entry.id}">
                    {entry.description}
                </f:link.action>
            </li>
        </f:for>
    </ul>

(Don't forget to make the HistoryController accessable in your routes configuration and if necessary in your policy configuration)

统计信息

  • 总下载量: 186
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固