hi
i need to open a new window in my application in order to open a file edit it and then save it.
i am under the following (the script where i write the code is under this path) path:
C:\xampp\htdocs\yii\basapp\protected\views\assignment\_form.php
the folder to opens that contains the file to open is under the Templates folder
C:\xampp\htdocs\yii\basapp\protected\files\Template
in _form.php i need to write the code of a link or button that when i clicked, the folder window appeared.
i tried with open.window(files/Templates) or open.window(./files/Templates) or open.window(../../files/Templates) always the result: Unable to resolve the request "files".
how to write the correct url to open the folder?
any one can help?
thank you
Tsunami
(Erik)
May 31, 2013, 8:23pm
2
protected is protected. You can’t access it from your browser.
you mean that if i need to access to the files/Templates folder, i have to move them out of the protected folder?
if yes of can i write its link?
thank you
i moved the files/Templates folder out the protected folder in this path:
C:\xampp\htdocs\yii\basapp
i write this:
in config/main.php
'params'=>array(
'homePath'=> dirname(__FILE__) . '/../../..',
'protectedPath' => realpath($homePath . '/files'),
),
in _form.php
$protectedPath = Yii::app()->params['protectedPath'];
echo "<a href='$protectedPath'>link</a>";
echo '<input type="button" value="New Window!" onClick="window.open(' . $protectedPath . ' ,\'Like\')">';
when press on the button in firefox and ie, an error appears:
SyntaxError: missing ) after argument list window.open(C:\xampp\htdocs\yii\basapp\files ,‘Like’) [after C:]