book.cakephp.org small problem
IE7 java script errors, gonna guess it has something to do with the plain text view option, because that doesn't show up in IE7. also this is more of a peeve but when code is copied in IE7 it copy's non formatted on a single line, in firefox you get a numbered list the plain text view in firefox works fine tho. --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Component startup vs initialize
A friend just pointed me to this: http://book.cakephp.org/view/64/Creating-Custom-Components There was a nice update on that page (december-ish, i'm guessing) that makes mention of the initialize method as an alternative to startup. I think i'm pretty much sold on "initialize" over "startup". On Jan 9, 9:58 am, morris wrote: > hey there.. > > so, with cake 1.2 final I've been struggling with a strange "bug" in > our application. we have quite a few components that are accessed from > the app_controller beforeFilter method. Some of our components rely on > other components (so withone one, it may be accessing > $this->controller->Session). This was causing an error after upgrading > > because it wasn't able to access $controller, despite having it > instantiated in the component's startup method. > > Some more digging shows that the component startups are not actually > called until after beforeFilter. So, I can't really use $this->controller > from within a component that is operating in beforeFilter > > (unless I manually call the startup method). However, I have also > discovered that a component's "initialize" method IS run before > 'beforeFilter' (right when its created, I believe). > > So far swapping my 'startup' methods over to 'initialize' (in the > components) hasn't caused any problems but I wanted to toss this out > there to see if this is a good idea or if there is something terribly > bad that I'm overlooking with this change. > > thanks! --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Component startup vs initialize
hey there.. so, with cake 1.2 final I've been struggling with a strange "bug" in our application. we have quite a few components that are accessed from the app_controller beforeFilter method. Some of our components rely on other components (so withone one, it may be accessing $this- >controller->Session). This was causing an error after upgrading because it wasn't able to access $controller, despite having it instantiated in the component's startup method. Some more digging shows that the component startups are not actually called until after beforeFilter. So, I can't really use $this- >controller from within a component that is operating in beforeFilter (unless I manually call the startup method). However, I have also discovered that a component's "initialize" method IS run before 'beforeFilter' (right when its created, I believe). So far swapping my 'startup' methods over to 'initialize' (in the components) hasn't caused any problems but I wanted to toss this out there to see if this is a good idea or if there is something terribly bad that I'm overlooking with this change. thanks! --~--~-~--~~~---~--~~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Strange behavior of Containable when using conditions
bump (my first and last) I'll probably be opening a ticket for this one - although I can work around it (phew) it just doesn't seem to be working as expected or specified in the manual. On Nov 20, 12:26 pm, morris <[EMAIL PROTECTED]> wrote: > Thanks for the quick response on that! > > Yeah, I know that moving the condition to the main condition area will > work, but it still doesn't resolve why the containable behavior (in my > mind) isn't functioning as one would expect. Conditions within Contain > work in other situations, why not here? Even the manual specifies that > using find params in 'Contain' is the way to do it. > > array-based conditions.. didn't make a difference in this scenario, > but thanks for pointing it out. > > On Nov 20, 12:15 pm, "Renan Gonçalves" <[EMAIL PROTECTED]> wrote: > > > Move the OfficeDesk condition to the main condition. > > > Also, use array-based condition: > > array( > > 'Model.field' => 'value' > > ) > > > On Thu, Nov 20, 2008 at 3:08 PM, morris <[EMAIL PROTECTED]> wrote: > > > > I'm seeing some odd behavior when using Containable with conditions. > > > > I have a model... lets call it 'DustParticle'.. it belongs to two > > > other models > > > DustParticle belongs to Broom > > > and > > > DustParticle belongs to OfficeDesk > > > > anyhow.. try not to read too much into the dust concept. > > > > When I run something like this: > > > > $this->DustParticle->find( > > > 'count', > > > array( > > > 'conditions' => array( > > > "DustParticle.user_id = $an_id" > > > ), > > > 'contain' => array( > > > 'OfficeDesk' => array( > > > 'conditions' => array( > > > "OfficeDesk.active > > > = > > > 'yes'" > > > ) > > > ) > > > ) > > > ) > > > ); > > > > the resulting query is: > > > > SELECT COUNT(*) AS `count` FROM `dust_particles` AS `DustParticle` > > > LEFT JOIN `office_desks` AS `OfficeDesk` ON > > > (`DustParticle`.`office_desk_id` = `OfficeDesk`.`id` AND > > > `OfficeDesk`.`active` = 'yes') WHERE `DustParticle`.`user_id` = '3' > > > > the problem being that it put that extra condition (OfficeDesk.active > > > = yes) into the JOIN..ON statement. > > > > my question is, i suppose, is this a known problem? or should I submit > > > a ticket? or perhaps i'm just using containable incorrectly? > > > > it only seems to occur (so far) when I have a Model that belongs to 2 > > > other models. I have a couple other queries that use containable > > > conditions.. but they are hasMany relationships and this problem > > > doesn't show up. > > > -- > > Renan Gonçalves aka renan.saddam > > Software Engineer - CakePHP Core Developer > > Cell Phone: +55 11 8633 6018 > > MSN: [EMAIL PROTECTED] > > São Paulo - SP/Brazil --~--~-~--~~~---~--~~ 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: Strange behavior of Containable when using conditions
Thanks for the quick response on that! Yeah, I know that moving the condition to the main condition area will work, but it still doesn't resolve why the containable behavior (in my mind) isn't functioning as one would expect. Conditions within Contain work in other situations, why not here? Even the manual specifies that using find params in 'Contain' is the way to do it. array-based conditions.. didn't make a difference in this scenario, but thanks for pointing it out. On Nov 20, 12:15 pm, "Renan Gonçalves" <[EMAIL PROTECTED]> wrote: > Move the OfficeDesk condition to the main condition. > > Also, use array-based condition: > array( > 'Model.field' => 'value' > ) > > > > On Thu, Nov 20, 2008 at 3:08 PM, morris <[EMAIL PROTECTED]> wrote: > > > I'm seeing some odd behavior when using Containable with conditions. > > > I have a model... lets call it 'DustParticle'.. it belongs to two > > other models > > DustParticle belongs to Broom > > and > > DustParticle belongs to OfficeDesk > > > anyhow.. try not to read too much into the dust concept. > > > When I run something like this: > > > $this->DustParticle->find( > > 'count', > > array( > > 'conditions' => array( > > "DustParticle.user_id = $an_id" > > ), > > 'contain' => array( > > 'OfficeDesk' => array( > > 'conditions' => array( > > "OfficeDesk.active = > > 'yes'" > > ) > > ) > > ) > > ) > > ); > > > the resulting query is: > > > SELECT COUNT(*) AS `count` FROM `dust_particles` AS `DustParticle` > > LEFT JOIN `office_desks` AS `OfficeDesk` ON > > (`DustParticle`.`office_desk_id` = `OfficeDesk`.`id` AND > > `OfficeDesk`.`active` = 'yes') WHERE `DustParticle`.`user_id` = '3' > > > the problem being that it put that extra condition (OfficeDesk.active > > = yes) into the JOIN..ON statement. > > > my question is, i suppose, is this a known problem? or should I submit > > a ticket? or perhaps i'm just using containable incorrectly? > > > it only seems to occur (so far) when I have a Model that belongs to 2 > > other models. I have a couple other queries that use containable > > conditions.. but they are hasMany relationships and this problem > > doesn't show up. > > -- > Renan Gonçalves aka renan.saddam > Software Engineer - CakePHP Core Developer > Cell Phone: +55 11 8633 6018 > MSN: [EMAIL PROTECTED] > São Paulo - SP/Brazil --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Strange behavior of Containable when using conditions
I'm seeing some odd behavior when using Containable with conditions. I have a model... lets call it 'DustParticle'.. it belongs to two other models DustParticle belongs to Broom and DustParticle belongs to OfficeDesk anyhow.. try not to read too much into the dust concept. When I run something like this: $this->DustParticle->find( 'count', array( 'conditions' => array( "DustParticle.user_id = $an_id" ), 'contain' => array( 'OfficeDesk' => array( 'conditions' => array( "OfficeDesk.active = 'yes'" ) ) ) ) ); the resulting query is: SELECT COUNT(*) AS `count` FROM `dust_particles` AS `DustParticle` LEFT JOIN `office_desks` AS `OfficeDesk` ON (`DustParticle`.`office_desk_id` = `OfficeDesk`.`id` AND `OfficeDesk`.`active` = 'yes') WHERE `DustParticle`.`user_id` = '3' the problem being that it put that extra condition (OfficeDesk.active = yes) into the JOIN..ON statement. my question is, i suppose, is this a known problem? or should I submit a ticket? or perhaps i'm just using containable incorrectly? it only seems to occur (so far) when I have a Model that belongs to 2 other models. I have a couple other queries that use containable conditions.. but they are hasMany relationships and this problem doesn't show up. --~--~-~--~~~---~--~~ 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: [Question]About PHP i18n !
I've been using Poedit http://www.poedit.net/ to create my translated .po files from a po template file (.pot). I haven't used any auto-translaters though I imagine there are some out there. I doubt it would be a seamless translation though. Poedit does have some fuzzy/suggestive translations and translation memory when you are working in an existing .po file. good luck! ghostjackyo wrote: > Excuse me ! > I want to ask some question about PHP i18n ! > Now i make some code with .po file ! > But it was zh_TW word ! > Does it have some tool can changed it to en_US ! (auto translation) > > This was some code ! > > EX : > > > #: i18n_lang.php:18 > msgid "�c�餤��" > msgstr "" > > #: i18n_lang.php:19 > msgid "�^��" > msgstr "" > > #: i18n_lang.php:20 > msgid "�n�J" > msgstr "" > > #: i18n_lang.php:21 > msgid "�n�J�̱b��" > msgstr "" > > #: i18n_lang.php:22 > msgid "�n�J�̱K�X" > msgstr "" > > #: i18n_lang.php:23 > msgid "�y�t" > msgstr "" > > #: i18n_lang.php:25 > msgid "�S��v��" > msgstr "" --~--~-~--~~~---~--~~ 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: CakeAMFPHP with Cake 1.2
Thanks to John's help I now have CakeAMFPHP 0.6.0 running in my cake 1.2 app. For anyone else looking to achieve this please check out: http://bakery.cakephp.org/articles/view/using-cakeamfphp-0-6-w-cake-1-2 On Jul 8, 1:57 pm, morris <[EMAIL PROTECTED]> wrote: > sorry, guess I should have clarified. We are still using the > oldcakeamfphpproject (.6) .. not the new "cakeamf" project. > > The reason we are doing this is because I don't have access to the > flash source at this time, and I'm unsure if I will need to be making > any edits to the flash/as if we are to upgrade fromCakeAMFPHP0.6 to > CakeAMF (apart from the gateway connection which is set dynamically). > > I was hoping to simply getCakeAMFPHPrunning with the Cake 1.2 > upgrade I just did, but our flash movies are all timing out their > connections. > > Do you have any experience with runningCakeAMFPHP(the old one) in > cake 1.2? If so, what was the process of manually upgradingCakeAMFPHP? > > Do you instead recommend setting up the new 'CakeAMF'? I tried it out > briefly but our flash movies were still timing out. I'm not sure if > the gateway was set up correctly though I followed all directions. I > set up the amfext in php, added the 'amf' plugin to my app, imported > it into webroot/index.php, then included as component in > app_controller (as 'Amf.Amf'), and set my gateway to the root of the > app (/). This, unfortunately, did not resolve anything. > > Thanks again for your time and help here > > -morris > > On Jul 8, 1:12 pm, John David Anderson <[EMAIL PROTECTED]> > wrote: > > > I think you're using even an older version of Cakeamf than I am. > > > I'd suggest getting the latest goodness from SVN, and following the > > instructions here: > > >https://trac.cakefoundation.org/amf/ > > > -- John > > > On Jul 8, 2008, at 10:48 AM, morris wrote: > > > > So you're suggesting I move the following lines from /webroot/ > > > cake_gateway.php > > > > -- loadController (null); see below > > > -- vendor('cakeamfphp'.DS.'amf-core'.DS.'app'.DS."CakeGateway"); see > > > below > > > > into /webroot/index.php as > > > > -- App::import('Controller', null); > > > -- App::import('Vendor', 'CakeGateway', null, null, > > > 'cakeamfphp'.DS.'amf-core'.DS.'app'.DS."CakeGateway.php"); > > > > ? > > > > I would certainly appreciate some help here if there is more to it > > > than this. Feel free to PM me. > > > > Thanks! > > > > On Jul 8, 12:06 pm, John David Anderson <[EMAIL PROTECTED]> > > > wrote: > > >> On Jul 8, 2008, at 9:29 AM, morris wrote: > > > >>> I'm having a heck of a time trying to getCakeAMFPHP0.6 working > > >>> with > > >>> a cake 1.2 site. We had been working with cake 1.1 andCakeAMFPHP, > > >>> which was doing fine. I've spent the past week upgrading our site > > >>> for > > >>> 1.2 and everything is working extremely well -- except our flash > > >>> bits > > >>> have ceased to work. > > > >>> Unfortunately our team is now lacking the flash expert who had set > > >>> all > > >>> the flash stuff up, otherwise I wouldn't be here. I'm hoping that > > >>> there may be some folk out there who have also chosen to simply > > >>> overhaul theircakeamfphpto work in the 1.2 environment, like us. > > >>> (I'd love to move to CakeAMF but I don't have the wherewithall to > > >>> break open our flash files and retool them). > > > >>> I modified the cake_gateway.php file to be using the correct > > >>> App::import methods, and debug var, which when visited tells me it > > >>> is > > >>> set up correctly. The problem seems to be that the flash movies are > > >>> all timing out. > > > >>> Is there anything that anyone can tell me about the process for re- > > >>> toolingcakeamfphpto work in cake 1.2? > > > >> The App::import() call is now in index.php due to some path loading > > >> changes since earlier versions of cake. I can help if you need it. > > > >> -- John --~--~-~--~~~---~--~~ 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: CakeAMFPHP with Cake 1.2
sorry, guess I should have clarified. We are still using the old cakeamfphp project (.6) .. not the new "cakeamf" project. The reason we are doing this is because I don't have access to the flash source at this time, and I'm unsure if I will need to be making any edits to the flash/as if we are to upgrade from CakeAMFPHP 0.6 to CakeAMF (apart from the gateway connection which is set dynamically). I was hoping to simply get CakeAMFPHP running with the Cake 1.2 upgrade I just did, but our flash movies are all timing out their connections. Do you have any experience with running CakeAMFPHP (the old one) in cake 1.2? If so, what was the process of manually upgrading CakeAMFPHP? Do you instead recommend setting up the new 'CakeAMF'? I tried it out briefly but our flash movies were still timing out. I'm not sure if the gateway was set up correctly though I followed all directions. I set up the amfext in php, added the 'amf' plugin to my app, imported it into webroot/index.php, then included as component in app_controller (as 'Amf.Amf'), and set my gateway to the root of the app (/). This, unfortunately, did not resolve anything. Thanks again for your time and help here -morris On Jul 8, 1:12 pm, John David Anderson <[EMAIL PROTECTED]> wrote: > I think you're using even an older version of Cakeamf than I am. > > I'd suggest getting the latest goodness from SVN, and following the > instructions here: > > https://trac.cakefoundation.org/amf/ > > -- John > > On Jul 8, 2008, at 10:48 AM, morris wrote: > > > > > So you're suggesting I move the following lines from /webroot/ > > cake_gateway.php > > > -- loadController (null); see below > > -- vendor('cakeamfphp'.DS.'amf-core'.DS.'app'.DS."CakeGateway"); see > > below > > > into /webroot/index.php as > > > -- App::import('Controller', null); > > -- App::import('Vendor', 'CakeGateway', null, null, > > 'cakeamfphp'.DS.'amf-core'.DS.'app'.DS."CakeGateway.php"); > > > ? > > > I would certainly appreciate some help here if there is more to it > > than this. Feel free to PM me. > > > Thanks! > > > On Jul 8, 12:06 pm, John David Anderson <[EMAIL PROTECTED]> > > wrote: > >> On Jul 8, 2008, at 9:29 AM, morris wrote: > > >>> I'm having a heck of a time trying to get CakeAMFPHP 0.6 working > >>> with > >>> a cake 1.2 site. We had been working with cake 1.1 and CakeAMFPHP, > >>> which was doing fine. I've spent the past week upgrading our site > >>> for > >>> 1.2 and everything is working extremely well -- except our flash > >>> bits > >>> have ceased to work. > > >>> Unfortunately our team is now lacking the flash expert who had set > >>> all > >>> the flash stuff up, otherwise I wouldn't be here. I'm hoping that > >>> there may be some folk out there who have also chosen to simply > >>> overhaul their cakeamfphp to work in the 1.2 environment, like us. > >>> (I'd love to move to CakeAMF but I don't have the wherewithall to > >>> break open our flash files and retool them). > > >>> I modified the cake_gateway.php file to be using the correct > >>> App::import methods, and debug var, which when visited tells me it > >>> is > >>> set up correctly. The problem seems to be that the flash movies are > >>> all timing out. > > >>> Is there anything that anyone can tell me about the process for re- > >>> tooling cakeamfphp to work in cake 1.2? > > >> The App::import() call is now in index.php due to some path loading > >> changes since earlier versions of cake. I can help if you need it. > > >> -- John --~--~-~--~~~---~--~~ 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: CakeAMFPHP with Cake 1.2
So you're suggesting I move the following lines from /webroot/ cake_gateway.php -- loadController (null); see below -- vendor('cakeamfphp'.DS.'amf-core'.DS.'app'.DS."CakeGateway"); see below into /webroot/index.php as -- App::import('Controller', null); -- App::import('Vendor', 'CakeGateway', null, null, 'cakeamfphp'.DS.'amf-core'.DS.'app'.DS."CakeGateway.php"); ? I would certainly appreciate some help here if there is more to it than this. Feel free to PM me. Thanks! On Jul 8, 12:06 pm, John David Anderson <[EMAIL PROTECTED]> wrote: > On Jul 8, 2008, at 9:29 AM, morris wrote: > > > > > > > I'm having a heck of a time trying to get CakeAMFPHP 0.6 working with > > a cake 1.2 site. We had been working with cake 1.1 and CakeAMFPHP, > > which was doing fine. I've spent the past week upgrading our site for > > 1.2 and everything is working extremely well -- except our flash bits > > have ceased to work. > > > Unfortunately our team is now lacking the flash expert who had set all > > the flash stuff up, otherwise I wouldn't be here. I'm hoping that > > there may be some folk out there who have also chosen to simply > > overhaul their cakeamfphp to work in the 1.2 environment, like us. > > (I'd love to move to CakeAMF but I don't have the wherewithall to > > break open our flash files and retool them). > > > I modified the cake_gateway.php file to be using the correct > > App::import methods, and debug var, which when visited tells me it is > > set up correctly. The problem seems to be that the flash movies are > > all timing out. > > > Is there anything that anyone can tell me about the process for re- > > tooling cakeamfphp to work in cake 1.2? > > The App::import() call is now in index.php due to some path loading > changes since earlier versions of cake. I can help if you need it. > > -- John --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
CakeAMFPHP with Cake 1.2
I'm having a heck of a time trying to get CakeAMFPHP 0.6 working with a cake 1.2 site. We had been working with cake 1.1 and CakeAMFPHP, which was doing fine. I've spent the past week upgrading our site for 1.2 and everything is working extremely well -- except our flash bits have ceased to work. Unfortunately our team is now lacking the flash expert who had set all the flash stuff up, otherwise I wouldn't be here. I'm hoping that there may be some folk out there who have also chosen to simply overhaul their cakeamfphp to work in the 1.2 environment, like us. (I'd love to move to CakeAMF but I don't have the wherewithall to break open our flash files and retool them). I modified the cake_gateway.php file to be using the correct App::import methods, and debug var, which when visited tells me it is set up correctly. The problem seems to be that the flash movies are all timing out. Is there anything that anyone can tell me about the process for re- tooling cakeamfphp to work in cake 1.2? At this point I'm thinking the gateway is set up correctly but it is not routing correctly to the actions. Or perhaps the actions should be returning data in a different format (do they need to render or just return?) At my wits end here so if this doesn't work then we'll be looking to hire someone who could retool this for us. Cheers! morris --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---