Re: Intégrer un outil dans mon application
maldini3 a écrit : Salut tout le monde, Je suis un nouveau membre de ce groupe :) Alors, Je suis un nouveau apprentit de cakephp. Là je dois intégrer un outil qui permet de gérer un album photo. Il est ecrit en php. Je vous demande où je dois le placer et qu'il est Url que je dois mettre pour y accèder. Merci pour votre accueil Bonjour et bienvenue. Je n'ai pas de réponse a ta question. Par contre un petit conseil. Pose tes questions en anglais... La ML est en anglais donc tu aura plus de réponses je penses... - Hi and welcome. I have no answer to your question. But a little advise. Ask your questions in english... The ML is in english, then you would probably have more answers... -- Simon COURTOIS {EPITECH.} tek4 | (LINAGORA) Developer | [ADITAM] Project Manager 10, rue Brillat-Savarin 75013 Paris | 01 45 42 72 30 - 06 72 44 67 81 http://www.happynoff.fr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: HABTM viewing all elements of an array
Peter54 wrote On 06/10/2008 02:05 AM: First off I'm not just new to Cake I'm new to programing. I can get my head around relatively simple stuff and can generalize once I have a concept but even though I know this is either obvious, or been answered a thousand times I can't see it anywhere or figure out how it works. I have a two tables Recipes and Ingredients and a JoinTable Ingredients_Recipes that contains the foreign keys plus some other data. In my controller I have the following code: $recipe = $this-Recipe-find(array('ShowDate'=$today)); $this-set('todays_recipe', $recipe); Which in debug send all the relevant elements of the all tables to the view: $___dataForView = array( todays_recipe = array( Recipe = array( recipe_id = 20, RecipeName = Banana Bread, ), Ingredient = array( array( ingredient_id = 1, IngredientName = Eggs, IngredientsRecipe = array( id = 1, recipe_id = 20, ingredient_id = 1, Amount = 2, ) In my view code echo @The dinner for $today is {$todays_recipe[Recipe]['RecipeName']} '; and I can generalize that to display anyting in the recipe array ie serves = $todays_recipe[Recipe]['Serves']; But when I try this with the Ingredients using - echo this {$today_recipe[Ingredient]['IngredientName']}; I get undefined constants or undefined variables. I assume I have to declare the ingredients array in the controller or assign it to a variable but how? I don't know and at the risk of appearing stupid or irritating I thought I'd ask. Hi, Isn't it a quote problem ? U do $today_recipe[Ingredient] instead of $today_recipe['Ingredient']. I hope it's because of it ;) -- Simon COURTOIS {EPITECH.} tek4 | (LINAGORA) Developer | [ADITAM] Project Manager 10, rue Brillat-Savarin 75013 Paris | 01 45 42 72 30 - 06 72 44 67 81 http://www.happynoff.fr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: dynamic variable names?
Dave wrote On 06/08/2008 02:33 AM: ok I got this array from the facebook API: [...] now i wrote a function split_vars() that should write the value of nid, name, type, status and year into one variable. since there are more than one arrays (2 in this case) it would be good if i could have the number of the array in the name of the variable so that $affiliations_1_name should echo Luxembourg. I wrote this: function split_vars(){ //This is just a part of the function, $user_info is the big array where all the user_info data is global $user_info, $affiliations, ${'affiliations_'.$i.'_nid'}, $ {'affiliations_'.$i.'_name'}, ${'affiliations_'.$i.'_type'}, $ {'affiliations_'.$i.'_status'}, ${'affiliations_'.$i.'_year'}; for($i=0;$icount($user_info[0]['affiliations']);$i++){ $affiliations = $user_info[0]['affiliations'][$i]; ${'affiliations_'.$i.'_nid'} = $affiliations['nid']; ${'affiliations_'.$i.'_name'} = $affiliations['name']; ${'affiliations_'.$i.'_type'} = $affiliations['type']; ${'affiliations_'.$i.'_status'} = $affiliations['status']; ${'affiliations_'.$i.'_year'} = $affiliations['year']; } } and outside of the variable I need to echo all these variable variables. But I get a Parse error: syntax error, unexpected ',' in line where globals are declared. Ok there is the thing. with php you don't declare a global variable with global $var. when you use global you say 'I wanna use this $var in my function even if it has been declared in superior scope'. For example : function say_hello() { global $hello; echo $hello; } say_hello(); $hello = 'hi'; say_hello(); This script will echo nothing and hi, because the second time the variable has a value. I think you see this in a C/C++ way. That's not PHP's way. another thing. when you write global ${'affiliations_'.$i.'_nid'}, it can't be good, $i is not even declared at this point. -- Simon COURTOIS {EPITECH.} tek4 | (LINAGORA) Developer | [ADITAM] Project Manager 10, rue Brillat-Savarin 75013 Paris | 01 45 42 72 30 - 06 72 44 67 81 http://www.happynoff.fr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: duplicate URL's Getting Indexed
Kyle Decot wrote On 06/08/2008 05:14 PM: I looked on google today and I noticed that both: www.affinityskateboards.com/app/webroot/team/ www.affinityskateboards.com/team/ are getting indexed by google. Is there a way to set a redirect to prevent this from happening? Thanks as alway Hi, It's like if you have a development configuration... Is it normal ? The DocumentRoot should be on /app/webroot if it's a production configuration. -- Simon COURTOIS {EPITECH.} tek4 | (LINAGORA) Developer | [ADITAM] Project Manager 10, rue Brillat-Savarin 75013 Paris | 01 45 42 72 30 - 06 72 44 67 81 http://www.happynoff.fr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: dynamic variable names?
Dave wrote On 06/07/2008 09:54 PM: Hi guys, first post :) my question: is it possible to have dynamic variable names, I mean something like this: for($i=0;$ix;$i++){ $y_$i = blabla; } in other words I want the number of the loop to be displayer in the name of the variable. Thanks for help Hi, You can test this syntax : $y = 'test'; for($i=0; $i 3; $i++) { ${$y.'_'.$i} = 'blabla'; } echo $test_0; it should echo : blabla voila :) -- Simon COURTOIS {EPITECH.} tek4 | (LINAGORA) Developer | [ADITAM] Project Manager 10, rue Brillat-Savarin 75013 Paris | 01 45 42 72 30 - 06 72 44 67 81 http://www.happynoff.fr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: dynamic variable names?
Dave wrote On 06/08/2008 01:47 AM: On 7 Jun., 23:09, HappyNoff [EMAIL PROTECTED] wrote: On Jun 7, 9:54 pm, Dave [EMAIL PROTECTED] wrote: Hi guys, first post :) my question: is it possible to have dynamic variable names, I mean something like this: for($i=0;$ix;$i++){ $y_$i = blabla; } in other words I want the number of the loop to be displayer in the name of the variable. Thanks for help. Hi, You can test this syntax : $y = 'test'; for($i=0; $i 3; $i++) { ${$y.'_'.$i} = 'blabla'; } echo $test_0; it should echo : blabla voila :) merci but how do I declare these as global variables? I tried: global ${$y.'_'.$i}; but I got a Parse error: syntax error, unexpected ', It depends on context... where do u want to declare this variables ? and where do you want to use it ? Understand that when you type : ${$y.'_'.$i} It's just a replacement. If $y = 'test' and $i = '0', it's exactly like if you had ${'test'.'_'.'0'}, or ${'test_0'} or $test_0... Is your 'global' call in a function that needs previously declared variables ? To help you, I need to understand what you wanna do and what you need ;) -- Simon COURTOIS {EPITECH.} tek4 | (LINAGORA) Developer | [ADITAM] Project Manager 10, rue Brillat-Savarin 75013 Paris | 01 45 42 72 30 - 06 72 44 67 81 http://www.happynoff.fr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---