workingconcept/craft-lever 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

workingconcept/craft-lever

最新稳定版本:2.0.0

Composer 安装命令:

composer require workingconcept/craft-lever

包简介

Lever + Craft CMS.

README 文档

README

Lever

Lever Craft CMS 4 Plugin

Get Lever job details and post applications directly from Craft.

Scrutinizer status

Installation & Setup

  • composer require workingconcept/craft-lever
  • php craft install lever or install from SettingsPlugins in the control panel
  • add your site and API details in the control panel via SettingsLever

Development

Templating

craft.lever.jobs([])

Returns an array of jobs. Supply valid parameters for the job postings API if you need to tailor the results.

craft.lever.job(id)

Returns a specific job matching the provided Lever ID, or false.

Job Properties

  • id
  • text
  • categories
  • country
  • description
  • descriptionPlain
  • lists
  • additional
  • additionalPlain
  • hostedUrl
  • applyUrl
  • createdAt
  • workplaceType

Template Examples

List Jobs

{% set positions = craft.lever.jobs %}

<h2>Work with Us!</h2>

<ul>
{% for position in positions %}
    <li><a href="{{ position.hostedUrl }}" target="_blank">{{ position.text }}</a></li>
{% endfor %}
</ul>

Custom Job Application Form

You can create your own form and validation and submit it with an action field set to lever/apply. Use any fields named exactly as seen in the postings API, with jobId, name, and email being required.

<h3>Apply</h3>

{% if application is defined and application.getErrors() | length %}
    {% for field in application.getErrors() %}
        {% for error in field %}
            <p class="error" role="alert">{{ error }}</p>
        {% endfor %}
    {% endfor %}
{% endif %}

<form id="job" action="" method="post" accept-charset="UTF-8" enctype="multipart/form-data">
    {{ csrfInput() }}
    {{ redirectInput(craft.app.request.absoluteUrl ~ "?success=y") }}
    <input type="hidden" name="action" value="lever/apply">
    <input type="hidden" name="jobId" value="{{ job.id }}">

    <input type="text" name="name" value="{{ application.name ?? '' }}" required>
    <input type="email" name="email" value="{{ application.email ?? '' }}" required>
    <textarea name="comments">{{ application.comments ?? '' }}</textarea>

    <input type="file" name="resume" required>

    <button class="btn">Submit</button>
</form>

Establishing Custom Job Detail Pages

You can display all job details on your site if you'd like, including custom detail pages. One way you might go about that is to create a detail page template like jobs/_detail.twig and set up a custom route for it.

Barebones template:

{% extends "_layout" %}

{% set job = craft.lever.job(id) %}

{% if job is empty %}
    {% exit 404 %}
{% endif %}

{% block content %}

...

Custom route in config/routes.php:

return [
    'jobs/<id>' => ['template' => 'jobs/_detail'],
];

This will take requests like https://site.foo/jobs/be9f3647-b59a-4272-94a0-8b937520a69f and send them to your template, where they'll 404 if the ID is invalid.

Events

EVENT_BEFORE_VALIDATE_APPLICATION

Triggered after an application is submitted and before it's validated. You can adjust $event->application if you need to do something custom like handle a FilePond upload and attach it to the LeverJobApplication model.

EVENT_BEFORE_SEND_APPLICATION

Triggered after an application is submitted and before it's sent to Lever. Grab the application data from $event->application and prevent it from being sent by setting $event->isSpam to true.

EVENT_AFTER_SEND_APPLICATION

Triggered immediately after an application is sent to Lever successfully. Same $event->application and $event->isSpam properties available.

Support

Please submit an issue or a pull request if anything needs attention. We'll do our best to respond promptly.

This plugin is brought to you by Working Concept, which has no affiliation with Lever.

workingconcept/craft-lever 适用场景与选型建议

workingconcept/craft-lever 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 337 次下载、GitHub Stars 达 3, 最近一次更新时间为 2018 年 12 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 workingconcept/craft-lever 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

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