原文地址: https://www.drupal.org/node/2143497
原文版本: November 25, 2013.
(原文未成)
* Final name not yet defined, see #1976158: Rename entity storage/list/form/render "controllers" to handlers
While entities represent a piece of data, controllers are responsible for acting on and with them. The basic concept was introduced in Drupal 7, where the controller provided the API to load entities. That class was then extended in the entity.module to provide full CRUD support and other types of controllers were created.
原文地址: https://www.drupal.org/node/2143503
原文版本: June 26, 2014.
(原文未成)
(Stub)
Content entities examples
- node
- comment
- user
- 阅读更多 关于 内容型实体 (翻译中)
- 登录或注册以发表评论
原文地址: https://www.drupal.org/node/2143501
原文版本: May 9, 2014.
Configuration entities using the new entity API in Drupal 8 in order to keep configuration into the DB. The difference between the config entities to content entites:
- Configurable entity can be exported using the new CMI system.
- Configurable entity don't have field due to the way they stored in the DB
- Configurable entity defined a schema file unlike content entities which defined by hook_schema()
- 阅读更多 关于 配置型实体 (翻译中)
- 登录或注册以发表评论
原文地址: https://www.drupal.org/node/2143499
原文未成
- 阅读更多 关于 梱束 (翻译中)
- 登录或注册以发表评论
原文地址: https://www.drupal.org/node/2124403
原文版本: May 28, 2014.
This covers the generic entity API, configuration entity and content entity specific API's will be covered in specific chapters. TODO: Link once created.
Check
原文链接:https://www.drupal.org/node/2203931
依赖于Drupal服务或者自定义服务的表单应该通过依赖注入来访问该服务。
如一个表单(与Form API in Drupal 8 中的类似)使用'current_user'服务来获取当前用户的uid。假设模块名的modules/example,那么文件 /modules/example/lib/Drupal/example/Form/ExampleForm.php 内容:
- 阅读更多 关于 在表单上应用依赖注入
- 登录或注册以发表评论
原文地址:https://www.drupal.org/node/2026959
服务容器具有多个优点,因为每个服务都可以通过一个字符串键来访问/实例化,并且拥有一个已定义的接口,它可以用其他实现来替换。如果需要修改一个已有的服务,只需要实现一个ServiceProviderBase的子类并且编写alter()方法。
如:在my_module中定义my_module/src/MyModuleServiceProvider.php
2014年9月20日,成都Drupal聚会如期在成都理工大学9B102举行。此次参与Drupal交流的一共有6个人。现场气氛活跃但不混乱,正好适合Drupal开发技术交流学习。
首先,Drupal猎人详细讲述了Drupal services开发实战,并以一个工作中实际的应用,开发了APP版本更新的一个接口,并使用POSTER进行了测试,实现了预期Drupal开发Service 接口的效果,老李等从性能等方便提出了咨询,这些将根据项目使用到实际生产环境后的效果,再和Drupalers 分享。
Matt分享了很多使用Drupal开发的很酷的效果,比如使用Drupal开发的学生报名注册中图片采集效果让在场的每一个Drupaler纷纷称赞,Matt对实现的方式进行讲解。本人亦收获颇丰。
长风讲解了Form API的基础以及Drupal开发两个的案例:一个是酒店预订中,Drupal表单实现自动完成并进行自动填充的效果,另外一个是一个ajax的验证,长风展示了所有源代码。本意是希望通过展示简单的代码,实现相对其他框架或技术不易实现的功能,表现出Drupal简单、易用、功能强大的冰山一角,吸引更多人对Drupal产生兴趣。