[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 ...
随机推荐
- 理解$watch ,$apply 和 $digest --- 理解数据绑定过程
原文地址:http://angular-tips.com/blog/2013/08/watch-how-the-apply-runs-a-digest/ 注 这篇博文主要是写给新手的,是给那些刚刚开始 ...
- toastr
$(function(){ //参数设置,若用默认值可以省略以下面代 toastr.options = { "closeButton": false ...
- DELL R710服务器可以安装的VMWare ESX Server 4.1 全套下载带注册码
随着R710的停产,R720随之面世,但DELL R720服务器只支持vmware esxi5.0以上,DELL客户经理给了一套系统安装后序列号无法解决,还是用4.1好了,却又发现怎么都无法安装.按网 ...
- 解决:Eclipse导入工程后全是错误,连基本类型都不识别
当初在大学没时间完成作业时,总是喜欢网上搜一个或者拷贝同学的一个工程过来,导入到Eclipse中却全是红叉,连基本类型都不识别. 当时就纳闷了,难道是天要亡我之心不死?后来慢慢了解了,其实是导入的工程 ...
- JDK1.5新特性(六)……Generics
概述 Generics - This long-awaited enhancement to the type system allows a type or method to operate on ...
- 1351 topcoder 吃点心
https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1351 先按low从大到小贪心再high从小到大贪心 #pragma c ...
- uvalive 4973 Ardenia
题意:给出空间两条线段,求距离. 注意输出格式! #include<cstdio> #include<cmath> #include<algorithm> usin ...
- MVC5中使用KinEditor
参考:http://www.cnblogs.com/weicong/archive/2012/03/31/2427608.html 第一步 将 KindEditor 的源文件添加到项目中,建议放到 / ...
- JSFのAjaxタグのoneventでbegin/complete/successを使う
PrimeFacesに慣れてしまって.通常のHTMLタグでの記述方法がわからなかったりする点があった…ので.メモ. Ajaxでリクエスト送信のタイミングやレスポンスが戻るタイミングに何らか(JavaS ...
- 题解西电OJ (Problem 1003 -最喜欢的数字)--动态规划
Description zyf最喜欢的数字是1!所以他经常会使用一些手段,把一些非1的数字变 成1,并为此得意不已.他会且仅会的两种手段是: 1.把某个数m除以某个质数p——当然p必须能整除这个数,即 ...