I was making use of some new 5.4 features trying to set the attributes of a model after it's creation.
e.g.
$model = (new MyModel)->setAttributes(array(...));
And had to extend CModel just to return the instance on setAttributes.
Posted 20 June 2012 - 08:51 AM
$model = (new MyModel)->setAttributes(array(...));
Posted 21 June 2012 - 11:18 AM
Posted 21 June 2012 - 03:20 PM
$model->something() ->someOtherThing() ->anotherThing(); #instead of: $model->something()->someOtherThing()->anotherThing();
Posted 21 June 2012 - 04:54 PM
yJeroen, on 21 June 2012 - 03:20 PM, said:
Yii::app()->clientScript->addPackage('sm2-muxtape', array(
'basePath' => 'ext.Sm2Muxtape',
'baseUrl' => bu($baseUrl),
'js' => array('script/soundmanager2-nodebug-jsmin.js', 'page-player.js'),
'css' => array('', 'page-player.css', 'flashblock.css'),
))->registerPackage('sm2-muxtape'
)->registerCss('sm2-debug', <<<CSS
#soundmanager-debug {
/* SM2 debug container (optional, makes debug more useable) */
position: absolute;
position: fixed;
*position: absolute;
bottom: 10px;
right: 10px;
width: 50em;
height: 18em;
overflow: auto;
background: #fff;
margin: 1em;
padding: 1em;
border: 1px solid #999;
font-family: "lucida console", verdana, tahoma, "sans serif";
font-size: x-small;
line-height: 1.5em;
opacity: 0.9;
filter: alpha(opacity = 90);
z-index: 99;
}
CSS
)->registerScript('sm2-init',
"soundManager.url = '$baseUrl/swf/'",
CClientScript::POS_HEAD
);
Posted 22 June 2012 - 01:51 AM
Yii::app()->clientScript->addPackage('sm2-muxtape', array(
'basePath' => 'ext.Sm2Muxtape',
'baseUrl' => bu($baseUrl),
'js' => array('script/soundmanager2-nodebug-jsmin.js', 'page-player.js'),
'css' => array('', 'page-player.css', 'flashblock.css'),
))
->registerPackage('sm2-muxtape')
->registerCss('sm2-debug', $css)
->registerScript('sm2-init',
"soundManager.url = '$baseUrl/swf/'",
CClientScript::POS_HEAD);
Posted 22 June 2012 - 02:37 AM
Yii::app()->clientScript->addPackage('sm2-muxtape', array(
'basePath' => 'ext.Sm2Muxtape',
'baseUrl' => bu($baseUrl),
'js' => array('script/soundmanager2-nodebug-jsmin.js', 'page-player.js'),
'css' => array('', 'page-player.css', 'flashblock.css'),
))
->registerPackage('sm2-muxtape')
->registerCss('sm2-debug', $css)
->registerScript(
'sm2-init',
"soundManager.url = '$baseUrl/swf/'",
CClientScript::POS_HEAD
);
Posted 22 June 2012 - 07:21 AM
Posted 02 July 2012 - 03:55 AM

Quote