【发布时间】:2014-06-18 05:41:28
【问题描述】:
在 Yii 中,我使用 yii-jpegcam 网络摄像头扩展用于在我的应用程序中拍照,它适用于以下 url 格式
index.php?r=user/newphoto
但我的应用程序是“/”格式(index.php/user/newphoto)。所以这个扩展不适用于我的 url 格式。怎么解决?
Extension Link used : http://www.yiiframew...on/yii-jpegcam/
http://www.yiiframework.com/extension/yii-jpegcam/
我的视图代码是:
<?php $onBeforeSnap = "document.getElementById('upload_results').innerHTML = '<h1>Uploading...</h1>';";
$completionHandler = <<<BLOCK
if (msg == 'OK') {
document.getElementById('upload_results').innerHTML = '<h1>OK! ...redirecting in 3 seconds</h1>';
// reset camera for another shot
webcam.reset();
setTimeout(function(){window.location = "index.php?r=user/index";},3000);
}
else alert("PHP Error: " + msg);
BLOCK;
$this->widget('application.extensions.jpegcam.EJpegcam', array(
'apiUrl' => 'index.php?r=user/jpegcam.saveJpg',
'shutterSound' => false,
'stealth' => true,
'buttons' => array(
'configure' => 'Configure',
'takesnapshot' => 'Take Snapshot!'
),
'onBeforeSnap' => $onBeforeSnap,
'completionHandler' => $completionHandler
)); ?>
【问题讨论】:
标签: php yii webcam yii-extensions yii-components