array( 'class'=>'CProfileLogRoute', 'levels'=>'error, warning', )
<div class="breadcrumbs"> <span><a href="http://abc.com">shouye</a> </span>>>><span>Managde Posts</span>>>> <span>b</span>>>><span>c</span></div>
if(isset($_POST['name'])){
Yii::app()->user->setFlash('success','you are success');
$this->refresh();
}
if (Yii::app()->user->hasFlash('success')){
echo 're is'.Yii::app()->user->getFlash('success');
}else{
echo 'no';
}
array('empty'=>array(0=>'选择分组')
<input type="submit" class="btn" value="提交" />
public function actions()
{
return array(
'captcha'=>array(
'class'=>'CCaptchaAction',
'backColor'=>0xFFFFFF,
'maxLength'=>4,
'minLength'=>4,
),
);
}
<?php echo CHtml::activeTextField($user, 'verifyCode');?>
<?php $this->widget('CCaptcha',array(
'captchaAction' => '/site/captcha',
'showRefreshButton' => false,
'clickableImage' => true,
'imageOptions' => array('align'=>'top', 'title'=>'重新获取'),
));
?>
array('verifyCode', 'captcha', 'captchaAction'=>'site/captcha', 'message' => '输入的验证码不正确'),
set_time_limit(0);//禁止角本超时
array( 'class'=>'CDbLogRoute', 'levels'=>'info', 'logTableName'=>'Log', 'connectionID'=>'db', ),
'modules'=>array( 'gii'=>array( 'class'=>'system.gii.GiiModule', 'password'=>'123', ), ),
if($_SERVER['HTTP_CLIENT_IP']){
$ip = $_SERVER['HTTP_CLIENT_IP'];
}elseif($_SERVER['HTTP_X_FORWARDED_FOR']){
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}else{
$ip = $_SERVER['REMOTE_ADDR'];
}
$this->beginWidget('CMarkdown', array('purifyOutput'=>true));
echo $data->content;
$this->endWidget();
return array( 'accessControl', // perform access control for CRUD operations );
'index-/<id:d+>'=>array("book/index",'matchValue'=>false),
$this->createUrl('book/index', array('id'=>'abcd'));
class LLog extends CActiveRecordBehavior{
public function beforeDelete($event){
$model = get_class($this->Owner);
//做要做的事,比如日志或修改模型字段内容
}
}
public function behaviors()
{
return array(
// Classname => path to Class
'LLog'=>'application.behavior.LLog',
);
}
$app = Yii::createWebApplication($config);
$app->onbeginRequest = 'begin';
$app->run();
function begin(){
echo 'yyyyydddyyyyyy';
}
<?php
class JTool extends CComponent{
private $_width;
public function getWidth(){
return $this->_width ? $this->_width : 1;
}
public function setWidth($width){
if($this->hasEventHandler('onChange')){
$this->onChange(new CEvent());
}
$this->_width = $width;
}
public function onChange($event){
$this->raiseEvent('onChange', $event);
}
}
$j = new JTool();
$j->onChange = "showChange"; //给事件绑定handle showChange
$j->width = 100; //调用setWidth,解发绑定的事件showChange
function showChange(){
echo 'changed me';
}
class JToolSub extends JTool{
public function get100width(){
return $this->width*100;
}
}
class JBe extends CBehavior{
public function get100width(){
return $this->Owner->width*100;
}
}
$j = new JTool();
$j->attachBehavior('JBe', 'application.behavior.JBe');
echo $j->get100width();
class JBe extends CBehavior{
public function events(){
return array_merge(parent::events(),array(
'onChange'=>'change',
));
}
public function change(){
echo 'changed';
}
public function get100width(){
return $this->Owner->width*100;
}
}
$j = new JTool();
$j->attachBehavior('JBe', 'application.behavior.JBe');
$j->width = 100;
'aliases'=>array( 'local'=>'path/to/local/' ),
$url = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.components.homeuserlived'));
cs()->registerCoreScript('jquery');
cs()->registerScriptFile($url.'/location.js' ,CClientScript::POS_HEAD);
cs()->registerScriptFile($url.'/YLChinaArea.js' ,CClientScript::POS_HEAD);
cs()->registerCssFile($url.'/style.css');
$session = Yii::app()->session;
$session['terry'] = 30;
var_dump($session['key']);
Yii::app()->user->setState('tom', '40');
var_dump(Yii::app()->user->getState('key', 'default'));
<?php
ini_set('soap.wsdl_cache_enabled',0);
class Student {
public function getInfo($name,$age){
if($age == 20){
throw new SoapFault(-1, 'Cannot divide by zero!');
}
$xml = "<root><name>".$name."</name>";
$xml .= "<age>".$age."</age></root>";
return $xml;
}
}
$soapS = new SoapServer(null,array('uri' => 'http://www.dayouhui.com'));
$soapS->setClass('Student');
$soapS->handle();
?>
<?php
$soap = new SoapClient(null,array('location'=>"http://localhost/mysoap/index.php",'uri'=>'inadex.php'));
echo $soap->getInfo('a','b');
class ExtWindow extends CApplicationComponent{
private $title = 'title';
public $oldtitle;
public function getTitle(){
return $this->title ? $this->title : 'old title<br />';
}
public function setTitle($title){
echo '=='.$this->oldtitle.'==';
$this->oldtitle = $this->title;
$this->title = $title;
if($this->hasEventHandler('onTitleChange')){
$event =new CEvent($this);
$this->raiseEvent('onTitleChange', $event);
}
}
//必须有这么个方法,其和raiseEent中的事件一样,具体看代码
public function onTitleChange($event){
}
}
<?php
class Window extends CBehavior{
public function events(){
return array_merge(parent::events(),array(
'onTitleChange'=>'titleChange',
));
}
public function titleChange($event){
echo $event->sender->title;
echo 'event TitleChange is handled in Behavior<br />';
echo $this->owner->title;
}
public function titleOld(){
echo '<br />old title is is '.$this->owner->oldtitle;
}
}
'ExtWin'=>array(
'class' => 'ExtWindow',
'oldtitle'=>'我是旧的',
'behaviors'=>array('win'=>'application..behavior.Window')
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有