承接 dkplus/base 相关项目开发

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

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

dkplus/base

最新稳定版本:0.2.0

Composer 安装命令:

composer require dkplus/base

包简介

Utility for other zf2-modules

关键字:

README 文档

README

Utility for other zf2 modules

ControllerPlugins

NotFoundForward

When a user looks for an item that is not in your database you might want to show him not the default 404 not found page but a specific page. The NotFoundForward-Plugin might help you in this case because it extends the original Forward-Plugin by 2 points. First it sets a 404 status code, so you don't need to bother about this, since if a 404 status code appears the RouteNotFoundStrategy it will be triggered, the plugin also sets the template of the RouteNotFoundStrategy to the one of your viewModel so your template will be rendered anyway. Furthermore it can help you when need a MatchedRouteName inside your view, e.g. when you use a paginator. You can give the MatchedRouteName as third parameter to the plugin and it will put it into the RouteMatch.

One example:

class MyController
{
    // […]

    public function editAction()
    {
        $entity = $this->service->find($this->params()->fromRoute('id'));
        if (!$entity) {
            return $this->notFoundForward('MyController', array('action' => 'index'), 'my-route');
        }

        // […]

    }
}

ViewHelpers

FlashMessenger

The FlashMessenger-ViewHelper provides reading-access to the FlashMessenger-Controller-Plugin.

Some examples:

Displaying every messages that has been set within the current request and belongs to the 404-not-found namespace:

foreach ($this->flashMessenger('404-not-found')->getCurrentMessages() as $message) {
    print $this->escapeHtml($message) . '<br>';
}

Displaying every messages that belongs to the error namespace:

foreach ($this->flashMessenger('error')->getMessages() as $message) {
    print $this->escapeHtml($message) . '<br>';
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-09-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固