Re: PhpCaptcha Component Help
I am sorry.. I was able to make the validation worked again. if (empty($this->data)) { $this->render(); } else { if ($this->Email->save($this->data)) { if ($this->Captcha->check($this->data['Email']['userCode'])) { // Flash that it has been sent $this->flash('Your email has been sent.','/emails'); } // end: if ($this->Captcha->check($this->data['Email'] ['userCode'])) { } // end: if ($this->Email->save($this->data)) else { $this->set('errorMessage', 'Please correct errors below.'); $this->render(); } } // end: if (empty($this->data)) Although, how do you add error if the captcha is wrong? Right now, what he is doing is just refreshing on the page. Without the error that the captcha is wrong. Obviusly, i would just do.. if ($this->Captcha->check($this->data['Email']['userCode'])) { // Flash that it has been sent $this->flash('Your email has been sent.','/emails'); } // end: if ($this->Captcha->check($this->data['Email']['userCode'])) { else { // add the error here? but how to place/show again on the template? } How would i place the error back on the template? On Jul 26, 12:40 pm, Louie Miranda <[EMAIL PROTECTED]> wrote: > Yes. My index() function is my form and also my validation for the > captcha. > I have tried to add this code.. > > function index() > { > > print_r($this->data); > //echo $_SESSION[CAPTCHA_SESSION_ID]."///"; > //Array ( [Email] => Array ( [name] => sdfgsdfs [message] => > sdfsdfsfsdsdf ) ) > > $client_name = $this->data['Email']['name']; > $client_message = $this->data['Email']['message']; > $client_userCode = $this->data['Email']['userCode']; > > if (!empty($this->data)) > { > //$this->render(); > if > ($this->Captcha->check($this->data['Email']['userCode'])) { > > if ($this->Email->save($this->data)) > { > // Flash that it has been sent > $this->flash('Your email has been > sent.','/emails'); > > } // end: if ($this->Email->save($this->data)) > > } // end: if > ($this->Captcha->check($this->data['Email'] > ['userCode'])) { > else > { > $this->render(); > } > > } // end: if (empty($this->data)) > > } // end of function sent > > If data is !empty, process what i wish. Else, $this->render(); > I have deleted the redirection, and its not being redirected once the > form is not yet filled-up. > > Although, my next problem is the validation error. Which i placed > before and have tested. > Name: > input('Email/name', array('class' => 'input', > 'style' => 'width: 200px;')); ?> > tagErrorMsg('Email/name', 'Name is required.'); ?> > Message: > textarea('Email/message', array('rows'=>'10', > 'cols'=>'40')); ?> > tagErrorMsg('Email/message', 'Message is > required.'); ?> > > Captcha: > input('Email/userCode', array('class' => 'input', > 'style' => 'width: 200px;')); ?> > tagErrorMsg('Email/userCode', 'Captcha is > required.'); ?> > > Is not working anymore, what could i be missing? BTW, i also have > models/email.php with > var $validate = array( > 'name' => VALID_NOT_EMPTY, > 'message' => VALID_NOT_EMPTY, > 'userCode' => VALID_NOT_EMPTY > ); > > Please help. > > Louie Mirandahttp://www.axisihift.com > > On Jul 26, 11:49 am, Grant Cox <[EMAIL PROTECTED]> wrote: > > > Is your index() function the form? > > > If so, to re-show the form just call render(), or let the execution > > fall out the bottom, where render() will be automatically called. > > Don't redirect the user - this will cause a whole new page request and > > so the existing data is lost. > > > If your index() is not your form (just the form processor), then you > > will need to explicitly call render with the correct view to show. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email
rdBloggery and sorting problem
I am using rdBloggery and adding on a few custom pieces to the system for a fun project to learn cakephp better. I have a list of users and they are sorting by whichever header I click on, but I ran into a problem causing me a little grief. I added a column from my Transaction model to the User list to show their latest transaction total. My new controller (TransactionsController) uses the standard pagination helper included with rdBloggery. My User model $hasMany looks like this: var $hasMany = array( 'Post'=> array( 'className' =>'Post', 'foreignKey'=>'user_id', ), 'Photo' => array( 'className' =>'Photo', 'foreignKey'=>'user_id', ), 'Comment' => array( 'className' =>'Comment', 'foreignKey'=>'user_id', ), 'Transaction' => array( 'className' =>'Transaction', 'foreignKey'=>'user_id', 'limit' =>'1', 'order' =>'Transaction.created DESC', ), ); and my Transaction model $belongsTo looks like this: var $belongsTo = array( 'User' => array('className' => 'User', 'foreignKey' => 'user_id', ), ); On the user list page I am trying to sort the list by a column created from the a single transaction record, when I try this: sortLink('Funds',array('Transaction.total','desc'))?> I receive the following message: Query: SELECT `User`.`id`, `User`.`username`, `User`.`password`, `User`.`role`, `User`.`email`, `User`.`name`, `User`.`created`, `User`.`modified` FROM `users` AS `User` WHERE 1 = 1 ORDER BY `User`.`Transaction`.`total` ASC LIMIT 25 This returns "SQL Error: 1054: Unknown column 'User.Transaction.total' in 'order clause'" I want it to know to use the transactions table (so FROM 'transactions' AS 'Transaction' would also be included in the sql query somehow?) Is it possible to sort by a column that is in a separate table? Is this possible? Would I need to provide you guys with any more information before this question could be answered? Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Undefined Offset/Index
I've been playing with CakePHP for a few weeks now and just when I thought I was getting the hang of things, I've run into a problem I can't quite figure out. I keep getting the following notices whenever I run the html checkbox helper in Cake 1.1. Notice: Undefined offset: 1 in C:\Program Files\Apache Group \Apache2\htdocs\alpha\cake\libs\view\helpers\html.php on line 947 Notice: Undefined index: value in C:\Program Files\Apache Group \Apache2\htdocs\alpha\cake\libs\view\helpers\html.php on line 279 I know there is nothing wrong with the model or controller because if I build the checkbox using traditional html, shown in the second commented line, I don't get any errors. Any help would be appreciated, thanks. echo ''.$html->checkbox($catalogstory['CatalogStory'] ['story_id']).''; //echo ''; --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Help for begginer.. problem with retrieving data from two models in one controller
maked On Jul 25, 5:37 pm, apadzik <[EMAIL PROTECTED]> wrote: > Hi! I'm a beginner in Cake and can't understand one thing, maybe you > more experienced people will know the solution:-) > So, I have two tables in db: products (id,name) and productsizes > (id,product_id,size); > Two models: Product, Productsize; > > product.php: > class Product extends AppModel > { > var $name = 'Product'; > var $hasMany = array('Productsize' => array( > 'className'=>'Productsize', > 'foreignKey'=>'product_id') > ); > > } > > productsize.php: > class Productsize extends AppModel > { > var $name = 'Productsize'; > var $belongsTo = 'Product'; > > } > > And products_controller looks like: > class ProductsController extends AppController > { > var $name = 'Products'; > var $uses = array('Product','Category','Productsize'); > var $layout = 'default'; > > function display($c_name) { > $this->set('category_name',$c_name); > //this > is just > $c_id=$this->Category->find('name=\''.$c_name.'\'','id'); > //for > retrivieng category > > $this->set('products',$this->Product->findAllByCategoryId($c_id['Category']['id'])); >//here i get all > > data about products > $this->pageTitle = $c_name; > } > > } > > And my question is: how do I retrieve data from productsizes? In > action "display" I want to show all products from one category and I > need to display the possible sizes for each one. How to do that in one > action? > > Controller: products_controller --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: PhpCaptcha Component Help
Yes. My index() function is my form and also my validation for the captcha. I have tried to add this code.. function index() { print_r($this->data); //echo $_SESSION[CAPTCHA_SESSION_ID]."///"; //Array ( [Email] => Array ( [name] => sdfgsdfs [message] => sdfsdfsfsdsdf ) ) $client_name = $this->data['Email']['name']; $client_message = $this->data['Email']['message']; $client_userCode = $this->data['Email']['userCode']; if (!empty($this->data)) { //$this->render(); if ($this->Captcha->check($this->data['Email']['userCode'])) { if ($this->Email->save($this->data)) { // Flash that it has been sent $this->flash('Your email has been sent.','/emails'); } // end: if ($this->Email->save($this->data)) } // end: if ($this->Captcha->check($this->data['Email'] ['userCode'])) { else { $this->render(); } } // end: if (empty($this->data)) } // end of function sent If data is !empty, process what i wish. Else, $this->render(); I have deleted the redirection, and its not being redirected once the form is not yet filled-up. Although, my next problem is the validation error. Which i placed before and have tested. Name: input('Email/name', array('class' => 'input', 'style' => 'width: 200px;')); ?> tagErrorMsg('Email/name', 'Name is required.'); ?> Message: textarea('Email/message', array('rows'=>'10', 'cols'=>'40')); ?> tagErrorMsg('Email/message', 'Message is required.'); ?> Captcha: input('Email/userCode', array('class' => 'input', 'style' => 'width: 200px;')); ?> tagErrorMsg('Email/userCode', 'Captcha is required.'); ?> Is not working anymore, what could i be missing? BTW, i also have models/email.php with var $validate = array( 'name' => VALID_NOT_EMPTY, 'message' => VALID_NOT_EMPTY, 'userCode' => VALID_NOT_EMPTY ); Please help. Louie Miranda http://www.axisihift.com On Jul 26, 11:49 am, Grant Cox <[EMAIL PROTECTED]> wrote: > Is your index() function the form? > > If so, to re-show the form just call render(), or let the execution > fall out the bottom, where render() will be automatically called. > Don't redirect the user - this will cause a whole new page request and > so the existing data is lost. > > If your index() is not your form (just the form processor), then you > will need to explicitly call render with the correct view to show. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: ajax submit form problem
Try using $ajax->submit() instead of $form->submit(); Geoff -- http://lemoncake.wordpress.com On Jul 26, 2:05 pm, Michael Augustyniak <[EMAIL PROTECTED]> wrote: > Grant Cox wrote: > > Be more clear with your question - what is the problem, and what do > > you want to achieve? > > > The only think I could see that is wrong, is if you submit an empty > > field, it should still come through to $this->data['User']['nickname']. > > > --~--~-~--~~- > > yes, but the point is that if I will submit an empty field there is no > > $this->data['User']['nickname'] , it's just $this->data = null --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: ajax submit form problem
Grant Cox wrote: > Be more clear with your question - what is the problem, and what do > you want to achieve? > > The only think I could see that is wrong, is if you submit an empty > field, it should still come through to $this->data['User']['nickname']. > > > --~--~-~--~~- yes, but the point is that if I will submit an empty field there is no $this->data['User']['nickname'] , it's just $this->data = null --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: PhpCaptcha Component Help
Is your index() function the form? If so, to re-show the form just call render(), or let the execution fall out the bottom, where render() will be automatically called. Don't redirect the user - this will cause a whole new page request and so the existing data is lost. If your index() is not your form (just the form processor), then you will need to explicitly call render with the correct view to show. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: ajax submit form problem
Be more clear with your question - what is the problem, and what do you want to achieve? The only think I could see that is wrong, is if you submit an empty field, it should still come through to $this->data['User']['nickname']. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Are Model objects supposed to be used like singletons?
It doesn't matter if you do instance the models yourself, but they don't need to be. The only hazards in this is if a $Model->id is already set, then a future save (without id field) will perform an UPDATE, not an INSERT. But if you follow the recommended practice of calling $Model->create() before a save, then you have no problems. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Calling public function of a class from within another class
> Am I missing something simplistic here? Yes, $this->Product (and $this->Product->User) are instances of your Model, not controller. While you could use requestAction to call the other controller, this is slow, and all data functionality like that really should be in your model anyway. So, move the addFavorite() function into your User model, and keep the code that you already have. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Updating/Inserting/Saving to the HABTM look up table
I don't think HABTM saves have changed from 1.1, so you should look at the manual (Models, "Saving hasAndBelongsToMany Relations"), and search this group, it has been covered before. In your case, you will want to save something like: if (!empty($this->data['Artist'])) { // move the "genre_id" attribute into the Cake HABTM connection $this->data['Genre']['Genre'] = array( $this->data['Artist'] ['genre_id'] ); $this->Artist->create(); $result = $this->Artist->save($this->data); } Note - this is off the top of my head and I haven't used HABTM associations much, but I think it's about right. There have been a few helper functions made to enhance HABTM too, if you just want to add / remove single associations rather than redoing the whole lot. http://bakery.cakephp.org/articles/view/alternative-methods-for-working-with-hasandbelongstomany-associations http://bakery.cakephp.org/articles/view/add-delete-habtm-behavior --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
PhpCaptcha Component Help
I was able to follow this guide from the bakery: http://bakery.cakephp.org/articles/view/captcha-component-with-phpcaptcha And was able to install it on my machine, although. Im having troubles validating the captcha. I mean i don't know if its the right thing to do. Ok, so i can now see the image. Also added on the views (input field) for userCode. Now, the validation. Here goes.. Created my component controllers/component/captcha.php Added it to my controller controllers/emails_controller.php var $components = array('SwiftMailer','Captcha'); function captcha_image() { $this->Captcha->image(); } function index() { // my post ... $client_userCode = $this->data['Email']['userCode']; if ($this->Captcha->check($this->data['Email']['userCode'])) { ... } else {// else captcha $this->flash('Error in captcha','/emails'); } } I was able to validate the user input by user, but when the error kick's in. I can't go back to the form. And, is this the proper way to validate? if ($this->Captcha->check($this->data['Email']['userCode'])) { ... } else {// else captcha $this->flash('Error in captcha','/emails'); } Please help! thanks. Louie Miranda http://www.axishift.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: html helper: Akamai for images?
You can pass a full path to the HTML helper image function. echo $html->image( 'http://cakephp.org/img/cake.power.png', array('alt'=>'CakePHP!') ); On Jul 26, 12:24 pm, Beth <[EMAIL PROTECTED]> wrote: > Hi, > > I've got a client who is using Akamai for hosting their images (tons > of photos). Does anyone have a html helper that supports specifying > the full image src instead of cake's relative path? > > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: html->link and html-image
Yes, set the last parameter of $html->link() to false, so it doesn't escape the html of the title (which is your image source). $thumb_img = $html->image('yourimage.jpg'); echo $html->link( $thumb_img, '/your/link', array(), false, false ); On Jul 26, 12:44 pm, roliver <[EMAIL PROTECTED]> wrote: > Hi all, > > Is it possible to use $html->link and $html->image together. As in > wrapping html->link around the html->image so that an anchor tag can > be added to the image so the user can click it? > > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
html->link and html-image
Hi all, Is it possible to use $html->link and $html->image together. As in wrapping html->link around the html->image so that an anchor tag can be added to the image so the user can click it? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
html helper: Akamai for images?
Hi, I've got a client who is using Akamai for hosting their images (tons of photos). Does anyone have a html helper that supports specifying the full image src instead of cake's relative path? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Updating/Inserting/Saving to the HABTM look up table
I have been racking my brains for a few days on this, I am new to cake and have been building an experimental application, trying to use as much of the cake functionality as possible to learn it. Using cake 1.2 The issue I am having is, I cannot not insert/update to a lookup table from a HABTM association. I have an artist(s) controller and model and a genre(s) controller and model. When I add a new artist to the database I grab the last id inserted and the genre id from the post array and try to insert it into the artists_genres table under the artists_id and genres_id columns, I have tried this a multitude of ways from afterSave to doing it right in the controller add() function, but to no avail I have not been able to get it right. this is my add function from my Artists controller with the suspect code function add() { $this->set("genreList",$this->Genre->generateList(null, 'name ASC', null, '{n}.Genre.id','{n}.Genre.name')); if (!empty($this->data['Artist'])) { $this->Artist->create(); $result = $this->Artist->save($this->data['Artist']); //get last id $last_id = $this->Artist->getLastInsertId(); //get genre id $genre_id = $this->data['Artist']['genre_id']; //insert into lookup table //I know bad coding; should use save() $this->query("INSERT INTO artists_genres (artists_id, genres_id) VALUES ('". $last_id."','".$genre_id."') "); if($result){ $this->flash('Your artist has been added.','/artists/view/'. $last_id,'3'); } } } As you can suspect I get: Fatal error: Call to undefined method ArtistsController::query() in C:\AppServ\www\bakemeagig\app\controllers \artists_controller.php on line 54 Like i said I have tried this in the Artist model as well as a beforeSave(), but I couldn't figure out how to carry the variables over to the model to insert them. This is like the last piece of the puzzle for me. I feel once I figure this out I'll have a pretty good grasp of cake and be able to advance to more complex apps. Any help with this will be truly appreciated, like I said this is like the last piece of a puzzle that once I see it and understand it I'll be on my way. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: How to build form with multiple records?
Hmm.. Very interesting. I had not seen that before. I might have a play later on and see if I can get it to work. I'll let you know how I go. Geoff -- http://lemoncake.wordpress.com On Jul 26, 8:49 am, chewie124 <[EMAIL PROTECTED]> wrote: > Ahhh... ok. Thanks for the input. I was grepping thru the > helpers.php library in the cake core, and it looks like in the > setFormTag function , if there's a 3rd level branch,ie FormerEmployer. > 2.name, the '2' will get parsed and tagged as the 'modelId'. Seems > like though, the propigation hasn't made it back to the form helper, > that can use the modelId to generate the input tags as you described > above. Thanks for the input! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Model::beforeValidate -- bug or feature? :)
you should use Model::invalidate() in beforeValidate. Otherwise use beforeSave and return false if you need to stop execution. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Mambo to use CakePHP for V5
To join my fellow bakers: I'm very happy to see a major open source CMS project like Mambo moving to CakePHP. From my point of view this is a great chance to silence the ones in the PHP community who still think 'frameworks' are trapping you in a box rather then given you this box to stand upon when reaching for the cookies in the top-drawer ; ). So welcome Mambo developers and community - this truly is great news for all of us bakers out there! -- Felix Geisendörfer -- My Blog: http://www.thinkingphp.org My Business: http://www.fg-webdesign.de chanh.ong wrote: > My name is Chanh and I am a member of the Mambo Core team. > > Look like Mambo on Cake is well receive here! > > Thanks for the welcome! > > On Jul 25, 4:52 am, Tijs Teulings <[EMAIL PROTECTED]> wrote: > >> sweet! and welcome to the community :) >> >> Tijs >> >> On 25-jul-2007, at 13:20, cauld wrote: >> >> >> >> >>> The installer prototype I wrote for Mambo utilizes 1.1, but I will be >>> redoing it with 1.2 soon. Mambo 5 will go with 1.2. >>> >>> On Jul 25, 2:49 am, "Sascha Fröhlich" <[EMAIL PROTECTED]> >>> wrote: >>> Heya, good news. I wonder whether you will use 1.1 or 1.2 (stable or feature rich :-))? Best regards, Sascha 2007/7/25, bugfaceuk <[EMAIL PROTECTED]>: > It's almost bizarre, I have just started fiddling with Cake in the > last week... and look after a Joomla site, and was thinking "the > reason I haven't developed shed loads of components is that it needs > to be integrated with Cake, hell even built on it"... > > And now Mambo have made this move. I will watch with great interest, > and when you do release on Cake, I think you can expect a flood of > components/modules and god knows what else > > A brave decision, well made. > > On Jul 25, 1:24 am, cauld <[EMAIL PROTECTED]> wrote: > >> Hello everyone, >> >> My name is Chad Auld. I am the Project Leader for Mambo. Seemed >> appropriate to stop by this thread and introduce myself. We are >> excited about the decision and looking forward to forming a very >> close >> relationship with the CakePHP development team and community. >> Anyway, >> we are here and paying attention to current CakePHP developments >> and >> the Google Group discussions for now. More to come as it >> happens... >> >> Cheers! >> >> On Jul 23, 10:48 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> >> wrote: >> >>> Exciting news -http://www.source.mambo-foundation.org/content/ >>> view/126/1/ >>> >>> Will there be a corresponding announcement from CSF? >>> >>> What does it mean for future of CakePHP? >>> >>> T >>> >>> -- >>> = >>> Cheesecake-Photoblog:http://cheesecake-photoblog.org >>> PHP for E-Biz:http://sanisoft.com >>> = >>> > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Mambo to use CakePHP for V5
My name is Chanh and I am a member of the Mambo Core team. Look like Mambo on Cake is well receive here! Thanks for the welcome! On Jul 25, 4:52 am, Tijs Teulings <[EMAIL PROTECTED]> wrote: > sweet! and welcome to the community :) > > Tijs > > On 25-jul-2007, at 13:20, cauld wrote: > > > > > The installer prototype I wrote for Mambo utilizes 1.1, but I will be > > redoing it with 1.2 soon. Mambo 5 will go with 1.2. > > > On Jul 25, 2:49 am, "Sascha Fröhlich" <[EMAIL PROTECTED]> > > wrote: > >> Heya, > > >> good news. I wonder whether you will use 1.1 or 1.2 (stable or > >> feature > >> rich :-))? > > >> Best regards, > >> Sascha > > >> 2007/7/25, bugfaceuk <[EMAIL PROTECTED]>: > > >>> It's almost bizarre, I have just started fiddling with Cake in the > >>> last week... and look after a Joomla site, and was thinking "the > >>> reason I haven't developed shed loads of components is that it needs > >>> to be integrated with Cake, hell even built on it"... > > >>> And now Mambo have made this move. I will watch with great interest, > >>> and when you do release on Cake, I think you can expect a flood of > >>> components/modules and god knows what else > > >>> A brave decision, well made. > > >>> On Jul 25, 1:24 am, cauld <[EMAIL PROTECTED]> wrote: > Hello everyone, > > My name is Chad Auld. I am the Project Leader for Mambo. Seemed > appropriate to stop by this thread and introduce myself. We are > excited about the decision and looking forward to forming a very > close > relationship with the CakePHP development team and community. > Anyway, > we are here and paying attention to current CakePHP developments > and > the Google Group discussions for now. More to come as it > happens... > > Cheers! > > On Jul 23, 10:48 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> > wrote: > > > Exciting news -http://www.source.mambo-foundation.org/content/ > > view/126/1/ > > > Will there be a corresponding announcement from CSF? > > > What does it mean for future of CakePHP? > > > T > > > -- > > = > > Cheesecake-Photoblog:http://cheesecake-photoblog.org > > PHP for E-Biz:http://sanisoft.com > > = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: How to build form with multiple records?
Ahhh... ok. Thanks for the input. I was grepping thru the helpers.php library in the cake core, and it looks like in the setFormTag function , if there's a 3rd level branch,ie FormerEmployer. 2.name, the '2' will get parsed and tagged as the 'modelId'. Seems like though, the propigation hasn't made it back to the form helper, that can use the modelId to generate the input tags as you described above. Thanks for the input! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: How to build form with multiple records?
You will have to create the inputs the old fashioned way, and create the empyer records as an array that you can loop over when posted back. In the controller function use $this->set('formerEmployers', $this- >FormerEmployer->findAllByApplicantId($applicant_id)); Then in the view, make sure you include FormerEmplyee id if it is an edit and do something like " /> " /> Then in the post back you can loop over the records with foreach ($this->data['FormerEmployers'] as $employer){ $this->FormerEmployer->create(); // you need this line to stop the model repeatedly saving over the initial record $toSave = array("FormerEmployer" => $employer); $this->FormerEmployer->Save($toSave); } Geoff -- http://lemoncake.wordpress.com On Jul 26, 7:42 am, chewie124 <[EMAIL PROTECTED]> wrote: > Hi All - > I'm have a job-board app that has a Resume model which hasMany > FormerEmployer models (like for employment history). There's plenty > of discussion on how to save the data on the controller side (at > least, that I've been able to find), but my question is, is how do you > build up the form, so when I hit submit, it will send the Resume and > the associated FormerEmployer (more than one) data fields that I can > handle back in the controller? > > Can somebody fill in the missing pieces for me? > > input('first_name'); ?> > input('last_name'); ?> > > Former Employers > data['FormerEmployer'] as $employer): // THIS > ISN'T RIGHT... ?> > input('FormerEmployer.name'); ?> > > > > I'm using cake 1.2... > > Thanks, > Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
HABTM self-referencing question
This may have been answered already but the search is for some reason not working well for me. My HABTM looks like this: var $hasAndBelongsToMany = array('parameters' => array('className' => 'Wac', 'joinTable' => 'wacs_params', 'foreignKey'=> 'wacs_id', 'associationForeignKey' => 'params_id', 'conditions'=> 'parameters.is_param=1', 'order' => 'sort_order ASC', 'unique'=> true ) ); My question is, when I use scaffolding, my SQL in the *add* view to fetch the possible children for the item I am adding looks like this: SELECT `Wac`.`id` FROM `wacs` AS `Wac` WHERE 1 = 1 The thing I am missing is: "parameters.is_param=1", i.e. what happened to the "conditions"? I know, I know, "parameters.is_param=1" wont work with the above SQL but it should still be there?! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
[Cake 1.2] Model::beforeValidate -- bug or feature? :)
Hello. When Model::beforeValidate() returns false, but Model::validationErrors is empty Model::save() execution continues. It's a bug? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
fck editor accessing data
How do access form data from the fck editor? When I output $this->data none of the changes to the textarea are displayed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
How to build form with multiple records?
Hi All - I'm have a job-board app that has a Resume model which hasMany FormerEmployer models (like for employment history). There's plenty of discussion on how to save the data on the controller side (at least, that I've been able to find), but my question is, is how do you build up the form, so when I hit submit, it will send the Resume and the associated FormerEmployer (more than one) data fields that I can handle back in the controller? Can somebody fill in the missing pieces for me? input('first_name'); ?> input('last_name'); ?> Former Employers data['FormerEmployer'] as $employer): // THIS ISN'T RIGHT... ?> input('FormerEmployer.name'); ?> I'm using cake 1.2... Thanks, Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Get data from Model that has no association
your welcome (I'm old, not deaf, no need to yell ;) Sam D On 7/25/07, starkey <[EMAIL PROTECTED]> wrote: > > THANK YOU! > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Get data from Model that has no association
THANK YOU! On Jul 25, 5:00 pm, rtconner <[EMAIL PROTECTED]> wrote: > I'm not fully sure if it's the best way, but I've always used the > loadModel function. > > On Jul 25, 2:57 pm, starkey <[EMAIL PROTECTED]> wrote: > > > Hello, > > > How do I access a model that is not associated in any way to the > > current model? For example, lets say I'm in FooController and I need > > data from the Bar table (or save data to it)... without having any > > defined association (e.g. belongsTo or hasMany). > > > Sounds easy but I'm stumbling on it. > > > Thanks a lot! > > Shawn --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Get data from Model that has no association
I'm not fully sure if it's the best way, but I've always used the loadModel function. On Jul 25, 2:57 pm, starkey <[EMAIL PROTECTED]> wrote: > Hello, > > How do I access a model that is not associated in any way to the > current model? For example, lets say I'm in FooController and I need > data from the Bar table (or save data to it)... without having any > defined association (e.g. belongsTo or hasMany). > > Sounds easy but I'm stumbling on it. > > Thanks a lot! > Shawn --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Get data from Model that has no association
look in http://manual.cakephp.org/chapter/controllers in Variables (hint word is 'uses') On 7/25/07, starkey <[EMAIL PROTECTED]> wrote: > > Hello, > > How do I access a model that is not associated in any way to the > current model? For example, lets say I'm in FooController and I need > data from the Bar table (or save data to it)... without having any > defined association (e.g. belongsTo or hasMany). > > Sounds easy but I'm stumbling on it. > > Thanks a lot! > Shawn > > > > > -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: change view of scaffolding
You could also have a look here: http://manual.cakephp.org/chapter/scaffolding --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Get data from Model that has no association
Hi, declare $uses in your model which shall retrieve data from the other model: var $uses = array('Foo', 'Bar'); Regards, Sascha Am 25.07.2007 um 22:57 schrieb starkey: > > Hello, > > How do I access a model that is not associated in any way to the > current model? For example, lets say I'm in FooController and I need > data from the Bar table (or save data to it)... without having any > defined association (e.g. belongsTo or hasMany). > > Sounds easy but I'm stumbling on it. > > Thanks a lot! > Shawn > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Get data from Model that has no association
Hello, How do I access a model that is not associated in any way to the current model? For example, lets say I'm in FooController and I need data from the Bar table (or save data to it)... without having any defined association (e.g. belongsTo or hasMany). Sounds easy but I'm stumbling on it. Thanks a lot! Shawn --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Calling public function of a class from within another class
Hello all! I'm just starting to jump in to the wide world of CakePHP (v1.1 to be safe) and have read through the manual (forgot more than I remember, but it was good to get acquainted), watched the video tutorials, and am now going through the IBM DeveloperWorks tutorials "Cook up Web sites fast with CakePHP". I've gone through the tutorial, noticing *small* mistakes, errors, and incompatibilities throughout; most of them I either understood what was wrong and ignored, or fixed myself. However, there is one portion I'm not sure of... I have two models (in regard to the problem), a User model, and a Product model. The relationship is as follows: User hasAndBelongsToMany Product Product hasAndBelongsToMany User In the code examples on the DeveloperWorks site, there was a place for "users" to create their favorite list of "products". In doing so, it called the following code from the products_controller: $success = $this->Product->User->addFavorite($id); I keep getting an SQL error that the SQL query of "addFavorite" is incorrect. So, what I'm assuming here is that when accessing variables of a class, if the variable being accessed of a class in a controller is that of another class, only the variables of that class are accessible, and functions are not; that functions are expected to be a query or CakePHP internal function? The (public) "addFavorite" function does exist within the users_controller file, but it never runs as Cake is running the name of the function as a query instead. Am I missing something simplistic here? I'm not concerned about the views or any other functionality, just as to why a function name is being used as an SQL query. I have a feeling it would be beneficial to know this when it comes time for me to finish going through tutorials and finally sit down and do something for myself. Thank you for any and all help! It's much appreciated! You guys (and gals) rock! ...or bake! ;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Security and requirePost
Well, I think I'll asume that nobody use requirePost. My new question is: how could I simulate the requirePost functionality ? Thanks in advance C On Jul 24, 7:24 pm, Cacho <[EMAIL PROTECTED]> wrote: > Hi > > I've been following tutorials to process my data and saw the > recommendation to use formTag. But after to have some problems and > search here and there I noticed that it was deprecated. > > I said "ok", but I noticed that requirePost is supposed to work with > some hidden data generated by formtag so I wonder which is the new way > to process a form in a secure way. > > Also, I would like to know if should I write html input fields in my > views or use html helpers for this purpose. Which is better / > recommended ? > > Thanks in advance > > C --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: alternating row colour
Use Cake's built in helper $html->tableCells($data, $oddTrOptions, $evenTrOptions); http://api.cakephp.org/class_html_helper.html#700103d203caef2891285438b324122b On Jul 25, 2:19 pm, Mech7 <[EMAIL PROTECTED]> wrote: > I use something like this.. > > $article): ?> > > > > > You basically only need 1 class for the even numbers(or uneeven :p) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: struggling with access control
Hi, The problem is in the way you create your ACO. You can read this article http://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x for more information on how to create Acos or Aros. I would recommend that you use the Acl Behavior in your Task Model. Ketan StanMoong wrote: > Hello, > > I'm trying create a module where users can create tasks. So, for the > add() function in the TasksController, there is this portion of the > code that gives access to the user. > > if ($this->Task->save($this->data)) { > $task_id = $this->Task->id; > $task_alias = $task_id.'-'.$this->data['Task']['title']; > > $aco = new Aco(); > $aco->create($task_id, $user_id, $task_alias); > $this->Acl->allow('Users', $task_alias, 'read'); > $this->Acl->allow($this->Session->read('user'), $task_alias, '*'); > $this->Session->setFlash('The Task has been saved'.' '.$this->Session- > >read('user').' '.$task_alias); > $this->redirect('/tasks/index'); > } > > I can't understand why the error is thrown when I try to add a task, > which result in the ACO not created, and subsequently no ACL record is > created. > > [Thu Jul 26 00:28:54 2007] [error] [client 127.0.0.1] PHP Warning: > Null parent in Aco::create() in E:\\Web\\WebServer\\Apache2_2_4\\htdocs > \\cake\\libs\\controller\\components\\dbacl\\models\\aclnode.php on > line 82, referer: http://localhost/tasks/add > > > I've added additional debug message to print out the values: > > [Thu Jul 26 00:28:54 2007] [error] [client 127.0.0.1] PHP Warning: > parentId = [7], count(parent)=[1], parent=[] in E:\\Web\\WebServer\ > \Apache2_2_4\\htdocs\\cake\\libs\\controller\\components\\dbacl\\models > \\aclnode.php on line 83, referer: http://localhost/tasks/add > > Any idea??? > > Been stuck for couple of days :( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: alternating row colour
I use something like this.. $article): ?> > You basically only need 1 class for the even numbers(or uneeven :p) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
struggling with access control
Hello, I'm trying create a module where users can create tasks. So, for the add() function in the TasksController, there is this portion of the code that gives access to the user. if ($this->Task->save($this->data)) { $task_id = $this->Task->id; $task_alias = $task_id.'-'.$this->data['Task']['title']; $aco = new Aco(); $aco->create($task_id, $user_id, $task_alias); $this->Acl->allow('Users', $task_alias, 'read'); $this->Acl->allow($this->Session->read('user'), $task_alias, '*'); $this->Session->setFlash('The Task has been saved'.' '.$this->Session- >read('user').' '.$task_alias); $this->redirect('/tasks/index'); } I can't understand why the error is thrown when I try to add a task, which result in the ACO not created, and subsequently no ACL record is created. [Thu Jul 26 00:28:54 2007] [error] [client 127.0.0.1] PHP Warning: Null parent in Aco::create() in E:\\Web\\WebServer\\Apache2_2_4\\htdocs \\cake\\libs\\controller\\components\\dbacl\\models\\aclnode.php on line 82, referer: http://localhost/tasks/add I've added additional debug message to print out the values: [Thu Jul 26 00:28:54 2007] [error] [client 127.0.0.1] PHP Warning: parentId = [7], count(parent)=[1], parent=[] in E:\\Web\\WebServer\ \Apache2_2_4\\htdocs\\cake\\libs\\controller\\components\\dbacl\\models \\aclnode.php on line 83, referer: http://localhost/tasks/add Any idea??? Been stuck for couple of days :( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Paginator HELPER, Ajax mode, IE7 problems
Hey Nate, well I downgraded my prototype version to 1.5.0 with scriptaculous 1.7 While other ajax calls work with IE7, it seems that the paginator still struggles. check it out here: http://www.intellighenziaproject.it/ Dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: alternating row colour
rtanz wrote: > how can i recreate scaffolding's use of alternating row colour in the > list views? they seem to disappear when i bake the views Just do the following, cakephp has a built in function for alternating color rows, but fails when any advanced displaying is applied. Follow my form below for advanced sorting that allows rows to be highlited when conditions are met --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
ajax submit form problem
problem to pass the data form form form(array('action' => '/user/register'), 'post',array('update' => 'registerFormDiv'));?> input('User/nickname', array( 'type' => 'text')).''.$error->messageFor('User/nickname'); ?> submit('Register')?> The problem is that if I leave the field blank the $this-data is null, I have to type something to have $this->data['User]['nickname'] not null I checked also with $this->params['data'] same thing. my function var $helpers = array('Javascript','Ajax'); var $components = array ('RequestHandler'); function register() { $this->layout = 'ajax'; //if (!empty($this->data['User'])) if (!empty($this->params['data']['User'])) { --- if there is no data in field it does not get in to this point -- } } thanks for help --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: i18n translation in db tables - how to do this like Symfony?
Damn copy&paste... the last lines of the function are missing: @ignore_user_abort((bool) $this->runtime[$model->name] ['ignoreUserAbort']); unset($this->runtime[$model->name]['ignoreUserAbort']); } On 25 jul, 18:34, Gorka <[EMAIL PROTECTED]> wrote: > In case it helps anyone, this is the solution I've come up with. > Please keep in mind that this is my own personal solution and may > conflict with active development by the core team. > > On your edit/add views you must use plain html instead of the form > helper, because it won't generate data[Model][Field][locale] names no > matter what you try. IMHO, this is something to look into, because it > also adds difficulties dealing with file input arrays and the like. > Anyhow, the input fields should look like: > > id="ModelFieldLocale" /> > > I've rewritten the afterSave() function of TranslateBehaviour like > follows to allow working with the new field arrays. This should > probably better be pasted somewhere else, feel free to do so if you > feel like it. > > function afterSave(&$model, $created) { > $locale = $this->_getLocale($model); > > if (empty($locale) || is_array($locale) || > empty($this->runtime[$model->name]['beforeSave'])) { > > return true; > } > $tempData = $this->runtime[$model->name]['beforeSave']; > unset($this->runtime[$model->name]['beforeSave']); > > $conditions = array('model' => $model->name, > 'row_id' => > $model->id); > > if ($created) { > foreach ($tempData as $field => $value) { > if (!is_array($value)) { > $value = array($locale=>$value); > } > > foreach ($value as $lang=>$content) { > $this->_model->Content->create(); > > $this->_model->Content->save(array('I18nContent' => > array('content'=>$content))); > > $this->_model->create(); > $this->_model->save(array('I18nModel' => > am($conditions, > array( > >'locale' > => $lang, > > 'i18n_content_id' => $this->_model->Content->getInsertID(), > >'field' => > $field; > } > } > } else { > $this->_model->recursive = -1; > $translations = $this->_model->findAll($conditions, > array('field', > 'i18n_content_id', 'locale')); > $values = Set::extract($translations, > '{n}.I18nModel'); > > foreach ($values as $translation) { > $field = $translation['field']; > if (array_key_exists($field, $tempData)) { > if (!is_array($tempData[$field])) { > $tempData[$field] = > array($locale=>$tempData[$field]); > } > if (array_key_exists($translation['locale'], > $tempData[$field])) { > $this->_model->Content->create(); > > $this->_model->Content->save(array('I18nContent' => > array( > > 'id'=> > $translation['i18n_content_id'], > > 'content'=> > $tempData[$field][$translation['locale']]))); > } > } > } > > } > > There is sure plenty of room for improvement, but it works for me. > > I'm still trying to figure out how to define a default locale and > dealing with the different locales set by IE7 & Firefox (spa/es-es). > This last issue is really annoying, as it hides one's records from the > other when using locale autodetection. > > Comments, improvements and suggestions are more than welcome :) > > On 25 jul, 14:33, Gorka <[EMAIL PROTECTED]> wrote: > > > > > I tried a similar approach and most likely will end up using it due to > > time constraints for the project. Still, i18n support is a great step > > in Cake's maturity road, and I'd love to make it work even if it was > > in a not-so-elegant way. In fact, maybe Cake Foundation may study > > donation-promoted development. I'd be more than happy to donate to see > > this functionallity working! > > > On 25 jul, 01:56, oleonav <[EMAIL PROTECTED]> wrote: > > > > On Jul 24, 12:09 am, Gorka <[EMAIL PROTECTED]>
Re: i18n translation in db tables - how to do this like Symfony?
In case it helps anyone, this is the solution I've come up with. Please keep in mind that this is my own personal solution and may conflict with active development by the core team. On your edit/add views you must use plain html instead of the form helper, because it won't generate data[Model][Field][locale] names no matter what you try. IMHO, this is something to look into, because it also adds difficulties dealing with file input arrays and the like. Anyhow, the input fields should look like: I've rewritten the afterSave() function of TranslateBehaviour like follows to allow working with the new field arrays. This should probably better be pasted somewhere else, feel free to do so if you feel like it. function afterSave(&$model, $created) { $locale = $this->_getLocale($model); if (empty($locale) || is_array($locale) || empty($this- >runtime[$model->name]['beforeSave'])) { return true; } $tempData = $this->runtime[$model->name]['beforeSave']; unset($this->runtime[$model->name]['beforeSave']); $conditions = array('model' => $model->name, 'row_id' => $model->id); if ($created) { foreach ($tempData as $field => $value) { if (!is_array($value)) { $value = array($locale=>$value); } foreach ($value as $lang=>$content) { $this->_model->Content->create(); $this->_model->Content->save(array('I18nContent' => array('content'=>$content))); $this->_model->create(); $this->_model->save(array('I18nModel' => am($conditions, array( 'locale' => $lang, 'i18n_content_id' => $this->_model->Content->getInsertID(), 'field' => $field; } } } else { $this->_model->recursive = -1; $translations = $this->_model->findAll($conditions, array('field', 'i18n_content_id', 'locale')); $values = Set::extract($translations, '{n}.I18nModel'); foreach ($values as $translation) { $field = $translation['field']; if (array_key_exists($field, $tempData)) { if (!is_array($tempData[$field])) { $tempData[$field] = array($locale=>$tempData[$field]); } if (array_key_exists($translation['locale'], $tempData[$field])) { $this->_model->Content->create(); $this->_model->Content->save(array('I18nContent' => array( 'id'=> $translation['i18n_content_id'], 'content'=> $tempData[$field][$translation['locale']]))); } } } } There is sure plenty of room for improvement, but it works for me. I'm still trying to figure out how to define a default locale and dealing with the different locales set by IE7 & Firefox (spa/es-es). This last issue is really annoying, as it hides one's records from the other when using locale autodetection. Comments, improvements and suggestions are more than welcome :) On 25 jul, 14:33, Gorka <[EMAIL PROTECTED]> wrote: > I tried a similar approach and most likely will end up using it due to > time constraints for the project. Still, i18n support is a great step > in Cake's maturity road, and I'd love to make it work even if it was > in a not-so-elegant way. In fact, maybe Cake Foundation may study > donation-promoted development. I'd be more than happy to donate to see > this functionallity working! > > On 25 jul, 01:56, oleonav <[EMAIL PROTECTED]> wrote: > > > > > On Jul 24, 12:09 am, Gorka <[EMAIL PROTECTED]> wrote: > > > > Actually, $form->input('TransName.eng.content') renders something like > > > this for me: > > > > > > id="TransNameContent" /> > > > > This is obviously not very useful when editing multiple languages at > > > the same time (mostly in the admin area for defining name, > > > description, etc... of an item). Has anyone found a method for editing > > > multiple languages at the sameview? > > > Yes, I did find this out to. Not very useful. > > > > Oleonav, did you manage to get any closer to a s
Re: Struggling with CRON and the shell script within the console.
Yep, I got everything sorted out, but not components are not correctly loaded into the task I have. Everything is working, writing to the model etc., except for when I try to use the email component, I get an undefined stdClass::send() error. I looked at the shell.php and see that there is no option for var $components = array(), so I went ahead and added one, as well as this function that loads the components into the controller into the shell.php file function _initComponents() { $component = new Component(); $component->init($this); } This does not work either and seems very messy, does anyone have any idea on how to go about doing something like this in a cleaner fashion ? Thanks. On Jul 25, 8:37 am, John David Anderson <[EMAIL PROTECTED]> wrote: > On Jul 25, 2007, at 12:51 AM, inVINCable wrote: > > > > > Hey guys, > > > I apologize if this has been answered before, but I could not find it > > anywhere, and have been attempting to get this thing to work for the > > past 3 hours. I am using WAMP 5 and have tried to set up the console > > the way gwoo did in the screencast, followed directions exactly, but > > when I tried to call cake from th command like, I kept getting "'cake' > > is not recoginized as an internal or external command" > > Have you tried using the batch file rather than cake.php or php.exe? > There's a cake.bat file in the console directory that might help. > > -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: alternating row colour
On 7/25/07, rtanz <[EMAIL PROTECTED]> wrote: > > how can i recreate scaffolding's use of alternating row colour in the > list views? they seem to disappear when i bake the views Here's a great idea: 1) create something that uses the scaffolding 2) look in the code to see how it does the alternating row colouring 3) copy the code into your new app -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
alternating row colour
how can i recreate scaffolding's use of alternating row colour in the list views? they seem to disappear when i bake the views --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Struggling with CRON and the shell script within the console.
On Jul 25, 2007, at 12:51 AM, inVINCable wrote: > > Hey guys, > > I apologize if this has been answered before, but I could not find it > anywhere, and have been attempting to get this thing to work for the > past 3 hours. I am using WAMP 5 and have tried to set up the console > the way gwoo did in the screencast, followed directions exactly, but > when I tried to call cake from th command like, I kept getting "'cake' > is not recoginized as an internal or external command" Have you tried using the batch file rather than cake.php or php.exe? There's a cake.bat file in the console directory that might help. -- John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: change view of scaffolding
ok thanks :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: db design feedback
On Jul 25, 3:53 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > I think maybe you are trying *too* hard. ;) Any chance of reducing the try factor to 1 thread per topic? The advice offered to you in one thread doesn't seem to be taken into account with your replies to the other two. http://groups.google.com/group/cake-php/browse_frm/thread/88156e558cc37275 http://groups.google.com/group/cake-php/browse_frm/thread/9e4343b7a312d17c I'd follow Chris' motto, and failing that use the irc channel to shorten your discussion to a few minutes instead of a week. Cheers, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Multiple inserts of the same model, how to display validation error messages?
I have a form which gives the ability to add 3 records of the same model in one go. -- create('Content');?> //First record input('Content.use',array('type' => 'hidden','value'=>'yes')); echo $form->input('Content.title',array('error' => array( 'VALID_NOT_EMPTY'=>'Title is empty' ))); echo $form->input('Content.content'); ?> //record 2 input('Content_1.use',array('type' => 'checkbox','value'=>'yes')); echo $form->input('Content_1.title',array('error' => array( 'VALID_NOT_EMPTY'=>'Title is empty' ))); echo $form->input('Content_1.content'); ?> //record 3 input('Content_2.use',array('type' => 'checkbox','value'=>'yes')); echo $form->input('Content_2.title',array('error' => array( 'VALID_NOT_EMPTY'=>'Title is empty' ))); echo $form->input('Content_2.content'); ?> end('Submit');?> etc... -- When available the data the folowing $this->data array is available: Array ( [Content] => Array ( [use] => yes [title] => Some text [content] => fdddf dfdf ) [Content_1] => Array ( [use] => yes [title] => Some text for record 2 [content] => dsds ) [Content_2] => Array ( [use] => yes [title] => [content] => ds ) ) In the add controller action I use the folowing code to do validation on a record if the key 'use' is set to yes. If 'use' is not set then no validation is required and the record will not be added to the db. function add(){ if (!empty($this->data)) { $this->cleanUpFields(); //check first record of model 'Content' $this->Content->create(); $this->Content->data = $this->data; //if record one validates then check the rest of them if($this->Content->validates() == true){ foreach($this->data as $key => $val){ if($key != 'Content' && $val['use'] == 'yes'){ $this->Content->create(); //fed data of record 2 or 3 to the model $this->Content->data = $val; if($this->Content->validates() == true){ echo $key . ' is OK'; } else{ echo $key . ' has errors'; } } } echo 'OK'; //record saving code to be added... } else{ echo 'ERROR'; } } } --- Validation of all records will happen. The echo statements are pure for debugging purposes. When validation fails on one of the records with the status 'use' = 'yes', the form will be presented again, complete with all the values in it. Ok My problem is; How do I get the error messages in the view for records 2 & 3??? The error messages for record 1, where fields are named after the model, behave like expected, with error messages in place. Thanks, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Having trouble with RequestHandler...
On Jul 25, 3:59 pm, Steven Chan <[EMAIL PROTECTED]> wrote: > Hehe, > > Finally found out what was going on. It seems that I was using a > Controller::redirect() in the action that I called to render another > action. Because of this HTTP redirect, Firefox immediately would drop > the X-Requested-With header, plus a few others. However, the HTTP > redirect worked with IE6/7, weird... I used a setAction instead. So many ways to self-sabotage :D. Glad you found the reason. you could if you want override the redirect method in your app controller so that it does if (Ajax||requested) if (same controller) setAction else echo requestAction die else parent in that way you can 'safely' call $this->redirect in your code without worrying about cascading layouts (etc.) further Cheers, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: change view of scaffolding
Just use bake to generate your scaffolding view. On Jul 25, 9:23 pm, rtanz <[EMAIL PROTECTED]> wrote: > hi im still building my system using scaffolding, was wondering > whether i could change the fields that are displayed by scaffolding. > for example i would like to drop the display of the id field. I know > that scaffolding is supposed to be used in the intial phases only but > i am putting up something quickly for my client to review so i would > like to keep things as flexible as possible to make changes easier to > implement after the meeting with the client. whats the best thing for > me to do? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: change view of scaffolding
On Jul 25, 4:23 pm, rtanz <[EMAIL PROTECTED]> wrote: > hi im still building my system using scaffolding, was wondering > whether i could change the fields that are displayed by scaffolding. whats the best thing for me to do? use bake and edit the output. hth, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: bindmodel and the paginator not working / trac ticket 2201
On Jul 25, 12:21 pm, phpjoy <[EMAIL PROTECTED]> wrote: > you mean: > $this->WidgetMenu->bindModel( > array('hasOne' => array( > 'ModelName' => array( > 'className' => 'ModelName', > ) > ), > ), true); > i tried that, it doesn't work.. So in a week, you didn't look at the core code or api? I don't mean to sound accusative, but why not? https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/model/model.php#L502 AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
change view of scaffolding
hi im still building my system using scaffolding, was wondering whether i could change the fields that are displayed by scaffolding. for example i would like to drop the display of the id field. I know that scaffolding is supposed to be used in the intial phases only but i am putting up something quickly for my client to review so i would like to keep things as flexible as possible to make changes easier to implement after the meeting with the client. whats the best thing for me to do? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Struggling with CRON and the shell script within the console.
On 7/25/07, inVINCable <[EMAIL PROTECTED]> wrote: > Could someone please point me in the correct direction on where to go > from here. (I have watched the screencast several times btw) > To my untrained eye, it looks like you have a few problems here: 1) I don't think you've setup the path to the cake script properly When you use the console you always type 'cake ', like 'cake bake'. Don't do 'php cake ' 2) You can't call individual CakePHP libraries from the command line 'php libs\acl.php' will try and load and run that file. That's not what you need to do at all. -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Having trouble with RequestHandler...
Hehe, Finally found out what was going on. It seems that I was using a Controller::redirect() in the action that I called to render another action. Because of this HTTP redirect, Firefox immediately would drop the X-Requested-With header, plus a few others. However, the HTTP redirect worked with IE6/7, weird... I used a setAction instead. On Jul 24, 10:26 pm, AD7six <[EMAIL PROTECTED]> wrote: > On Jul 24, 3:34 pm, Steven Chan <[EMAIL PROTECTED]> wrote: > > > Yes js is enabled because the Ajax call actually works and data is > > returned. However, not only is the action template rendered but the > > layout is also rendered. > > Are you assuming that the header is missing, or you are 100% sure that > is the case? If so it's a prototype/weird rooter or firewall > (allegedly) problem. > > If you have any code in your app that does $this->layout = > 'something', that will override what the requestHandler kindly does > for you btw. > > Cheers, > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Struggling with CRON and the shell script within the console.
I should also add that I am just trying to create a simple CRON script, so maybe what I am trying to do is uncessary? Sincerely, inVINCEable On Jul 24, 11:51 pm, inVINCable <[EMAIL PROTECTED]> wrote: > Hey guys, > > I apologize if this has been answered before, but I could not find it > anywhere, and have been attempting to get this thing to work for the > past 3 hours. I am using WAMP 5 and have tried to set up the console > the way gwoo did in the screencast, followed directions exactly, but > when I tried to call cake from th command like, I kept getting "'cake' > is not recoginized as an internal or external command" > > So eventually just gave up on that and started calling things > traditionally cd'ing into my directory C:\wamp\www\cake\console, then > calling C:\wamp\php\php.exe from there. > > What I do not understand is how to call things from within the script, > everytime I use C:\wamp\php\php.exe cake, or C:\wamp\php\php.exe cake > acl or many other calls, I simply get a file (the .bat file im > assuming) that pops up and says "this is the bake application blah > blah" I even try to call the shell function directly, like C:\wamp\php > \php.exe libs\shell.php but I get this error, "Warning: > require_once(CAKEconsoleDSerror.php): failed to open stream: No such > file or directly in C:\wamp\www\cake\console\libs\shell.php on line > 29 > > Fatal error: require_once(): Failed opening required > 'CAKEconsoleDSerror.php'(include_path='.;C:\php5\pear') in C:\wamp\www > \cake\console\libs\shell.php on line 29 > > What bothers me about this is the call to pear, as I do not have pear > installed, nor do I have a directory php5, although my take is that it > shouldn't matter, as it first tries to call it from the correct path, > (the first error message) > > If I try to call C:\wamp\php\php.exe libs\acl.php I also get errors. > > Could someone please point me in the correct direction on where to go > from here. (I have watched the screencast several times btw) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: db design feedback
On 7/25/07, rtanz <[EMAIL PROTECTED]> wrote: > > im still trying to fully understand the concept of models, > associations and how this relates to my db tables. For example as far > as I can understand the relationship between modules and roles is > HABTM but then I cannot do this with the associations or i cannot > understand how it can be done. Where i have that table > modules_roles_users i would like to use that to connect a module to > its users and their respective roles, but how can i express that using > the cake associations. sorry if im missing something im trying really > hard to understand these concepts which are new for me > I think maybe you are trying *too* hard. ;) What I found worked for me when I first started learning about building relationships between tables is to do the actual database design LAST and first think about the relationships between the Models themselves. Once you get those relationships down, then actually build the tables making sure you have the foreign keys all set up correctly. Then you can get down to writing custom code like "Complete" vs. "Pending" as you've stated above. The old "walk before you run" argument. I know that it seems like a lot to learn, but it's not really that much. The manual's section on associations is good and should point you in the right direction. Has And Belongs To Many relationships are hard for some to understand (it tripped me up at first) but it sounds like you are trying to cram three relationships into where only two should go. I think I saw a posting in the last few days that pointed to an example of how to do what you are talking about. In the meantime, here's a link to check out: http://edivad.wordpress.com/2007/04/19/cakephp-hasandbelongstomany-habtm/ -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Help for begginer.. problem with retrieving data from two models in one controller
Thank's for answer and tip about the $c_id:) Ok, but how can I usa that generateList function if I don't have $product_id parameter? As I said I want to display all products from categories on one page, so my display action only handles category_id parameter, not product_id parameter. I tried the recursive way, it kinda worked but I still don't know how to use it;-) Let's say my view looks kinda like this: Name: Size: () //here I want to display a drop-down list of sizes that product is avaible in can't use the cause it gives me list of all sizes in the table don't know how to limit this $sizes thing to an appropriate product_id ;-( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: db design feedback
im still trying to fully understand the concept of models, associations and how this relates to my db tables. For example as far as I can understand the relationship between modules and roles is HABTM but then I cannot do this with the associations or i cannot understand how it can be done. Where i have that table modules_roles_users i would like to use that to connect a module to its users and their respective roles, but how can i express that using the cake associations. sorry if im missing something im trying really hard to understand these concepts which are new for me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Saving to database
Better use this->Box->create() before saving to create a new Model object -- Pablo Viojo [EMAIL PROTECTED] http://pviojo.net On 7/25/07, Unite <[EMAIL PROTECTED]> wrote: > > > Fixed it. Needed a $this->Box->id= null; in > if(!empty($temp)) { //incase user skipped that box > $this->Box->save($temp); //Writes over old data and > pointer doesnt > move > } > > On Jul 25, 12:43 pm, Unite <[EMAIL PROTECTED]> wrote: > > Heres the problem. I am filling in forms and saving them to a session. > > These forms are repeats of themselves so basically in the session a > > array of how ever many forms the user made is saved to the session. > > Simple terms a session gets saved as a array of a forms data eg: > > array(box1,box2,box3.). Now the problem I am having is that if I > > try save these forms to a table (exact fields) using a foreach loop > > only the last "box" is recorded. It seems to me that the > $this->Table->save() method is just replacing the old data with the new data > > > > instead of incrementing the id (primary key) so the pointer isnt > > moving onto the next record. Is there a way to force this behaviour? > > > > $templatedata = $this->Session->read('templatedata'); //This is the > > array of box's > > foreach($templatedata as $temp) { > > if(!empty($temp)) { //incase user skipped that box > > $this->Box->save($temp); //Writes over old data and > pointer doesnt > > move > > } > > > > } > > > > > ** > > example of output > > > ** > > Array //if a pr($temp) was in the if statement > > ( > > [sender_id] => 8 > > [index_id] => 2 > > [amt_fields] => 2 > > [box_name] => j > > [bg_colour] => j > > [hasborder] => No > > [border_colour] => j > > [font_colour] => j > > [font_style] => j > > [field0] => j > > [field1] => j > > ) > > > > Array //if a pr($temp) was in the if statement > > ( > > [sender_id] => 8 > > [index_id] => 4 > > [amt_fields] => 1 > > [box_name] => 5 > > [bg_colour] => 5 > > [hasborder] => Yes > > [border_colour] => 5 > > [font_colour] => 5 > > [font_style] => 5 > > [field0] => 5 > > ) > > > > Array //if a pr($this->Box->findAll()); was at end of function > > ( > > [0] => Array > > ( > > [box] => Array > > ( > > [id] => 1 > > [sender_id] => 8 > > [index_id] => 4 > > [amt_fields] => 1 > > [box_name] => 5 > > [logo] => > > [field0] => 5 > > [field1] => j //not ment to be here left over from > > first record > > [field2] => > > [field3] => > > [field4] => > > [field5] => > > [field6] => > > [field7] => > > [field8] => > > [field9] => > > [bg_colour] => 5 > > [font_colour] => 5 > > [font_style] => 5 > > [hasborder] => Yes > > [border_colour] => 5 > > ) > > > > ) > > > > } > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: db design feedback
On 7/25/07, rtanz <[EMAIL PROTECTED]> wrote: > Does the db structure enable me to do these things? thanks > What I don't understand is why don't you just try it? -- Chris Hartjes Senior Developer Cake Development Corporation My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Are Model objects supposed to be used like singletons?
Model objects, from my understanding, are instantiated once, and not meant to be explicitly instanced by your code, so you could call them singletons. I'm not sure what you're asking about recycling the object between contexts... that sounds like a very Java-oriented question. ;) bingomanatee wrote: In Cake, are model objects supposed to be used like singletons -- stored in the classRegistry and reused between contexts? Is there any hazards implicit in recycling a single model object between contexts? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Are Model objects supposed to be used like singletons?
In Cake, are model objects supposed to be used like singletons -- stored in the classRegistry and reused between contexts? Is there any hazards implicit in recycling a single model object between contexts? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Saving to database
Fixed it. Needed a $this->Box->id= null; in if(!empty($temp)) { //incase user skipped that box $this->Box->save($temp); //Writes over old data and pointer doesnt move } On Jul 25, 12:43 pm, Unite <[EMAIL PROTECTED]> wrote: > Heres the problem. I am filling in forms and saving them to a session. > These forms are repeats of themselves so basically in the session a > array of how ever many forms the user made is saved to the session. > Simple terms a session gets saved as a array of a forms data eg: > array(box1,box2,box3.). Now the problem I am having is that if I > try save these forms to a table (exact fields) using a foreach loop > only the last "box" is recorded. It seems to me that the $this->Table->save() > method is just replacing the old data with the new data > > instead of incrementing the id (primary key) so the pointer isnt > moving onto the next record. Is there a way to force this behaviour? > > $templatedata = $this->Session->read('templatedata'); //This is the > array of box's > foreach($templatedata as $temp) { > if(!empty($temp)) { //incase user skipped that box > $this->Box->save($temp); //Writes over old data and pointer > doesnt > move > } > > } > > ** > example of output > ** > Array //if a pr($temp) was in the if statement > ( > [sender_id] => 8 > [index_id] => 2 > [amt_fields] => 2 > [box_name] => j > [bg_colour] => j > [hasborder] => No > [border_colour] => j > [font_colour] => j > [font_style] => j > [field0] => j > [field1] => j > ) > > Array //if a pr($temp) was in the if statement > ( > [sender_id] => 8 > [index_id] => 4 > [amt_fields] => 1 > [box_name] => 5 > [bg_colour] => 5 > [hasborder] => Yes > [border_colour] => 5 > [font_colour] => 5 > [font_style] => 5 > [field0] => 5 > ) > > Array //if a pr($this->Box->findAll()); was at end of function > ( > [0] => Array > ( > [box] => Array > ( > [id] => 1 > [sender_id] => 8 > [index_id] => 4 > [amt_fields] => 1 > [box_name] => 5 > [logo] => > [field0] => 5 > [field1] => j //not ment to be here left over from > first record > [field2] => > [field3] => > [field4] => > [field5] => > [field6] => > [field7] => > [field8] => > [field9] => > [bg_colour] => 5 > [font_colour] => 5 > [font_style] => 5 > [hasborder] => Yes > [border_colour] => 5 > ) > > ) > > } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Help for begginer.. problem with retrieving data from two models in one controller
$size_list = $this->ProductSize- >generateList( array('ProductSize.product_id' => $product_id ); But a couple of notes. You can probably get what you want by just setting $this->Product->recursive = 1; before the findAllByCategoryId line. You can also improve the $c_id= line, to $c_id = $this->Category->field('id', array('name'=>$c_name)); This will get the id directly (no need for the ['Category']['id'] key), and will handle escaping the name (what if it has an actual " symbol in there?). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Saving to database
Heres the problem. I am filling in forms and saving them to a session. These forms are repeats of themselves so basically in the session a array of how ever many forms the user made is saved to the session. Simple terms a session gets saved as a array of a forms data eg: array(box1,box2,box3.). Now the problem I am having is that if I try save these forms to a table (exact fields) using a foreach loop only the last "box" is recorded. It seems to me that the $this->Table- >save() method is just replacing the old data with the new data instead of incrementing the id (primary key) so the pointer isnt moving onto the next record. Is there a way to force this behaviour? $templatedata = $this->Session->read('templatedata'); //This is the array of box's foreach($templatedata as $temp) { if(!empty($temp)) { //incase user skipped that box $this->Box->save($temp); //Writes over old data and pointer doesnt move } } ** example of output ** Array //if a pr($temp) was in the if statement ( [sender_id] => 8 [index_id] => 2 [amt_fields] => 2 [box_name] => j [bg_colour] => j [hasborder] => No [border_colour] => j [font_colour] => j [font_style] => j [field0] => j [field1] => j ) Array //if a pr($temp) was in the if statement ( [sender_id] => 8 [index_id] => 4 [amt_fields] => 1 [box_name] => 5 [bg_colour] => 5 [hasborder] => Yes [border_colour] => 5 [font_colour] => 5 [font_style] => 5 [field0] => 5 ) Array //if a pr($this->Box->findAll()); was at end of function ( [0] => Array ( [box] => Array ( [id] => 1 [sender_id] => 8 [index_id] => 4 [amt_fields] => 1 [box_name] => 5 [logo] => [field0] => 5 [field1] => j //not ment to be here left over from first record [field2] => [field3] => [field4] => [field5] => [field6] => [field7] => [field8] => [field9] => [bg_colour] => 5 [font_colour] => 5 [font_style] => 5 [hasborder] => Yes [border_colour] => 5 ) ) } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Email send with emailcomponent. Every line a new emptyline
When I send a text email from the email component (cakephp 1.2 9 july) I get on evry line a new empty line. in my template i got this: hello this is a text message from cakephp And when i send this email I get this back: hello this is a text message from cakephp I changed nothing else. Only send as 'text' On my localhost (Xampp) works perfect. Problem is only the online server(linux). Could someone help me with this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: db design feedback
The system should work as follows: A number of modules are created and each module has a review associated with it A number of users are created and each user is assigned to one or more modules. In each of these module he is assigned to, he will be given a particular role. Each role has a number of tasks which should therefore be displayed to the user as tasks to be completed. The days_allowed field in the tasks table will be used to set a time limit after which an email reminder will be sent to the user urging him to complete that task. The system administrator should also be able to have an overview of all the modules and tasks which are pending. My idea is to have a matrix showing the modules on the vertical axis and the review fields on the horizontal axis. This is almost the same as List Reviews, however instead of showing the content of the fields I would just show 'Complete' when the field is not empty or 'Pending' when the field is empty. Does the db structure enable me to do these things? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: i18n translation in db tables - how to do this like Symfony?
I tried a similar approach and most likely will end up using it due to time constraints for the project. Still, i18n support is a great step in Cake's maturity road, and I'd love to make it work even if it was in a not-so-elegant way. In fact, maybe Cake Foundation may study donation-promoted development. I'd be more than happy to donate to see this functionallity working! On 25 jul, 01:56, oleonav <[EMAIL PROTECTED]> wrote: > On Jul 24, 12:09 am, Gorka <[EMAIL PROTECTED]> wrote: > > > Actually, $form->input('TransName.eng.content') renders something like > > this for me: > > > > id="TransNameContent" /> > > > This is obviously not very useful when editing multiple languages at > > the same time (mostly in the admin area for defining name, > > description, etc... of an item). Has anyone found a method for editing > > multiple languages at the sameview? > > Yes, I did find this out to. Not very useful. > > > Oleonav, did you manage to get any closer to a satisfying solution? > > No, I did not. Not in the cake 1.2 way for that matter. Maybe some of > the core developers would be so nice to contribute on this subject. > > Anyway, I'm working on a different approach to i18n. It does not use a > 'global' i18n & i18n_content table. It stores translations in the same > table as the main, default language. > > For example a article table: > id > article_id > locale > ... > title > content > > For the main article, in the default language, the field id & article > id have the same value. Locale is set to the default locale string. > Translations have their own id. The article_id is the same as the id > of the main default record. Each translation has it's own locale > string. The combination of article_id & locale is defined as unique in > the database. > > Model assoc's: > var $belongsTo = array( >'MotherArticle' => array('className' => 'Article', > 'foreignKey' => 'article_id', > ); > > var $hasMany = array( >'ChildArticle' => array('className' => 'Article', > 'foreignKey' => 'article_id' > ); > > I have added a function to the main AppModel to fetch the article in > the preferred translation if available. > > function readTranslated($fields=null,$id,$lang=null){ >$res = $this->read($fields,$id); >$childs = 'Child' . $this->name; >if($res && $lang && is_array($res[$childs])){ > foreach($res[$childs] as $trans){ > if($trans['locale'] == $lang){ >$resTrans = $trans; >$resTrans['translated'] = 'yes'; > } > } >} >if(isset($resTrans)){ > $res[$this->name] = $resTrans; >} >elseif($res != null){ > $res[$this->name]['translated'] = 'no'; >} > >return $res; > > } > > In the view action of the article controller I use the following > function $this->Article->readTranslated(null,$id,'eng') for example to > fetch the article in the prefered language, if available. > > I'm now busy coding the add & edit actions. Having some trouble with > validation > > This is work in progress. I will share my thoughts / solution when I'm > satisfied --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: db table design
any help on this? thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: email trigger function
thanks i will try your suggestions On Jul 25, 7:01 am, Sascha Fröhlich <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > triggering is a typical database function, > seehttp://dev.mysql.com/doc/refman/5.0/en/create-trigger.htmlfor more > information. > > Best regards, > Sascha > > Chris Hartjes schrieb:> On 7/24/07, rtanz <[EMAIL PROTECTED]> wrote: > >> hi i have a table containing a number of fields. Is there a way to > >> make the system check that when some particular fields are no longer > >> empty an email is sent to a user? thanks > > > I don't think CakePHP will do it for you right out of the box, but > > what you need is to create a cron job that checks the table in > > question and then emails users. I've done similar things but not with > > CakePHP. > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.7 (MingW32) > > iD8DBQFGpudGN1kDpsIDAWERAnEUAKDPrbiffRp1sOE0+aOcm9IUgBurAwCgqGU1 > +0xMvjYS565rWzwjmjg3XCA= > =qX9Z > -END PGP SIGNATURE- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Mambo to use CakePHP for V5
sweet! and welcome to the community :) Tijs On 25-jul-2007, at 13:20, cauld wrote: > > The installer prototype I wrote for Mambo utilizes 1.1, but I will be > redoing it with 1.2 soon. Mambo 5 will go with 1.2. > > On Jul 25, 2:49 am, "Sascha Fröhlich" <[EMAIL PROTECTED]> > wrote: >> Heya, >> >> good news. I wonder whether you will use 1.1 or 1.2 (stable or >> feature >> rich :-))? >> >> Best regards, >> Sascha >> >> 2007/7/25, bugfaceuk <[EMAIL PROTECTED]>: >> >> >> >>> It's almost bizarre, I have just started fiddling with Cake in the >>> last week... and look after a Joomla site, and was thinking "the >>> reason I haven't developed shed loads of components is that it needs >>> to be integrated with Cake, hell even built on it"... >> >>> And now Mambo have made this move. I will watch with great interest, >>> and when you do release on Cake, I think you can expect a flood of >>> components/modules and god knows what else >> >>> A brave decision, well made. >> >>> On Jul 25, 1:24 am, cauld <[EMAIL PROTECTED]> wrote: Hello everyone, >> My name is Chad Auld. I am the Project Leader for Mambo. Seemed appropriate to stop by this thread and introduce myself. We are excited about the decision and looking forward to forming a very close relationship with the CakePHP development team and community. Anyway, we are here and paying attention to current CakePHP developments and the Google Group discussions for now. More to come as it happens... >> Cheers! >> On Jul 23, 10:48 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: >> > Exciting news -http://www.source.mambo-foundation.org/content/ > view/126/1/ >> > Will there be a corresponding announcement from CSF? >> > What does it mean for future of CakePHP? >> > T >> > -- > = > Cheesecake-Photoblog:http://cheesecake-photoblog.org > PHP for E-Biz:http://sanisoft.com > = > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Mambo to use CakePHP for V5
The installer prototype I wrote for Mambo utilizes 1.1, but I will be redoing it with 1.2 soon. Mambo 5 will go with 1.2. On Jul 25, 2:49 am, "Sascha Fröhlich" <[EMAIL PROTECTED]> wrote: > Heya, > > good news. I wonder whether you will use 1.1 or 1.2 (stable or feature > rich :-))? > > Best regards, > Sascha > > 2007/7/25, bugfaceuk <[EMAIL PROTECTED]>: > > > > > It's almost bizarre, I have just started fiddling with Cake in the > > last week... and look after a Joomla site, and was thinking "the > > reason I haven't developed shed loads of components is that it needs > > to be integrated with Cake, hell even built on it"... > > > And now Mambo have made this move. I will watch with great interest, > > and when you do release on Cake, I think you can expect a flood of > > components/modules and god knows what else > > > A brave decision, well made. > > > On Jul 25, 1:24 am, cauld <[EMAIL PROTECTED]> wrote: > > > Hello everyone, > > > > My name is Chad Auld. I am the Project Leader for Mambo. Seemed > > > appropriate to stop by this thread and introduce myself. We are > > > excited about the decision and looking forward to forming a very close > > > relationship with the CakePHP development team and community. Anyway, > > > we are here and paying attention to current CakePHP developments and > > > the Google Group discussions for now. More to come as it happens... > > > > Cheers! > > > > On Jul 23, 10:48 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > > > > > Exciting news > > > > -http://www.source.mambo-foundation.org/content/view/126/1/ > > > > > Will there be a corresponding announcement from CSF? > > > > > What does it mean for future of CakePHP? > > > > > T > > > > > -- > > > > = > > > > Cheesecake-Photoblog:http://cheesecake-photoblog.org > > > > PHP for E-Biz:http://sanisoft.com > > > > = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Help for begginer.. problem with retrieving data from two models in one controller
Hi! I'm a beginner in Cake and can't understand one thing, maybe you more experienced people will know the solution:-) So, I have two tables in db: products (id,name) and productsizes (id,product_id,size); Two models: Product, Productsize; product.php: class Product extends AppModel { var $name = 'Product'; var $hasMany = array('Productsize' => array( 'className'=>'Productsize', 'foreignKey'=>'product_id') ); } productsize.php: class Productsize extends AppModel { var $name = 'Productsize'; var $belongsTo = 'Product'; } And products_controller looks like: class ProductsController extends AppController { var $name = 'Products'; var $uses = array('Product','Category','Productsize'); var $layout = 'default'; function display($c_name) { $this->set('category_name',$c_name); //this is just $c_id=$this->Category->find('name=\''.$c_name.'\'','id'); //for retrivieng category $this->set('products',$this->Product- >findAllByCategoryId($c_id['Category']['id'])); //here i get all data about products $this->pageTitle = $c_name; } } And my question is: how do I retrieve data from productsizes? In action "display" I want to show all products from one category and I need to display the possible sizes for each one. How to do that in one action? Controller: products_controller --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: bindmodel and the paginator not working / trac ticket 2201
you mean: $this->WidgetMenu->bindModel( array('hasOne' => array( 'ModelName' => array( 'className' => 'ModelName', ) ), ), true); i tried that, it doesn't work.. i didn't get what's the second parameter (unless it's the 'true' after the array..). On Jul 19, 8:29 am, AD7six <[EMAIL PROTECTED]> wrote: > On Jul 19, 6:17 am, phpjoy <[EMAIL PROTECTED]> wrote: > > > nobody has an idea how to make the pagination work with bindmodel > > instead of static models? > > You use the second parameter in bindModel to make the new association > persist. Like what gwoo and phpNut said in the ticket comments. > > AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Cake variables
pr($this->params) On Jul 25, 7:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > What variables do I use do determine the controller function I am in? > For instance, I would like to display certain items in the layout > based upon the controller and function that is being executed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Creating a recurring newsletter
You could try breaking the 900+ users into smaller chunks - e.g. first sending fifty e-mails, then right after that another fifty, until all of them have been sent. On Jul 24, 11:58 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm trying to set up an automatic newsletter for one of the sites I'm > working on. All the data for the newsletter is in the database for > the site already (i.e. who to send it to and the data to send). > > I set up a function to create customized emails for each of the > members using the PHPMailer component, which I'm using for all of the > other emails the site generates. It works great for doing a few of > them, but when I try to run it for the current 900+ members on the > site, it breaks. First it was execution time, which I increased, then > it was memory limits. > > Can anyone make a suggestion on a different way to go about it so I > don't have these problems? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Mambo to use CakePHP for V5
Heya, good news. I wonder whether you will use 1.1 or 1.2 (stable or feature rich :-))? Best regards, Sascha 2007/7/25, bugfaceuk <[EMAIL PROTECTED]>: > > It's almost bizarre, I have just started fiddling with Cake in the > last week... and look after a Joomla site, and was thinking "the > reason I haven't developed shed loads of components is that it needs > to be integrated with Cake, hell even built on it"... > > And now Mambo have made this move. I will watch with great interest, > and when you do release on Cake, I think you can expect a flood of > components/modules and god knows what else > > A brave decision, well made. > > On Jul 25, 1:24 am, cauld <[EMAIL PROTECTED]> wrote: > > Hello everyone, > > > > My name is Chad Auld. I am the Project Leader for Mambo. Seemed > > appropriate to stop by this thread and introduce myself. We are > > excited about the decision and looking forward to forming a very close > > relationship with the CakePHP development team and community. Anyway, > > we are here and paying attention to current CakePHP developments and > > the Google Group discussions for now. More to come as it happens... > > > > Cheers! > > > > On Jul 23, 10:48 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > > > > > Exciting news -http://www.source.mambo-foundation.org/content/view/126/1/ > > > > > Will there be a corresponding announcement from CSF? > > > > > What does it mean for future of CakePHP? > > > > > T > > > > > -- > > > = > > > Cheesecake-Photoblog:http://cheesecake-photoblog.org > > > PHP for E-Biz:http://sanisoft.com > > > = > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Creating a recurring newsletter
> Maybe your server has a limit (to protect themself against spamming) > with regard to accepted mails sent on a certain time range. > > once I noticed that with Swift Mailer (http://www.swiftmailer.org/) > you can tell him how many e-mails to send before taking a rest, and > them restart. > > check out this page about using Swift Mailer with Cake: > > => SwiftMailer Component Tutorial > =>http://bakery.cakephp.org/articles/view/swiftmailer-component-tutorial > > and these docs about Swift Mailer: > =>http://www.swiftmailer.org/wikidocs/v3/sending/batch > =>http://www.swiftmailer.org/wikidocs/v3/tips/memory > =>http://www.swiftmailer.org/wikidocs/v3/sending/batch > > Hope this helps! > > Dan Huh, this helps me very much. Thanks :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Creating a recurring newsletter
Maybe your server has a limit (to protect themself against spamming) with regard to accepted mails sent on a certain time range. once I noticed that with Swift Mailer (http://www.swiftmailer.org/) you can tell him how many e-mails to send before taking a rest, and them restart. check out this page about using Swift Mailer with Cake: => SwiftMailer Component Tutorial => http://bakery.cakephp.org/articles/view/swiftmailer-component-tutorial and these docs about Swift Mailer: => http://www.swiftmailer.org/wikidocs/v3/sending/batch => http://www.swiftmailer.org/wikidocs/v3/tips/memory => http://www.swiftmailer.org/wikidocs/v3/sending/batch Hope this helps! Dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Creating a recurring newsletter
On Jul 25, 8:58 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Can anyone make a suggestion on a different way to go about it so I > don't have these problems? I have to solve the same problem. I would try something like this 1. When sending emails, dont send them directly to the user but instead put them compiled for sending in some db table 2. Create cron job that will send some of them (50 - 100 ...) every 10 or 15 minutes. 3. Don't worry, be happy I am just in proces of implementation of something like this and at the start of next week I will have to have concrete implementation, so if you don't get it until then I will post my solution. If you get it, post yours :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
webservices + data pagination: component or behaviour?
hey guys, I'm retrieving some data from webservices (YouTube, Flickr) from a controller. Therefore I have no DB table and no model for that controller. In order to use cake built in paginator helper, what should I build, a kinda Flickr behavior? or a component? Dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Join fails across multiple databases with HABTM
ok, I didn't search the group properly. The thing I'm requesting seems not to be supported, what people seem to do instead and which I ended up doing was adding a third class for association. Meaning instead of having two models with HABTM. I now have two Models with hasMany (originally HABTM) and the third ''new'' class with belongsTo associations. By creating the join model one other thing is achieved, extra fields (the ones apart from the ones associating the two tabels) can now be accessed. Nate on model setup: http://groups.google.com/group/cake-php/browse_thread/thread/bef70558f7854732/6363603e04fcee68?lnk=st&q=&rnum=10#6363603e04fcee68 On Jul 24, 10:23 pm, safl <[EMAIL PROTECTED]> wrote: > Hey, > > The case is: > I've got 2 models(Customer and Server), one is using $useDbConfig = > 'crm' the other is using $useDbConfig = 'monitoring'. > Each DB configuration specifies connection to it's own database (crm > and monitoring). > > I've got HABTM between these to models, and I need HABTM, but when > querying i get "Table doesn't exist" since the join table only lives > in one of the databases. All other associations seems to work across > databases. > > My question is: > > How can I in the "$hasAndBelongsToMany" definition specify that the > join table is living in a different database? > > regards, > Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: Mambo to use CakePHP for V5
It's almost bizarre, I have just started fiddling with Cake in the last week... and look after a Joomla site, and was thinking "the reason I haven't developed shed loads of components is that it needs to be integrated with Cake, hell even built on it"... And now Mambo have made this move. I will watch with great interest, and when you do release on Cake, I think you can expect a flood of components/modules and god knows what else A brave decision, well made. On Jul 25, 1:24 am, cauld <[EMAIL PROTECTED]> wrote: > Hello everyone, > > My name is Chad Auld. I am the Project Leader for Mambo. Seemed > appropriate to stop by this thread and introduce myself. We are > excited about the decision and looking forward to forming a very close > relationship with the CakePHP development team and community. Anyway, > we are here and paying attention to current CakePHP developments and > the Google Group discussions for now. More to come as it happens... > > Cheers! > > On Jul 23, 10:48 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > > > Exciting news -http://www.source.mambo-foundation.org/content/view/126/1/ > > > Will there be a corresponding announcement from CSF? > > > What does it mean for future of CakePHP? > > > T > > > -- > > = > > Cheesecake-Photoblog:http://cheesecake-photoblog.org > > PHP for E-Biz:http://sanisoft.com > > = --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Cake variables
What variables do I use do determine the controller function I am in? For instance, I would like to display certain items in the layout based upon the controller and function that is being executed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---
Creating a recurring newsletter
I'm trying to set up an automatic newsletter for one of the sites I'm working on. All the data for the newsletter is in the database for the site already (i.e. who to send it to and the data to send). I set up a function to create customized emails for each of the members using the PHPMailer component, which I'm using for all of the other emails the site generates. It works great for doing a few of them, but when I try to run it for the current 900+ members on the site, it breaks. First it was execution time, which I increased, then it was memory limits. Can anyone make a suggestion on a different way to go about it so I don't have these problems? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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: email trigger function
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, triggering is a typical database function, see http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html for more information. Best regards, Sascha Chris Hartjes schrieb: > On 7/24/07, rtanz <[EMAIL PROTECTED]> wrote: >> hi i have a table containing a number of fields. Is there a way to >> make the system check that when some particular fields are no longer >> empty an email is sent to a user? thanks >> > > I don't think CakePHP will do it for you right out of the box, but > what you need is to create a cron job that checks the table in > question and then emails users. I've done similar things but not with > CakePHP. > -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) iD8DBQFGpudGN1kDpsIDAWERAnEUAKDPrbiffRp1sOE0+aOcm9IUgBurAwCgqGU1 +0xMvjYS565rWzwjmjg3XCA= =qX9Z -END PGP SIGNATURE- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~--~~~~--~~--~--~---