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的更多相关文章

  1. wine update错误 "the cache has no package" error when wine update is available

    网址:https://bugs.launchpad.net/pipelight/+bug/1318321/

  2. 移动 ProgramData\Package Cache 文件夹

    装完vs2017 发现C盘快木有空间了… 瞅瞅C盘下有啥能删的好释放下空间 就找到了 Package Cache 文件夹,占用空间接近15G… 查查这个文件夹还不建议删除… (http://super ...

  3. Spring Cache抽象详解

    缓存简介 缓存,我的理解是:让数据更接近于使用者:工作机制是:先从缓存中读取数据,如果没有再从慢速设备上读取实际数据(数据也会存入缓存):缓存什么:那些经常读取且不经常修改的数据/那些昂贵(CPU/I ...

  4. 基于Redis的Spring cache 缓存介绍

    目录 Cache API及默认提供的实现 demo 依赖包安装 定义实体类.服务类和相关配置文件 Cache注解 启用Cache注解 @CachePut @CacheEvict @Cacheable ...

  5. 转:Spring Cache抽象详解

    缓存简介 缓存,我的理解是:让数据更接近于使用者:工作机制是:先从缓存中读取数据,如果没有再从慢速设备上读取实际数据(数据也会存入缓存):缓存什么:那些经常读取且不经常修改的数据/那些昂贵(CPU/I ...

  6. guava cache与spring集成

    缓存的背景 缓存,在我们日常开发中是必不可少的一种解决性能问题的方法.简单的说,cache 就是为了提升系统性能而开辟的一块内存空间.在cpu进行计算的时候, 首先是读取寄存器,然后内存,再是硬盘.由 ...

  7. 基于Spring Cache实现二级缓存(Caffeine+Redis)

    一.聊聊什么是硬编码使用缓存? 在学习Spring Cache之前,笔者经常会硬编码的方式使用缓存. 我们来举个实际中的例子,为了提升用户信息的查询效率,我们对用户信息使用了缓存,示例代码如下: @A ...

  8. Debian Customer PPA RFC (by quqi99)

    作者:张华  发表于:2016-01-13版权声明:能够随意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明 ( http://blog.csdn.net/quqi99 ) Pre ...

  9. springboot模板

    1.thymeleaf模板 2.Freemarker模板 Thymeleaf模板 首先导入依赖 <dependency> <groupId>org.springframewor ...

随机推荐

  1. foreach中引用 的问题

    在工作中遇到 关于 php foreach 引用的一个问题 简单来说,如下代码 $arr=array('a','b','c' ,'d'); foreach($arr as $k=>&$v ...

  2. bzoj4008

    好题,这题可以分开算每个技能的贡献 orz popoqqq http://blog.csdn.net/popoqqq/article/details/45365759 ..,..] of double ...

  3. Shell Script Tutorials (0 ~ 62)

    Tutorial-1: Introduction Tutorial-2: Shell, Kernel, Terminal & More Tutorial-3: View System Date ...

  4. Linux power supply class hacking

    /*************************************************************************** * Linux power supply cl ...

  5. 用TIMESTAMP类型取代INT和DATETIME

    时间在我们开发中应用非常普遍,大部分开发中我们将用Mysql的datetime格式来存储,但是对于经常用时间来排序或者查询的应用中,我们要将时间做成索引,这个就跟查询效率很有关系,但是很多程序员会用i ...

  6. 装饰器模式(Decorator)

    转自http://blog.csdn.net/hust_is_lcd/article/details/7884320 1.认识装饰器模式 装饰模式能够实现动态的为对象添加功能,是从一个对象外部来给对象 ...

  7. js变量作用域

    for(var i =0;i<100;i++) { } alert(i);//100 if(true){ var i="91d"; } alert(i);//91d func ...

  8. c#中单元测试

    从走进.net后发现每天有写不完的代码,有做不完的测试...人感觉都已经机械,我们需要认清自己调整好心态,问下自己是否真的喜欢编程.我的答案当然也就是我爱编码,编码给我带来了许多欢乐,每天都给我体验小 ...

  9. C# 中的枚举类型 enum (属于值类型)

    原文 C# 中的枚举类型 enum (属于值类型) C# 支持两种特殊的值类型:枚举和结构. 声明枚举:声明时要声明所有可能的值. using System; using System.Collect ...

  10. 4.1Reduction模型

    1. Reduction Reduction是一种广泛使用的计算模型,特别是在并行计算领域.简单地来说,Reduction就是一系列的划分(Partition)和汇总(Summarize)操作的集合: ...