⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 03-page.sgml

📁 PHPLOB注释详细版 使用模板技术的好帮手 PHP最有用的东东了
💻 SGML
字号:
<!-- $Id: 03-page.sgml,v 1.1.1.1 2000/04/17 16:40:01 kk Exp $ --><sect1>Page Management<p><sect2>Accessible Functions<p>Page Management currently consists a collection of functions:<descrip><tag>page&lowbar;open(array("feature" => "classname"))</tag>This function is to be called with an array of pagefeatures/classname pairs. Valid features are at the moment:<descrip><tag>sess</tag><p>This page makes use of session variables.<tag>auth</tag><p>This page uses session authentication. If youspecify the <tt/auth/ feature, you MUST specifythe <tt/sess/ feature, also.<tag>perm</tag><p>This page is protected by permissions and onlyaccessible to authenticated users with matching rights.If you specify the <tt/perm/ feature, you MUST specifythe <tt/auth/ and <tt/sess/ features, also.<tag>user</tag><p>This page makes use of user variables. If you specifythe <tt/user/ feature, you MUST specify the <tt/auth/ and<tt/sess/ features, also.</descrip>Each feature specifies the name of the class that implements that feature,for example<code>  page&lowbar;open(array("sess" =&gt; "Shop&lowbar;Session"));</code>The function creates an instance of <tt/Shop&lowbar;Session/ as<tt/$sess/ and initializes it. It also checks featuredependencies. Note that you are expected to provide animplementation of the class <tt/Shop&lowbar;Session/. This isusually done in <tt/local.inc/ and usually you do so byextending the provided <tt/Session/ class.Examples on how to do this is given in the documentation belowwhen the classes are introduced.<tag>page&lowbar;close()</tag><p>At the end of your page (after all results have been calculated)you have to call <tt/page&lowbar;close()/. This will save allpage state, session and user variables into database. Changes tosession or user variables after <tt/page&lowbar;close()/ hasbeen called are not recorded. Currently it is allowed to call<tt/page&lowbar;close()/ multiple times on a single page (notguaranteed for future versions!). Each time session state will besaved.<em/Note:/ This is going to change. When we introduce recordlocking, it is important that you call <tt/page&lowbar;close()/ onlyonce per page, because that will implicitly unlock your sessionrecord. Also, it is important that you call <tt/page&lowbar;close()/ asearly as possible on a page so that the locking time is keptminimal.<tag>sess&lowbar;load(array("var" => "classname")</tag><p> <em/Advanced feature/. Some applications have need to manuallyload data belonging to one or multiple session classes. @@TODO<tag>sess&lowbar;save(array("var" => "classname"))</tag><em/Advanced feature/. @@TODO</descrip><sect2>Example<p><tscreen><code>&lt;?php  page&lowbar;open(array("sess" =&gt; "Shop&lowbar;Session"));  $sess-&gt;register("s");  // See "Session" below for explanation. ?&gt;&lt;html&gt;&lt;h1&gt;&lt;?php print ++$s ?&gt;&lt;/h1&gt;&lt;/html&gt;&lt;?php page&lowbar;close(); ?&gt;</code></tscreen><sect2>The "cart" feature is gone<p> There used to be a feature "cart" for <tt/page&lowbar;open()/ inversions of PHPLIB up to release-5. The cart has been removedfrom the core functionality of PHPLIB to keep the library small,maintainable and structured. Consequently the "cart" feature isgone.The <tt/Cart/ class is still present and exists as an extendedfeature. You have to include and instantiate your cart manuallyon that pages that use it, though. See the <tt/Cart/ class formore information.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -