注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

phperwuhan的博客

记载一个phper的历程!phperwuhan.blog.163.com

 
 
 

日志

 
 

woltlab study note  

2013-06-15 15:28:24|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

http://www.woltlab.com 

Comes from wcfdoc pdf document.

 

escapeString
string escapeString (string $string)
escapeString() is a wrapper for the PHP-function mysql_real_escape_string() and
has to be used for the masking of special characters on strings if these are going to be
used in an SQL-query.
Note: Instead of the call WCF WCF::getDB()->escapeString($string), you can also
type escapeString($string).

 

The template system of the WoltLab Community Framework in syntax and operation
mode is geared to Smarty, the compiling template system, but without reaching its
massive functional range.
The template system reads the template les ( le ending .tpl) and converts them
directly into PHP-scripts. This means templates only need to be parsed after being
changed. For the following requests, the generated PHP-script is simply executed.

@ and #
When putting out variables, HTML special characters are masked automatically by the
template system. If this is not desired in certain cases, this can be disabled with the
@-sign: {@$variable}.
Warning: Do not use @ unless you would like the HTML special characters to be
displayed as such.

For the output of numerical values, the pound key # is very useful. The pound key
effects the automatical formatting of the numbers, i.e. decimal numbers are rounded to
two decimal places and separated by the decimal divider depending on the language. If
applicable, a divider for the thousands is inserted: {#$number}
Programm 6.1 Access of variables within the templates
{$variable}
{@$variable}
{#$variable}
{CONST}
{$array.0} (for $array[0])
{$array.key} (for $array['key '])
{$array.$key} (for $array[$key])
{$object ->var}
{$object ->method($foo)}
{WCF::getUser()->userID}

6.2.6. display
void display (string $templateName, [boolean $sendHeaders = true])
To display a template send the output to the client, the display()-method is used.
The method wants the name of the template. The second (boolean) argument $send-Headers is optional and determines if the HTTP HEADERs of the site are to be sent.
The display()-method automatically takes care of the compiling of the template.
When the sending of the HTTP HEADERs is activated, the events shouldDisplay and
didDisplay are also triggered before and after the output of the template.

6.2.7. fetch
string fetch (string $templateName)
If you wish to display a template without immediately sending the output to the client,
e.g. continue processing it instead, use the fetch()-method to return the output of the
template.
The method expects the name of the template as argument.

 

11.1. RequestHandler
The RequestHandler can be used via its static method handle(). This excepts as
the only parameter an array with path designations to the directories of the respec-tive libraries. In this case, this means the lib-directory of the WCF and of the re-spective standalone application. When executing the method, the system checks the
HTTP-request for POST- or GET-variables and opens or processes the corresponding
site respectively.
There are three di erent types of sites:
Page Simple sites in the WCF that are needed for the dump of information.
Form Special blank sites, into which data can be entried and processed.
Action For the execution of actions, without the display of a resulting information- or
blank site.

 

12.3. Di erent package types
The package system di erentiates between three types of packages.
Package The standard type. Files of these packages are installed into the WCF-directory. A package normally provides program libraries that can then be uses by
standalone applications.
Standalone Application A standalone application is an independent appliaction based
on the WCF. During the installation, the user needs to de ne a separate installation
folder.
Plug-in A plugin is a package that is tied to an existing package and delivers additional
functions or extensions for this packages. For the creation of the plugin it is
sucient to specify the name of the related package through the <plugin> tag in
the package.xml. Compare table 12.1 on page 63.

 


 

  评论这张
 
阅读(360)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017