定制 alpineio/atlas 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

alpineio/atlas

Composer 安装命令:

composer require alpineio/atlas

包简介

WordPress custom post type manager

README 文档

README

A Custom Post Type manager for WordPress. Extends Piklist and native WordPress functionality.

Synopsis

Piklist does a great job of adding datastructure to WordPress. About Piklist:

"Piklist is a code-based framework, which means it has no user interface. We believe this is one of the biggest benefits to using Piklist. Code based systems allow you flexibility in your field configurations and development, and will save you time in the long run. With Piklist you can usually use the same code you have written in one section and use it in another, allowing you to copy and paste, and save tons of time."

We agree with the benefits of a code-based, source-controlled application. But, we feel that copy-paste is not a sustainable model for large-scale application development.

Atlas is a layer over the copy/paste configuration model. A convenient, object-oriented layer for adding basic and custom functionality to extended post types using a style similar to Laravel.

As they say about Laravel, it is "an accessible, yet powerful system, providing tools needed for large, robust applications". We envision the same for Atlas in the WordPress ecosystem.

Code Example

Here is an example of an object being defined with a piklist-compatible data dictionary, and behavior inherited from posts.

namespace MyCRM;

use AlpineIO\Atlas\Contracts\SelfRegistration;
use AlpineIO\Atlas\Post;
use AlpineIO\Atlas\Traits\PiklistPostRegistration;
use AlpineIO\Atlas\Types\PostRelationFieldType;

/**
 * Class Contact
 * @package MyCRM
 * @property string $title Job Title
 * @property string $street_address Street Address
 * @property string $city City
 * @property string $state State
 * @property string $website Website URL
 * @property string $facebook Facebook URL
 * @property string $yelp Yelp URL
 */
class Contact extends Post implements SelfRegistration {

	use PiklistPostRegistration;

}

Next, we might use this CPT Contact within a WordPress single template:

  use MyCRM\Contact;

  $contact = new Contact(get_the_ID());

All of our contact attributes and member functionality are available within this object for quick access and display in your WordPress template.

Building the data model with PikList

First, build your administrative interface with PikList:

https://piklist.com/user-guide/tutorials/getting-started-with-piklist/

then, extend it using Atlas.

Motivation

We love the spirit behind the PikList project. Though, we felt that to maintain large scale applications, we would need a more modern object structure. As users of Laravel, we missed the elegance and ease of use and felt we could help.

Installation

With Composer

$ composer require alpineio/atlas
{
    "require": {
        "alpineio/atlas": "~1.0.4"
    }
}
<?php
require 'vendor/autoload.php';
use AlpineIO\Atlas\Services\RegisterWordPressTypes;
use MyCRM\Contact;
use MyCRM\Team;

// Create a filter to return the classes
function my_crm_object_types( $types = [] ) {
	return array_merge( $types, [
		Contact::class,
		Team::class
	] );
}
add_filter('alpineio_atlas_models', 'my_crm_object_types');

RegisterWordPressTypes::register();

Tests

Coming soon.

Contributors

We would welcome additional help on this project. Please feel free to fork and send pull requests.

License

GPL2

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-05-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固