Re: how to embed swf animation in home.ctp of my cakephp project
> Hi cricket, > > I apologize for the big delayi was stuck with another big problem > to be resolved. > > I am able to access main_ani.swf throught browser but not using > cakephp. If I place main_ani.swf in a html file (not within cakephp), > main_ani.swf is displaying fine in the browser. > > the flash file sits in wamp/www/merry_flowers/webroot/img. > merry_flowers is the name of my project that I baked in cakephp. > > I tried the following with "" > codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/ > swflash.cab#version=7,0,19,0" width="550" height="300" > title="main_ani"> > > > > pluginspage="http://www.macromedia.com/go/getflashplayer"; > type="application/x-shockwave- > flash" width="550" height="300"> > > but the flash animation is not displaying. After the page loads in the > browser, main_ani.swf is taking forever to load. > It says "1 item remaining. waiting > forhttp://localhost/merry_flowers/pages/test..."; > > "> That would suggest you haven't loaded the FlashHelper." > How do I load Flash Helper? > > thank you so much for the help! :) > > > > cricket wrote: > > On Thu, Apr 28, 2011 at 11:47 AM,varai wrote: > > > Hi > > > > "Not working" means no flash animation is displaying. > > > >> Can you access main_ani.swf directly in your web browser? > > > Yes, I can. > > > Using what path? Is the flash file sitting in app/webroot? Try: > > > /main_ani.swf > > > (note the slash) > > > Also, your markup gives the path for the embed tag but not the object. > > You need to realise that embed and object are two different things. > > Some browsers use one and some the other. The object tag requires > > param tags inside it which have the same values as the attributes of > > the embed tag. Notice that you have not included the path to the > > flash file for the object tag. > > > > > > >> I haven't read that tutorial, but I just skimmed it, and it doesn't say > > >> to call $this->renderSwf; it says to call $flash->renderSwf. > > > Yes, I had tried $flash->renderSwf earlier, But i got the following > > > error: > > > Notice (8): Undefined variable: flash [APP\views\pages\home.ctp, line > > > That would suggest you haven't loaded the FlashHelper.- Hide quoted text - > > - Show quoted text - -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
problem in auth component
I got probem in register page when i use auth component can you see and help to fix it http://www.youtube.com/watch?v=zW3wRUw5NRo -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: getLastInsertId diff
$this->model_name->id is according to the API: * Value of the primary key ID of the record that this model is currently pointing to. * Automatically set after database insertions. So that may or may not be the last inserted record $this->model_name->getLastInsertId(); appears to do exactly what it says, get the last inserted id. Looking at the Model class, getLastInsterId() fetches a private property of the class, not the property id. Regards, Don On May 8, 4:24 am, "CakePHP.Saint" wrote: > Hi Can any one please say the differences between them > After i inserting a record I can use following ways to get the last > insert id . > I need to know whats the diff between them. Which is best ? > > $this->model_name->getLastInsertId(); > $this->model_name->id; > > Thanks in advance -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: newbie question - how to I find this particular value so I can pass it on via a redirect
$this->redirect(array('action' => 'view', 'id' => $slug)); hth... Claudio On 7 maio, 13:22, barricades wrote: > Hi, I'm new so please don't shout at me for the stupid question but... > > When I save a record I want to redirect straight to the record I just > created. The record which I have just created uses sluggable behaviour > to create a slug in a beforeSave, so I can't just use > $this->data['Campaign]['slug'] as it doesn't exist before I save my > > campaign. > > in my add function I've got: > > > if ($this->Campaign->save($this->data)) { > $slug = $this->Campaign->find('first', array('fields' => > 'Campaign.slug')); > $this->redirect(array('action' => 'view', $slug)); > } else { > $this->Session->setFlash(__('The campaign could not be saved. Please, > try again.', true));} > > > > and then > > > function view($slug) { > $campaign = $this->Campaign->find('first', > array('conditions'=>array('Campaign.slug'=>$slug), 'recursive'=>-1)); > $this->set(compact('campaign')); > } > > > but that ain't working. I've tried a couple of other ways but I'm a > bit stumped. > > How do I get the value that's in the slug column for the Campaign > which has just been saved and pass it on to the view function so that > I can display the right Campaign? > > thanks in advance :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
getLastInsertId diff
Hi Can any one please say the differences between them After i inserting a record I can use following ways to get the last insert id . I need to know whats the diff between them. Which is best ? $this->model_name->getLastInsertId(); $this->model_name->id; Thanks in advance -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: isUnique validation on edit action of User model
Its already in CakePHP core, you didn't need nothing at all. If you just use "echo $form->input('id');" in your view. Sorry, that I didn't notice your problem in time. -- View this message in context: http://cakephp.19694.n2.nabble.com/isUnique-validation-on-edit-action-of-User-model-tp5519353p6340487.html Sent from the CakePHP mailing list archive at Nabble.com. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Populate checkboxes based on an array
echo $this->Form->input('situaction', array( 'before' => '' . __('situaction', true), 'between' => '', 'label' => false, 'legend' => false, 'separator' => ' ', 'options' => array('1'=> __('Available', true), '2 '=> __('Unavailable',true)), 'value' => $this->data['Product']['situactio'], 'type' => 'radio' ) ); this works for me... hth to you... Claudio Baima On 5 maio, 14:02, cougarman wrote: > I have a large group of checkboxes. When the page loads, I need each > checkbox with a "value" that is contained in a certain array of > numbers to be checked. Is this possible? It seems that $_POST will > not work to put the values of all my checkboxes in an array, because > $_POST will only return values of checkboxes that are already checked. > > Many thanks, > > C -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Populate checkboxes based on an array
echo $this->Form->input('situation', array( 'before' => '' . __('situation', true), 'between' => '', 'label' => false, 'legend' => false, 'separator' => ' ', 'options' => array('1'=> __('Available', true), '2 '=> __('Unavailable',true)), 'value' => $this->data['Product']['situaction'], 'type' => 'radio' ) ); this works for me... hth for you... Claudio Baima On 5 maio, 14:02, cougarman wrote: > I have a large group of checkboxes. When the page loads, I need each > checkbox with a "value" that is contained in a certain array of > numbers to be checked. Is this possible? It seems that $_POST will > not work to put the values of all my checkboxes in an array, because > $_POST will only return values of checkboxes that are already checked. > > Many thanks, > > C -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Cakephp facebook integration
Hi guys, I have just written a cakephp-facebook-integration component and a small app to demonstrate to use this component. Please do review the code if possible and let me know if it was helpful In case you need any integration help, please do write to me at chilly5...@gmail.com The code is available for download at Sourceforge : http://sourceforge.net/projects/cakephpfacebook/ -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: mp3 player in flash
I finished! Just needed add "$this->webroot" at the begin of my basepath =) thanks for all On 6 maio, 01:35, Sam Sherlock wrote: > having the mp3 in a dir named music is fine within the webroot dir is fine. > > is your app installed in a folder named cake and artist a controller > > or is the app within artist? > > it looks to me the latter (although other parts of your email make me think > that artist is a controller) > and the fix may be as simple as make the flash instance recieve > /cake/artist/webroot/music/myfile.mp3 > that should be the same as > /cake/artist/music/myfile.mp3 > > I think your passing a relative url to the flash instance > since it finds the mp3 from the index but not the detailView action > > I have an app that plays mp3s from a flash header > my mp3s are in a dir named mp3 - I load playlists of mp3s from a dir xml > (which has absolute paths) > > irrespective of the url in the browser the mp3 is played - below is a > simplified version of the setup I used (in addition to loading the header I > have various other swfobjects for videos, photos etc that all use the same > principal - my header also has a signup feature using ajax to pass > send/repond data between flash & cake) > > var flObj = { > flashvars: { > logoObject:'flash/logo.swf', > xmlFile:'xml/blank.xml', > file:"xml/playlist.xml",mp3swf:"flash/mp3player.swf" > }, > params:{ > base:siteCfg.path > } > > }; > > swfobject.embedSWF( > siteCfg.path+"/flash/myheader.swf", > "targetDiv",977,220,"8.0.0",false, > flObj.flashvars, > flObj.params > ); > > since the flash params.base is set I can pass additional files to my flash > to load the additional files are passed relative to location in webroot > and the flash instance concats the url of loaded file from the siteCfg.path > > so my app installed in /cakemp3playingapp/ on example.com - the following > will all work > > example.com/cakemp3playingapp/ > example.com/cakemp3playingapp/artists/ > example.com/cakemp3playingapp/artists/details/1/ > example.com/cakemp3playingapp/contact/ > > my example uses an xml playlist - but thats optional > > hth - S > > On 6 May 2011 05:24, Kane The Pirate wrote: > > > > > On 3 maio, 23:24, Sam Sherlock wrote: > > > perhaps its due to cakes use of mod rewrite > > > > if so I suggest using firebug's net tab to see the urls of the mp3's > > being > > > loaded > > > then firgure out a way to ensure the your app has correct urls > > consistently > > > > are you using absolute paths to the mp3s within your xml file or as > > params > > > passed to swfobject? > > > > I pass a basePath to swfobjects in cake apps and use this within > > > actionscript to get easy abs paths > > > then it does not matter is the app is in subdir or not the actionscript > > does > > > not need to be recoded > > > > - S > > > > On 4 May 2011 02:47, Kane The Pirate wrote: > > > > > Its workin now! but just in my index page, and only if I access my url > > > > without any slashes after the index. > > > > ex: localhost/cake/artist - this works > > > > ex: localhost/cake/artist/ - this doesn't work > > > > ex: localhost/cake/artist/detailView/12 - doesn't work. > > > > > I'm trying to understand. I used the router to see if there are > > > > differences, but there is none difference between the index and other > > > > pages. > > > > > I'm just using swfobject for cakephp. > > > > > Thanks. > > > > > -- > > > > Our newest site for the community: CakePHP Video Tutorials > > > >http://tv.cakephp.org > > > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp > > > > others with their CakePHP related questions. > > > > > To unsubscribe from this group, send email to > > > > cake-php+unsubscr...@googlegroups.com For more options, visit this > > group > > > > athttp://groups.google.com/group/cake-php > > > I'm passing by params. > > something like webroot/music/myfile.mp3. > > > in index show me the following url: > > localhost/cake/artist/webroot/music/myfile.mp3 > > > in other shows this: > > localhost/cake/artist/detailview/1/webroot/music/myfile.mp3 > > > However in my index it run, in my detailview not. > > > I tought if is better to change the route, or put my files outside > > webroot. > > > Thanks > > > -- > > Our newest site for the community: CakePHP Video Tutorials > >http://tv.cakephp.org > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help > > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at ht
Re: newbie question - how to I find this particular value so I can pass it on via a redirect
Barricades, I think your concern about the beforeSave/afterSave issues are red herrings. Since the first line of your code is: if ($this->Campaign->save($this->data)) { ... both the before and after are finished. And you are only getting inside the 'if' statement when the save was successful. Of course, in that case the slug exists but it isn't available in the way you are trying to get to it. That's why I suggested searching on the returned id of the created record. That will get you the slug value to pass on through to your redirect. To prove it to yourself, modify the if statement to read: if ($this->Campaign->save($this->data)) { debug($this->Campaign->findById($this->Campaign- >id,array('fields'=>'slug'))); die; ... } So using the find statement I've shown you in the debug function (above) you could do this: if ($this->Campaign->save($this->data)) { $new_record = $this->Campaign->findById( $this->Campaign->id, array('fields'=>'slug') ); $this->redirect(array( 'action' => 'view', $new_record['Campaign']['slug'] )); } else { } Regards, Don On May 8, 4:59 am, barricades wrote: > Thanks for the reply :) > > The find after the save isn't returning what I want it to. In fact I'm > not sure it's returning anything at all. Baring in mind I'm a total > newbie (not even that much of a php'er either yet) what I want it > simply somehow (what I've done is just my best guess - I've no idea > how to do this at all) to make it so that when I save a new Campaign, > if it's successful, it redirects to a view action and passes along the > slug, as a string I guess would be best(?), so that I can show the > details of the newly created Campaign on in the view.ctp. > > The caveat being that I'm using sluggable behaviour which creates the > slug in a beforeSave and therefore the $slug to be passed on to the > view function has to be created after the save. > > I hope that makes sense. > > On May 8, 3:08 am, dreamingmind wrote: > > > > > > > > > Barricades, > > > You don't really say WHERE the process seems to break down. The find > > after the save seems suspicious to me. Is that returning the proper > > slug to pass along to your view function? It looks like $slug will end > > up holding the returned data array rather than the returned string > > from the slug field (see below for more info) > > > You might take advantage of the fact that the id property of the model > > is set to the id of the record that was created by save. So you should > > be able to set your slug value properly after: > > > $this->Campaign->findById($this->Campaign- > > > >id,,array('fields'=>'slug')); > > > But you should also be aware that this will not return the slug field > > directly. It's going to be in the usual data array: > > > Array > > ( > > [Campaign] => Array > > ( > > [slug] => My_crazy_slug > > ) > > ) > > > Regards, > > Don > > > On May 7, 9:22 am, barricades wrote: > > > > Hi, I'm new so please don't shout at me for the stupid question but... > > > > When I save a record I want to redirect straight to the record I just > > > created. The record which I have just created uses sluggable behaviour > > > to create a slug in a beforeSave, so I can't just use > > > $this->data['Campaign]['slug'] as it doesn't exist before I save my > > > > campaign. > > > > in my add function I've got: > > > > > > > if ($this->Campaign->save($this->data)) { > > > $slug = $this->Campaign->find('first', array('fields' => > > > 'Campaign.slug')); > > > $this->redirect(array('action' => 'view', $slug)); > > > } else { > > > $this->Session->setFlash(__('The campaign could not be saved. > > > Please, > > > try again.', true));} > > > > > > > > and then > > > > > > > function view($slug) { > > > $campaign = $this->Campaign->find('first', > > > array('conditions'=>array('Campaign.slug'=>$slug), 'recursive'=>-1)); > > > $this->set(compact('campaign')); > > > } > > > > > > > but that ain't working. I've tried a couple of other ways but I'm a > > > bit stumped. > > > > How do I get the value that's in the slug column for the Campaign > > > which has just been saved and pass it on to the view function so that > > > I can display the right Campaign? > > > > thanks in advance :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: TDD in CakePHP
Are there going to be changes to the way cake tests their controllers in cake 2.0? Will they solve the navigation issue where you can't test a controller that redirects? On May 6, 10:02 am, "Daniel S. Reichenbach" wrote: > Greetings, > > > Does anyone do TDD in Cake? Do you have any recommendation or > > something helpful to start with this practice? > > test-driven development with CakePHP is worth the effort. For starters, > have a look e.g. in the test suite included with CakePHP, which can be > found in the `cake/tests/` directory ([see here][1]). > > If you do want to write tests for CakePHP 1.3.x, you will need to grab > [SimpleTest][2] and extract it into your vendor directory. > > For CakePHP 2.0.x, [PHPUnit][3] is used to write tests. I'd recommend > to peek into the 2.0 branch on github, which comes with [tests][4] as > well. > > An example for plugins and tests would probably be the debug kit, as > it comes with [batteries included][5], too. > > Try defining your test cases, groups, etc. before you build the actual > application, and not after the app is done. :) > > [1]:https://github.com/cakephp/cakephp/tree/master/cake/tests > [2]:http://simpletest.org/ > [3]:http://phpunit.de/ > [4]:https://github.com/cakephp/cakephp/tree/2.0/lib/Cake/tests > [5]:https://github.com/cakephp/debug_kit > -- > [kogito](http://kogitoapp.com) - nerds available for awesome projects > > kogito Anwendungsentwicklung bra...@kogitoapp.com > c/o Daniel S. Reichenbach phone: +49 6462 915060 > Auf dem Würtenberg 33 mobile: +49 160 96311159 > 35075 Gladenbach, Germany -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Only show data which isn't in the other table. (complex).
@shadow why so complicated - i would just pass along the array: array('NOT' => array('Survey.id' => Set::extract('/SurveyUser/id', $answered On 7 Mai, 08:15, Dwayne Hanekamp wrote: > Awesome! > > I would like to thank you both! :) > > Dwayne -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: newbie question - how to I find this particular value so I can pass it on via a redirect
Thanks for the reply :) The find after the save isn't returning what I want it to. In fact I'm not sure it's returning anything at all. Baring in mind I'm a total newbie (not even that much of a php'er either yet) what I want it simply somehow (what I've done is just my best guess - I've no idea how to do this at all) to make it so that when I save a new Campaign, if it's successful, it redirects to a view action and passes along the slug, as a string I guess would be best(?), so that I can show the details of the newly created Campaign on in the view.ctp. The caveat being that I'm using sluggable behaviour which creates the slug in a beforeSave and therefore the $slug to be passed on to the view function has to be created after the save. I hope that makes sense. On May 8, 3:08 am, dreamingmind wrote: > Barricades, > > You don't really say WHERE the process seems to break down. The find > after the save seems suspicious to me. Is that returning the proper > slug to pass along to your view function? It looks like $slug will end > up holding the returned data array rather than the returned string > from the slug field (see below for more info) > > You might take advantage of the fact that the id property of the model > is set to the id of the record that was created by save. So you should > be able to set your slug value properly after: > > $this->Campaign->findById($this->Campaign- > > >id,,array('fields'=>'slug')); > > But you should also be aware that this will not return the slug field > directly. It's going to be in the usual data array: > > Array > ( > [Campaign] => Array > ( > [slug] => My_crazy_slug > ) > ) > > Regards, > Don > > On May 7, 9:22 am, barricades wrote: > > > > > > > > > Hi, I'm new so please don't shout at me for the stupid question but... > > > When I save a record I want to redirect straight to the record I just > > created. The record which I have just created uses sluggable behaviour > > to create a slug in a beforeSave, so I can't just use > > $this->data['Campaign]['slug'] as it doesn't exist before I save my > > > campaign. > > > in my add function I've got: > > > > > if ($this->Campaign->save($this->data)) { > > $slug = $this->Campaign->find('first', array('fields' => > > 'Campaign.slug')); > > $this->redirect(array('action' => 'view', $slug)); > > } else { > > $this->Session->setFlash(__('The campaign could not be saved. > > Please, > > try again.', true));} > > > > > > and then > > > > > function view($slug) { > > $campaign = $this->Campaign->find('first', > > array('conditions'=>array('Campaign.slug'=>$slug), 'recursive'=>-1)); > > $this->set(compact('campaign')); > > } > > > > > but that ain't working. I've tried a couple of other ways but I'm a > > bit stumped. > > > How do I get the value that's in the slug column for the Campaign > > which has just been saved and pass it on to the view function so that > > I can display the right Campaign? > > > thanks in advance :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php