Monday, 15 February 2010

php - Yii webcam extension -



php - Yii webcam extension -

in yii,iam using yii-jpegcam webcam extension used taking photos in application , works fine next url format

index.php?r=user/newphoto

but application in "/" format (index.php/user/newphoto). extension not working url format. how can solved?

extension link used : http://www.yiiframew...on/yii-jpegcam/ http://www.yiiframework.com/extension/yii-jpegcam/

and view code :

<?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 photographic camera 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 )); ?>

if urlmanager enabled in config, should alter apiurl value createurl method :

$this->widget('application.extensions.jpegcam.ejpegcam', array( 'apiurl' => yii::app()->urlmanager->createurl('index.php/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

No comments:

Post a Comment