A première vue, je me demande si il n'y aurait pas un problème avec la
classe File de Cake ...
En tout cas, avant de voir si cela vient du Helper javascript, essaye
de faire tout simplement un bloc <script type="text/javascript> et d'y
afficher le code dedans, sans passer par le helper. Tu verras bien si
il y a toujours l'erreur ou non.

Sinon, tu peux renommer Files en Fichiers et tout ce qui s'en suit.
J'essaierai de suivre le tutorial demain afin de voir si j'ai un
problème ou non de mon côté.

Bonne soirée,
Pierre

On 19 juil, 17:18, bertrand kempf <[EMAIL PROTECTED]> wrote:
> Hello,
>
> premièrement, merci de te pencher sur mon cas.
>
> En fait j'ai tester ainsi :
>
> <?php echo $javascript->codeBlock(""); ?> tout simplement, et j'obtiens la 
> même erreur.....
>
> donc, est-ce les helpers qui ont changé, et du coup ce tuto qui porte sur 
> cake 1.1 ne va plus
>
> soit, je ne vois pas;-)
>
> francky06l a écrit :
>
> > Tout cela semble venir de ta string pour le codeBlock. Soit sur que ce
> > soit une seule string, et pas comme je pense, un array de string.
>
> > <?php echo $javascript->codeBlock("
> >     var swfupload_url = '" . $html->url('/js/swfupload/
> > SWFUpload.swf') . "';
> >     var upload_url = '" . $html->url('/files/upload') . "';
> >     var file_info_url = '" . $html->url('/files/info') . "';"); ?>
>
> > Essaye de creer un string avec un variable genre:
>
> > $js = 'var swfupload_url =  "'. $html->url('/js/'/js/swfupload/
> > SWFUpload.swf') .'";';
> > $js .= ' var upload_url = "' . $html->url('/files/upload') . '";';
> > $js .= ' var file_info_url = "' . $html->url('/files/info') .
> > '";").';'; ?>
>
> > Enfin en gros que je crois que la string que tu genere n'est pas
> > propre concernant les guillemets et ; ..
> > Essaye de generer ca dans une string, et fait  $this->Log($js) just
> > apres. Regarde dans /tmp/logs/error.log et verifies la syntaxe de ta
> > string..
>
> > Franck
>
> > On Jul 19, 9:52 am, bertrand kempf <[EMAIL PROTECTED]> wrote:
>
> >> Bonjour,
>
> >> en fait voilà ce que j'ai fait:
>
> >> 1- j'ai créé mon composant (app/controllers/components/swf_upload.php),
> >> en copiant collant bêtement le contenu proposé
>
> >> 2- j'ai créé ma table files (comme indiqué dans le tuto)
>
> >> 3- j'ai créé un model files (via la console) et mon contrôleur lié, mais
> >> en fait c'est la vue qui pose problème....
>
> >> j'ai simplement créé une action index dans mon contrôleur, pour intégrer
> >> ceci:
>
> >> <?php echo $javascript->codeBlock("
> >>     var swfupload_url = '" . $html->url('/js/swfupload/SWFUpload.swf') . 
> >> "';
> >>     var upload_url = '" . $html->url('/files/upload') . "';
> >>     var file_info_url = '" . $html->url('/files/info') . "';"); ?>
> >> <?php echo $javascript->link('swfupload/swfupload'); ?>
> >> <?php echo $javascript->link('swfupload/init'); ?>
> >> <div id="wrapper">
>
> >>     <div id="contentContainer">
> >>         <div id="SWFUploadTarget">
> >>             <form action="<?php echo $html->url('/files/upload') ?>"
> >> method="post" onsubmit="return false" enctype="multipart/form-data">
> >>                 <?php print $html->file("Filedata"); ?>
>
> >>                 <input type="submit" value="Upload" />
> >>             </form>
> >>         </div>
> >>         <div id="SWFUploadFileListingFiles">
> >>         </div>
> >>     </div>
>
> >> comme indiqué dans le tuto, mais voilà, j'obtiens ceci comme erreurs:
>
> >> *Notice* (8) <javascript:void(0);>: Array to string conversion 
> >> [*CORE\cake\libs\file.php*, line *90*]
>
> >> Code <javascript:void(0);> | Context <javascript:void(0);>
>
> >> $path   =       array(
> >>         "id" => false,
> >>         "table" => null,
> >>         "ds" => null,
> >>         "alias" => "File",
> >>         "name" => "File"
> >> )
> >> $create =       false
> >> $mode   =       493
>
> >> dirname - [internal], line ??
> >> File::__construct() - CORE\cake\libs\file.php, line 90
> >> ClassRegistry::init() - CORE\cake\libs\class_registry.php, line 128
> >> Controller::loadModel() - CORE\cake\libs\controller\controller.php, line 
> >> 446
> >> Controller::constructClasses() - CORE\cake\libs\controller\controller.php, 
> >> line 397
> >> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 215
> >> require - APP\webroot\index.php, line 90
> >> [main] - APP\index.php, line 25
>
> >> *Notice* (8) <javascript:void(0);>: Array to string conversion 
> >> [*CORE\cake\libs\file.php*, line *91*]
>
> >> Code <javascript:void(0);> | Context <javascript:void(0);>
>
> >> $path   =       array(
> >>         "id" => false,
> >>         "table" => null,
> >>         "ds" => null,
> >>         "alias" => "File",
> >>         "name" => "File"
> >> )
> >> $create =       false
> >> $mode   =       493
>
> >> is_dir - [internal], line ??
> >> File::__construct() - CORE\cake\libs\file.php, line 91
> >> ClassRegistry::init() - CORE\cake\libs\class_registry.php, line 128
> >> Controller::loadModel() - CORE\cake\libs\controller\controller.php, line 
> >> 446
> >> Controller::constructClasses() - CORE\cake\libs\controller\controller.php, 
> >> line 397
> >> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 215
> >> require - APP\webroot\index.php, line 90
> >> [main] - APP\index.php, line 25
>
> >> *Warning* (2) <javascript:void(0);>: basename() expects parameter 1 to be 
> >> string, array given [*CORE\cake\libs\file.php*, line *92*]
>
> >> Code <javascript:void(0);> | Context <javascript:void(0);>
>
> >> $path   =       array(
> >>         "id" => false,
> >>         "table" => null,
> >>         "ds" => null,
> >>         "alias" => "File",
> >>         "name" => "File"
> >> )
> >> $create =       false
> >> $mode   =       493
>
> >> basename - [internal], line ??
> >> File::__construct() - CORE\cake\libs\file.php, line 92
> >> ClassRegistry::init() - CORE\cake\libs\class_registry.php, line 128
> >> Controller::loadModel() - CORE\cake\libs\controller\controller.php, line 
> >> 446
> >> Controller::constructClasses() - CORE\cake\libs\controller\controller.php, 
> >> line 397
> >> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 215
> >> require - APP\webroot\index.php, line 90
> >> [main] - APP\index.php, line 25
>
> >> *Notice* (8) <javascript:void(0);>: Undefined variable: javascript 
> >> [*APP\views\files\index.ctp*, line *1*]
>
> >> Code <javascript:void(0);> | Context <javascript:void(0);>
>
> >> $___viewFn      =       
> >> "D:\xampp\htdocs\workspace\cake\views\files\index.ctp"
> >> $___dataForView =       array()
> >> $loadHelpers    =       true
> >> $cached =       false
> >> $loadedHelpers  =       array(
> >>         "Html" => HtmlHelper
> >> HtmlHelper::$tags = array
> >> HtmlHelper::$base = "/workspace/cake/index.php"
> >> HtmlHelper::$here = "/workspace/cake/index.php/files"
> >> HtmlHelper::$params = array
> >> HtmlHelper::$action = "index"
> >> HtmlHelper::$data = NULL
> >> HtmlHelper::$_crumbs = array
> >> HtmlHelper::$__docTypes = array
> >> HtmlHelper::$helpers = NULL
> >> HtmlHelper::$webroot = "/workspace/cake/webroot/"
> >> HtmlHelper::$themeWeb = NULL
> >> HtmlHelper::$plugin = NULL
> >> HtmlHelper::$namedArgs = NULL
> >> HtmlHelper::$argSeparator = NULL
> >> HtmlHelper::$validationErrors = NULL
> >> HtmlHelper::$__tainted = NULL
> >> HtmlHelper::$__cleaned = NULL
> >> HtmlHelper::$_log = NULL,
> >>         "Form" => FormHelper
> >> FormHelper::$helpers = array
> >> FormHelper::$fieldset = array
> >> FormHelper::$__options = array
> >> FormHelper::$fields = array
> >> FormHelper::$requestType = NULL
> >> FormHelper::$base = "/workspace/cake/index.php"
> >> FormHelper::$webroot = "/workspace/cake/webroot/"
> >> FormHelper::$themeWeb = NULL
> >> FormHelper::$here = "/workspace/cake/index.php/files"
> >> FormHelper::$params = array
> >> FormHelper::$action = "index"
> >> FormHelper::$plugin = NULL
> >> FormHelper::$data = NULL
> >> FormHelper::$namedArgs = NULL
> >> FormHelper::$argSeparator = NULL
> >> FormHelper::$validationErrors = NULL
> >> FormHelper::$tags = array
> >> FormHelper::$__tainted = NULL
> >> FormHelper::$__cleaned = NULL
> >> FormHelper::$_log = NULL
> >> FormHelper::$Html = HtmlHelper object,
> >>         "Session" => SessionHelper
> >> SessionHelper::$helpers = NULL
> >> SessionHelper::$__active = true
> >> SessionHelper::$valid = false
> >> SessionHelper::$error = false
> >> SessionHelper::$_userAgent = "9245d6edce8f905fffa3d41f37b8d3b3"
> >> SessionHelper::$path = "/"
> >> SessionHelper::$lastError = NULL
> >> SessionHelper::$security = NULL
> >> SessionHelper::$time = 1216453490
> >> SessionHelper::$sessionTime = false
> >> SessionHelper::$watchKeys = array
> >> SessionHelper::$id = NULL
> >> SessionHelper::$_log = NULL
> >> SessionHelper::$base = "/workspace/cake/index.php"
> >> SessionHelper::$webroot = "/workspace/cake/webroot/"
> >> SessionHelper::$here = "/workspace/cake/index.php/files"
> >> SessionHelper::$params = array
> >> SessionHelper::$action = "index"
> >> SessionHelper::$data = NULL
> >> SessionHelper::$themeWeb = NULL
> >> SessionHelper::$plugin = NULL
> >> )
> >> $helper =       SessionHelper
> >> SessionHelper::$helpers = NULL
> >> SessionHelper::$__active = true
> >> SessionHelper::$valid = false
> >> SessionHelper::$error = false
> >> SessionHelper::$_userAgent = "9245d6edce8f905fffa3d41f37b8d3b3"
> >> SessionHelper::$path = "/"
> >> SessionHelper::$lastError = NULL
> >> SessionHelper::$security = NULL
> >> SessionHelper::$time = 1216453490
> >> SessionHelper::$sessionTime = false
> >> SessionHelper::$watchKeys = array
> >> SessionHelper::$id = NULL
> >> SessionHelper::$_log = NULL
> >> SessionHelper::$base = "/workspace/cake/index.php"
> >> SessionHelper::$webroot = "/workspace/cake/webroot/"
> >> SessionHelper::$here = "/workspace/cake/index.php/files"
> >> SessionHelper::$params = array
> >> SessionHelper::$action = "index"
> >> SessionHelper::$data = NULL
> >> SessionHelper::$themeWeb = NULL
> >> SessionHelper::$plugin = NULL
> >> $camelBackedHelper      =       "session"
> >> $html   =       HtmlHelper
> >> HtmlHelper::$tags = array
> >> HtmlHelper::$base = "/workspace/cake/index.php"
> >> HtmlHelper::$here = "/workspace/cake/index.php/files"
> >> HtmlHelper::$params = array
> >> HtmlHelper::$action = "index"
> >> HtmlHelper::$data = NULL
> >> HtmlHelper::$_crumbs = array
> >> HtmlHelper::$__docTypes = array
> >> HtmlHelper::$helpers = NULL
> >> HtmlHelper::$webroot = "/workspace/cake/webroot/"
> >> HtmlHelper::$themeWeb = NULL
> >> HtmlHelper::$plugin = NULL
> >> HtmlHelper::$namedArgs = NULL
> >> HtmlHelper::$argSeparator = NULL
> >> HtmlHelper::$validationErrors = NULL
> >> HtmlHelper::$__tainted = NULL
> >> HtmlHelper::$__cleaned = NULL
> >> HtmlHelper::$_log = NULL
> >> $form   =       FormHelper
> >> FormHelper::$helpers =
>
> ...
>
> plus de détails »
--~--~---------~--~----~------------~-------~--~----~

Groupe "Cakephp-fr".
Adresse : [email protected]
Pour résilier  : [EMAIL PROTECTED]
Pour les options : http://groups.google.com/group/cakephp-fr?hl=fr
-~----------~----~----~----~------~----~------~--~---

Répondre à