Think in Drupal 上册 问世了
Think in Drupal 上册 问世了,
最新的Drupal7开发资料,起了个名字,叫做think in Drupal,模仿think in Java,后来查了一下,人家叫做thinking in Java.
想了想,还是叫做think in drupal 吧。
think in drupal 不是pro drupal development 3的翻译,虽然看完以后,感觉有点像,但是里面的模块代码完全不同。
下册正在写作中。
Think in Drupal 上册 问世了,
最新的Drupal7开发资料,起了个名字,叫做think in Drupal,模仿think in Java,后来查了一下,人家叫做thinking in Java.
想了想,还是叫做think in drupal 吧。
think in drupal 不是pro drupal development 3的翻译,虽然看完以后,感觉有点像,但是里面的模块代码完全不同。
下册正在写作中。
info文件:
name = Block More Link
description = Provide a more link for all blocks.
package = Other
version = VERSION
core = 7.x
configure = admin/config/block/morelink
install文件:
<?php
/**
* @file
* Install, update and uninstall functions for the block_morelink module.
*/
<?php
/**
* @file
* isbn validation
*/
Drupal info文件:
name = ISBN Validation
description = "Add ISBN validation to text field"
core = 7.x
dependencies[] = field
dependencies[] = field_ui
module文件:
/**
* “确认”页面的回调函数
*/
function contactus_confirm_page(){
//我们为这个页面设置标题
drupal_set_title('联系我们');
//这里首先作了判断,如果会话中没有设置contactus_form,返回contactus
if(empty($_SESSION['contactus_form'])){
drupal_goto('contactus');
}else{
}
<?php
/**
* @file
* 各种页面的回调函数.
*/
/**
* “联系我们”页面的回调函数
*/
function contactus_page(){
//我们为这个页面设置标题
drupal_set_title('联系我们');
$render_array = array(
'#markup' => '',
);
//该页面的正文为一个表单,注意对于表单,这里需要使用drupal_render呈现一下。
$render_array['#markup'] .= drupal_render(drupal_get_form('contactus_form'));
//Drupal7的页面回调,返回的应该是一个数组
return $render_array;
}
<?php
/**
* @file
* 方便用户联系我们.
*/
在我们国内,政府的“官网”屡屡被黑,司空见惯,见怪不怪。何故也?
使用views获取结果集的总数,有时候我们使用views给出了一个列表,但是我们还想直接获取列表中记录的个数,这个时候我们可以在views的header或者footer里面显示。