Skip to main content

understand drupal 8 service

Service: A class instance that is easily accessible and reusable by the system.


d8 中常见的一种使用情形:




        class: \Drupal\my_module\MyService



namespace Drupal\my_module;

Introduction to Drupal 8 Theme Development

一个不错的 d8 主题开发入门,内容提要:

  • Anatomy of theme file system
  • Creating your first theme
  • Twig templates, and where to find them
  • Twig syntax
  • Working with template suggestions
  • Modifying content with hook_preprocess()
  • Render arrays
  • Custom templates with hook_theme()

via daggerhart

“试用期” 用英语怎么说


请看China daily相关报道:A popular local newspaper claimed that the US fast-food giants are violating China's labor laws by under-paying part-time workers by up to 40 per cent in their local chains.

"The fast-food chains have also asked the part-timers to work longer than the maximum five hours a day, deliberately refused to sign labor contracts or insure them against workplace injuries, and prolonged their probationary periods."

“精装本” 用英语怎么说


请看外电相关报道:"Harry Potter and the Deathly Hallows," the last of seven installments of the boy wizard's adventures, will be published July 21.

Bloomsbury, her British publisher, said it would publish a children's hardback edition, an adult hardback, a special gift edition and an audio book on the same day.

报道中的“hardback edition”就是“精装版”。



A record number of men reported being sexually harassed in the workplace last year, according to the US Equal Employment Opportunity Commission (EEOC). Newly released data from the EEOC showed that 15.4 percent of the 12,025 charges of sexual harassment in fiscal year 2006 were filed by men, as opposed to 11.6 percent a decade earlier.

Debian 9 / Debian 8 使用源安装 LEMP 教程 zt

Debian 9 代号 Stretch 在 2017 年 6 月 18 号正式发布,由于是最新的系统,原来基于 Dotdeb 安装最新 LEMP 的教程已经过时,本文将介绍使用官方源和第三方源在 Debian 9.x Stretch 安装最新版 LEMP 的教程,并且可以自行选择 PHP 版本。

PS:本文同时适用于 Debian 8.x Jessie 如果您的服务商暂未提供 Debian 9.x 也可以凑合一用

以下操作推荐在 root 用户下完成,请使用 sudo -i 切换到 root 用户进行操作

“海选” 用英语怎么说


看外电一段有关“快乐男声”的相关报道:The wildly popular Chinese version of the "American Idol" song contest has secured approval for a 2007 season, state media reported Wednesday.

Producers this year plan to whittle down the number of contestants -- more than 100,000 entered last year -- with an Internet audition system aimed also at preventing a crush of applicants from besieging production sites.

“潜规则” 用英语怎么说


The aspiring actress Zhang Yu decided to choose the Internet to blow the whistle on some of China's top TV and filmmakers -- those who have demanded sex in return for roles in their soap operas and movies.



Troubled pop star Britney Spears has reportedly fallen for a rock musician while she is in a rehabilitation facility, according to press reports.

The 25-year-old has started dating the guitar Filyaw she met while attending Alcoholics Anonymous (AA) meetings and reportedly plans to move in with him once she's finished her stint in rehab.

报道说,问题流行小天后布兰妮近日被传在“戒酒聚会”上又觅新欢。有小报指出,她现在已经和刚结识的吉他手Jason Filyaw约会,甚至打算离开戒疗所后就和Jason Filyaw同居。