Monthly Archives: 2013年4月

Zend Framework教程-应用的目录结构

← Continue Reading
root@coder-671T-M:/mydev_src/zend_framework_learn/www/zf_demo2# tree . ├── application应用主目录 │ ├── Bootstrap.php │ ├── configs配置文件存放目录 │ │ └── application.ini应用默认配置文件 │ ├── controllers控制器 │ │ ├── Error...

五种常见的 PHP 设计模式

← Continue Reading
设计模式 一书将设计模式引入软件社区,该书的作者是 Erich Gamma、Richard Helm、Ralph Johnson 和 John Vlissides Design(俗称 “四人帮”)。所介绍的设计模式背后的核心概念非常简单。经过多年的软件开发实践,Gamma 等人发现了某些具有固定设计的模式,就像建筑师设计房子和建筑物一样,可以为浴室的位置或厨房的构造方式开发模板。使用这些模板或者说...

Drupal7 trigger与action

← Continue Reading
trigger: 触发器   1. 声明部分 hook_trigger_info 2. 触发部分 any function 在需要使用trigger的位置调用此函数 function内部调用以下函数来激活action actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a2 = NULL) act...

Drupal7自定义模块的URL生成

← Continue Reading
/** * Implements hook_taxonomy_term_insert */ function example_taxonomy_term_insert($term) { example_taxonomy_term_update($term); } /** * Implements hook_taxonomy_term_update */ function example_taxon...

Drupal7 常用的数据读写API

← Continue Reading
// node load & change node_load($nid = NULL, $vid = NULL, $reset = FALSE); node_load_multiple($nids =array(), $conditions = array(), $reset = FALSE); $node = node_load($nid); $node->title = 'xx...