[MODx] 6. Cache '!' with login package
1. Install login package.
2. Create a Template called 'login':
[[!Login?
&loginResourceId=`13` // means after login, redirect resource 13 page, in our case, redirect to self
]]
<h2>Register</h2> [[!Register?
&submitVar=`registerbtn`
&activationResourceId=`12`
&activationEmailTpl=`myActivationEmailTpl`
&activationEmailSubject=`Thanks for Registering!`
&submittedResourceId=`5`
&usergroups=`Marketing,Research`
&validate=`nospam:blank,
username:required:minLength=^6^,
password:required:minLength=^6^,
password_confirm:password_confirm=^password^,
fullname:required,
email:required:email`
&placeholderPrefix=`reg.`
]] <div class="register">
<div class="registerMessage">[[!+reg.error.message]]</div> <form class="form" action="[[~[[*id]]]]" method="post">
<input type="hidden" name="nospam" value="[[!+reg.nospam]]" /> <label for="username">[[%register.username? &namespace=`login` &topic=`register`]]
<span class="error">[[!+reg.error.username]]</span>
</label>
<input type="text" name="username" id="username" value="[[!+reg.username]]" /> <label for="password">[[%register.password]]
<span class="error">[[!+reg.error.password]]</span>
</label>
<input type="password" name="password" id="password" value="[[!+reg.password]]" /> <label for="password_confirm">[[%register.password_confirm]]
<span class="error">[[!+reg.error.password_confirm]]</span>
</label>
<input type="password" name="password_confirm" id="password_confirm" value="[[!+reg.password_confirm]]" /> <label for="fullname">[[%register.fullname]]
<span class="error">[[!+reg.error.fullname]]</span>
</label>
<input type="text" name="fullname" id="fullname" value="[[!+reg.fullname]]" /> <label for="email">[[%register.email]]
<span class="error">[[!+reg.error.email]]</span>
</label>
<input type="text" name="email" id="email" value="[[!+reg.email]]" /> <br class="clear" /> <div class="form-buttons">
<input type="submit" name="registerbtn" value="Register" />
</div>
</form>
</div> [[!Profile]] <p>Username: [[+username]]</p>
<p>Email: [[+email]]</p>
In the bottom, we call the [[!Profile]] snippet without cache. So every time, we logout, the profile will be clear up.
If we call [[Profile]], then everytime, we logout, the username and email are still there.
Caching
In Evolution, Snippets that need to be processed with each request should be on an uncached page or the Snippet itself should be called uncached: [!snippet!]
In Revolution, any tag can be called uncached by inserting an exclamation point immediately after the double-bracket: [[!snippet]], [[!$chunk]], [[!+placeholder]], [[!*template_var]], etc.
[MODx] 6. Cache '!' with login package的更多相关文章
- wine update错误 "the cache has no package" error when wine update is available
网址:https://bugs.launchpad.net/pipelight/+bug/1318321/
- 移动 ProgramData\Package Cache 文件夹
装完vs2017 发现C盘快木有空间了… 瞅瞅C盘下有啥能删的好释放下空间 就找到了 Package Cache 文件夹,占用空间接近15G… 查查这个文件夹还不建议删除… (http://super ...
- Spring Cache抽象详解
缓存简介 缓存,我的理解是:让数据更接近于使用者:工作机制是:先从缓存中读取数据,如果没有再从慢速设备上读取实际数据(数据也会存入缓存):缓存什么:那些经常读取且不经常修改的数据/那些昂贵(CPU/I ...
- 基于Redis的Spring cache 缓存介绍
目录 Cache API及默认提供的实现 demo 依赖包安装 定义实体类.服务类和相关配置文件 Cache注解 启用Cache注解 @CachePut @CacheEvict @Cacheable ...
- 转:Spring Cache抽象详解
缓存简介 缓存,我的理解是:让数据更接近于使用者:工作机制是:先从缓存中读取数据,如果没有再从慢速设备上读取实际数据(数据也会存入缓存):缓存什么:那些经常读取且不经常修改的数据/那些昂贵(CPU/I ...
- guava cache与spring集成
缓存的背景 缓存,在我们日常开发中是必不可少的一种解决性能问题的方法.简单的说,cache 就是为了提升系统性能而开辟的一块内存空间.在cpu进行计算的时候, 首先是读取寄存器,然后内存,再是硬盘.由 ...
- 基于Spring Cache实现二级缓存(Caffeine+Redis)
一.聊聊什么是硬编码使用缓存? 在学习Spring Cache之前,笔者经常会硬编码的方式使用缓存. 我们来举个实际中的例子,为了提升用户信息的查询效率,我们对用户信息使用了缓存,示例代码如下: @A ...
- Debian Customer PPA RFC (by quqi99)
作者:张华 发表于:2016-01-13版权声明:能够随意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明 ( http://blog.csdn.net/quqi99 ) Pre ...
- springboot模板
1.thymeleaf模板 2.Freemarker模板 Thymeleaf模板 首先导入依赖 <dependency> <groupId>org.springframewor ...
随机推荐
- [转载]12款免费与开源的NoSQL数据库介绍
Naresh Kumar是位软件工程师与热情的博主,对于编程与新事物拥有极大的兴趣,非常乐于与其他开发者和程序员分享技术上的研究成果.近日,Naresh撰文谈到了12款知名的免费.开源NoSQL数据库 ...
- Birt时间参数添加My97日历控件
首先,思路: 引用My97.js然后为时间参数的textbox添加onclick事件 1.将My97添加到项目中的webcontent目录下(如图:) 2.添加My97引用 在项目路径下找到该文件\w ...
- linux 读取input输入设备demo
/******************************************************************* * linux 读取input输入设备demo * 说明: * ...
- win8.1 64 安装用友T3+sql2005-64步骤
1. 环境:win8.1 64 专业版 4G内存 .net framwork 3.5 2.初始过程及所需软件 安装sql2008数据库,安装完T3发现并不支持此数据库,运行T3老是出现连接数据时的 ...
- 【Struts】strust.xml中<result type="">所有类型详解
在默认时,<result>标签的type属性值是“dispatcher”(实际上就是转发,forward).开发人员可以根据自己的需要指定不同的类型,如redirect.stream等.如 ...
- Android MVP架构分析
App架构在Android开发者中一直是讨论比较多的一个话题,目前讨论较多的有MVP.MVVM.Clean这三种.google官方对于架构的态度一直是非常开放的,让开发者自主选择组织和架构app的方式 ...
- SharePoint 2010 master page 控件介绍(4):隐藏placeholder
转:http://blog.csdn.net/lgm97/article/details/6409225 <!-- form digest 安全控件用来进行form的安全校验--> &l ...
- [Everyday Mathematics]20150102
设 \[ a_1=3,\quad a_{n+1}=\dfrac{1}{2}(a_n^2+1)\quad(n=1,2,\cdots). \] 试求 \[ \vsm{n}\dfrac{1}{1+a_n}. ...
- SQL注入攻击的种类和防范手段
观察近来的一些安全事件及其后果,安全专家们已经得到一个结论,这些威胁主要是通过SQL注入造成的.虽然前面有许多文章讨论了SQL注入,但今天所讨论的内容也许可帮助你检查自己的服务器,并采取相应防范措施. ...
- HDU 1698 Just a Hook 区间更新 lazy标记
lazy标记 #include <iostream> #include <cstdio> #include <cstring> #include <sstre ...