承接 samsonos/cms_input 相关项目开发

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

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

samsonos/cms_input

最新稳定版本:0.0.1

Composer 安装命令:

composer require samsonos/cms_input

包简介

SamsonCMS generic input field module

README 文档

README

#SamsonCMS input module

This is base module for all cms input modules.

Usage

There are two main static functions, this module have:

  • create()
  • createFromMetadata()

Function create($dbObject, $type, $param = null, $className = CLASS) This function create and retrieves SamsonCMS input instance based on given parameters. As you can see first two are required, these are \samson\activerecord\dbRecord instance or it's ancestor and SamsonCMS input field type, this parameter should be int. Here is this list:

Field name Field identifier
Text 0
Resource 1
Date 2
Select 3
Table (deprecated) 4
Material 5
Number 6
WYSIWYG 7
Gallery (separate module) 8

The other parameters are not necessary. For example if you will not pass the $param to this function the ancestor class field will be used, and if it's not defined this class field will be used. The last parameter is for double or more nested classes. This functionality is not implemented yet.

Second function createFromMetadata($entity, $param, $identifier, $className = CLASS) is very similar to create() function except for first and third parameters, they are used to get \samson\activerecord\dbRecord instance.

Here are some examples how this functions can be used:

$input = Field::create($material, 7, 'remains');
...
$input = Field::createFromMetadata($_GET['e'], $_GET['f'], $_GET['i']);

Other methods

There are also value(), save($value) and convert($value) functions. The first one returns SamsonCMS module value field. Function convert() does nothing but can be overridden to convert value before save. Function save() inserts value in \samson\activerecord\dbRecord object field and writes this object to database.

Be care not to be confused with __save() controller.

As this class is module it has __save() controller which can be called, for example, by URL '...samson_cms_input/save'. As you know each SamsonCMS module has it's id and 'samson_cms_input' can be replaced by it to perform ancestor controller.

This class implements \samson\core\iModuleViewable interface and should implement toView() function. Default there is default implementation in this module but it can be overridden in ancestor classes.

SamsonCMS official web-site

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Open
  • 更新时间: 2014-10-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固