承接 nyco/anyc-field-screener 相关项目开发

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

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

nyco/anyc-field-screener

Composer 安装命令:

composer require nyco/anyc-field-screener

包简介

The ACCESS NYC Field Screener is a tablet optimized version of the ACCESS NYC benefits eligibility screener created for outreach caseworkers.

README 文档

README

The ACCESS NYC Field Screener is a tablet optimized version of the ACCESS NYC benefits eligibility screener created for outreach caseworkers. It is designed to be filled out for clients in-person or remotely during outreach sessions. The original source code can be found in v3.12.0 of the ACCESS NYC code repository. It has been extracted, modified, and packaged into this plugin.

This code, similar to the original eligibility screener, relies on the program content and benefits screening API proxy inside the ACCESS NYC website in order to provide screening results to the client and caseworker.

More about the Field Screener case study can be read about here.

Installation using Composer

$1 This package uses Composer Installers to install the package in the Must Use plugins directory (/wp-content/mu-plugins):

composer require nyco/anyc-field-screener

Autoload Backend

Copy the autoloader sample from the plugin directory into the must use plugin directory.

cp wp-content/mu-plugins/anyc-field-screener/autoloader-sample.php wp-content/mu-plugins/field-screener.php

Or, manually create a page template in the theme directory with the following snippet.

📄 /wp-content/mu-plugins/field-screener.php

Contents.

<?php

/**
 * Plugin Name: NYCO ACCESS NYC Field Screener
 * Description: Autoloads the backend of the Field Screener application.
 * Author: NYC Opportunity
 */

$dir = WPMU_PLUGIN_DIR . '/anyc-field-screener';

if (file_exists($dir)) {
  include_once $dir . '/Auth.php';
  include_once $dir . '/Util.php';
  require_once $dir . '/Backend.php';

  new FieldScreener\Backend();
}

Create Routes

Copy the template sample from the plugin directory into the theme directory.

cp wp-content/mu-plugins/anyc-field-screener/template-sample.php wp-content/themes/access/field-screener.php

Or, manually create a page template in the theme directory with the following snippet.

📄 /wp-content/themes/access/field-screener.php

Contents.

<?php

/**
 * Template name: Field Screener
 */

$dir = WPMU_PLUGIN_DIR . '/anyc-field-screener';

if (file_exists($dir)) {
  require_once $dir . '/Views.php';

  new FieldScreener\Views();

  $post = Timber::get_post();

  echo do_shortcode($post->post_content);
}

Optional. A single template will suffice but there are two view routes for the application. The first is a root view and the second is a nested result view. It is possible to use WordPress's page template slug system to create two templates

📄 page-field-screener.php
📄 page-results.php

Add Pages

Add a new page and title it "Field Screener". Then, select the "Field Screener" as a page template and add a shortcode to the post content.

[anyc-field-screener]

This will render the application's root view at the route /field-screener. Publish the page, then create another page for the results route. It can be titled "Results - Field Screener" but the page slug needs to be results. Select the "Field Screener" as a page template and add a shortcode to the post content.

[anyc-field-screener page="results"]

The page="results" attribute designates the view as the results page. This will render the application's results view at the route /field-screener/results.

Publish the results page. The application will be viewable at /field-screener.

Shortcode Attributes

In addition to page. There are other shortcode attributes that can be set to customize the location and environment of the application.

Attribute Default Value Description
env See below The human readable environment string used in the environment alert to inform users which environment they are viewing.
productionUrl https://access.nyc.gov/eligibility/ This is the application link the environment alert will link users to when the environment's WP_ENV is not set to the production value, accessnyc.
assets /wp-content/mu-plugins/field-screener/assets The path to the application's static assets.
root /field-screener/ The root slug of the application. This should match the WordPress page slug.
results /field-screener/results/ The root slug and results slug for the application. This determines the redirect path from the main screening application to the results page. If the root is changed, this will need to be changed as well. This should match the WordPress page slug.
resultsShare /eligibility/results/ The root slug and results slug for the results page that is shared with users when they text or email results to themselves. This path replaces the results path defined above.
translationID field-screener The string translation template location ID. This is used to scope translations for the application.
page screener Can be set to results to designate the results route.

Environment string defaults

The env string is determined by the WP_ENV constant value. This constant is set in the various environments of the ACCESS NYC site. If the constant isn't defined the string will default to "Unknown."

WP_ENV Value String
accessnyc "Production"
accessnycs "Staging"
accessnycdemo "Demo"
accessnyctest "Testing"
development "Development"

Debugging

Add the ?debug=1 query parameter to the URL to see application logs. This will display data values set to the household model, form validation warnings, and the screening API request object and responses. Set "Preserve Log" to true to retain the response from the application to the results page.

The network panel will also reveal the API request and response information.

The Mayor's Office for Economic Opportunity Civic Tech

The Mayor's Office for Economic Opportunity (NYC Opportunity) is committed to sharing open source software that we use in our products. Feel free to ask questions and share feedback. Interested in contributing? See our open positions on buildwithnyc.github.io. Follow our team on Github (if you are part of the @cityofnewyork organization) or browse our work on Github.

nyco/anyc-field-screener 适用场景与选型建议

nyco/anyc-field-screener 是一款 基于 Twig 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 03 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「wordpress」 「eligibility」 「field-screener」 「screener」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 nyco/anyc-field-screener 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 nyco/anyc-field-screener 我们能提供哪些服务?
定制开发 / 二次开发

基于 nyco/anyc-field-screener 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 12
  • Forks: 0
  • 开发语言: Twig

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2022-03-07