猫咪兔 2012-03-09 11:20:32 3944次浏览 6条回复 0 0 0

我使用cropzoom的扩展来剪切用户上传的头像。

$this->widget('ext.cropzoom.JCropZoom', array(
    'id' => 'cropZoom1',
    'width'=>800,
    'height'=>600,
    'callbackUrl'=>Yii::app()->createUrl('member/profile/uploadimg'),
    //'containerId'=>'crop_container1',
    'onServerHandled' => 'js:function(response){alert(response)}',		
    //if server end give you an json string
    // use the $.parseJSON() to decode it !
    'image'=>array(
        //'source'=>'http://a1.att.hudong.com/11/11/01300000334334123287112954864.jpg'
        'source'=>$imageSource,
    )
));
?>

点击剪切图片按钮后弹出

array(12) {
  ["viewPortW"]=>
  string(3) "800"
  ["viewPortH"]=>
  string(3) "600"
  ["imageX"]=>
  string(1) "0"
  ["imageY"]=>
  string(1) "0"
  ["imageRotate"]=>
  string(1) "0"
  ["imageW"]=>
  string(4) "1024"
  ["imageH"]=>
  string(3) "768"
  ["imageSource"]=>
  string(58) "http://www.hhedu.com/avatar/2012/03/06/97/sourceImg_97.jpg"
  ["selectorX"]=>
  string(5) "285.5"
  ["selectorY"]=>
  string(3) "250"
  ["selectorW"]=>
  string(3) "229"
  ["selectorH"]=>
  string(3) "100"
}

问,我怎样将这些数据传给控制器呢?以便于保存所截图啊?

您需要登录后才可以回复。登录 | 立即注册