落叶
- 落叶 回复了话题 真心奉献PHP基础总结帖
为什么我不可以啊
- 落叶 评论了教程 如何在你的程序骨架中添加类似时钟的部件
第一次上传,格式不是弄的太好
- 落叶 发布了扩展fancybox-jQuery弹出层
- 落叶 回复了话题 yii的一些小的技巧
不错,先顶一个
YII 官网上就这样用的啊
这个是判断用户是否登录,没登录就不显示登录表单
<?php Yii::import('zii.widgets.CPortlet'); class UserLogin extends CWidget { public $title='会员登录'; protected function renderContent() { $form=new User; if(isset($_POST['User'])) { $form->attributes=$_POST['User']; if($form->validate() && $form->login()){ $url = $this->controller->createUrl('site/index'); $this->controller->redirect($url); } } $this->render('userLogin',array('form'=>$form)); } }