Re: PHP mail() function not working in 1.1.19.6305
Why not update to 1.2? Or check your cake lib files to see if email exists. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: AclComponent methods not working
On Feb 8, 11:41 pm, thesubtledoctor thomasaquina...@gmail.com wrote: Hi All, I have a page which should allow a user to set and deny permissions for a controller action for each group. But this code $this-Acl-allow('Administrator', 'Profiles/edit'); and this code $this-Acl-deny('Administrator', 'Profiles/edit'); Both have the same effect of adding a permission to the aros_acos table. In what way is that unexpected? AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Database Relationship and Design Help
I'm have a problem on how I should 'design' my database for my current project. This is my current design: http://img264.imageshack.us/img264/4396/coopdbjx7.png (In the image it shows member_int, but the actual field name is member_id with a data type of int) Here is what I want it to be: Each member can apply for zero or more short term loan(s) A short term loan must have 1 or up to 3 comakers A comaker must also be a member. A member could be a comaker. It matters to know which member is the main 'loaner' and which member is the comaker for each loan. Here is what the relationship looks like atm in my source: Member $hasOne = array('ShortTermLoanComaker'); Member $hasMany = array('ShortTermLoan'); ShortTermLoan $belongsTo = array('Member'); ShortTermLoan $hasAndBelongsToMany = array('ShortTermLoanComaker'); ShortTermLoanComaker $belongsTo = array('Member'); ShortTermLoanComaker $hasAndBelongsToMany = array('ShortTermLoan'); I hope someone could help me with this. Thank you everyone. :D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ACL question regarding Acl example
Hi, I just started using cakePHP, im almost done reading through the documents, but I was wondering something, I was reading the example for the ACL controlled application, and on one part it says Our controllers and models are now prepped for adding some initial data, and our Group and User models are bound to the Acl table. So add some groups and users using the baked forms. I made the following groups: what baked forms is this referring to? and when inserting users, if I made a registration function in the users controller, and made a form to insert a user into the database would it automatically update everything for acl to work properly? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Media view not working
So im trying to get this media view working, but it doesn't seem to force the download. All it does is show a white page and the query output, any ideas? Heres my action: /** * Downloads a file * @param int $upload_id * @return media */ function download($upload_id) { $this-view = 'Media'; $file = $this-Upload-find('first', array( 'conditions' = array('Upload.id' = $upload_id), 'contain' = array('Current') )); if (!empty($file)) { $this-Upload-increaseDownloadCount($file['Current']['id']); } $params = array( 'id' = $file['Current']['filename'], 'name' = $file['Upload']['name'] .' v'. $file['Current'] ['version'], 'download' = true, 'extension' = $file['Current']['type'], 'path' = 'files'.DS ); $this-set($params); } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ACL question regarding Acl example
For baked forms it means the forms autogenerated by bake. If you haven't used bake yet, it's a command line utilities that let you auto- generate basic models, controllers and views, starting from your db structure. You can find more informations on the documentation. The basic class created by bake with allow you to perform the basics Create, Read, Update and Delete operation for all your entities, including Users and Groups. The link bettween this entities and ACL is not automatic bt it requires the implementation of some code in both the User and Group model. You should find all the info in the tutorial. I hope this few info can help you, unfortunately I'm at work and I'm not able to check the docs and give you more details. Andrea --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Validation rule with or
I have a form where you have to enter either (firstname AND lastname AND phone) OR (companyname AND phone) how do I make a validate rule like that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Media view not working
Ah nvm, it seemed I had the filename misspelt. Stupid me. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Autocomplete items above input instead of below
Hey People, How can i get Ajax::autoComplete() to popup suggestions above the input element instead of below it? This mockup illustrates what i want it to do: http://i679.photobucket.com/albums/vv154/safl_dk/autocomplete.png -safl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Autocomplete items above input instead of below
Wouldn't you just edit the css to position somewhere else? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How long run the sql statement?
Thanks a lot. I know this configuration, but is there any other way to get the process time? So i can customize is easier... I don't need the sql statement, only the time for running --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
ClassRegistry::init vs loadModel
I'm not sure what the most correct way to dynamicly load a model is: ClassRegistry::init(model_name) or loadModel(model_name) ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: cookie and sessions available for subdomains (again) *.example.org
No idea? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Mod Rewrite problem
I'm not very familiar with modrewrite -- do I just add the text RewriteBase to the .htaccess file? On Feb 9, 12:17 am, Webweave webwe...@gmail.com wrote: You need to add the RewriteBase to the .htaccess files in the folder where you blog is. Assuming that blog.mywebsite.com is set up to serve the files from the /blog folder, you just need to make sure you have the .htaccess files as described here:http://book.cakephp.org/view/37/Apache-and-mod_rewrite On Feb 8, 8:17 am, thankyou gregbo...@gmail.com wrote: Hello, I have the .htaccess file setup so that it makes cakephp work fine at mywebsite.com. The problem is that I also want to add a blog to the website at the folder /blog, so I can make blog.mywebsite.com work. The folder is in /blog. My .htaccess file info is below, what do I need to do to make the blog.mywebsite.com work? IfModule mod_rewrite.c RewriteEngine on RewriteCond $1 !^favicon.ico RewriteCond $1 !^sitemap.xml RewriteRule ([^/]*)(.*) app/webroot/$1$2 [L] /IfModule Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Translate Behavior internals
To correctly implement i18n and l10n for your purpose you need first to create the following MySQL tables: Categories table: CREATE TABLE `categories` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `created` INT(10) UNSIGNED NOT NULL, `updated` INT(10) UNSIGNED NOT NULL, PRIMARY KEY (`id`), KEY `created` (`created`), KEY `updated` (`updated`) ) ENGINE=MyISAM, DEFAULT CHARACTER SET UTF8; Note that the `name` field is only virtual and should not be present on table schema. In case if you use TreeBehavior categories table should be like this: CREATE TABLE `categories` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `parent_id` INT(10) UNSIGNED, `lft` INT(10) UNSIGNED NOT NULL, `rght` INT(10) UNSIGNED NOT NULL, `created` INT(10) UNSIGNED NOT NULL, `updated` INT(10) UNSIGNED NOT NULL, PRIMARY KEY (`id`), KEY `parent_id` (`parent_id`), KEY `lft` (`lft`), KEY `rght` (`rght`), KEY `created` (`created`), KEY `updated` (`updated`) ) ENGINE=MyISAM, DEFAULT CHARACTER SET UTF8; And of course the i18n table: CREATE TABLE `i18n` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `foreign_key` INT(10) UNSIGNED NOT NULL, `locale` VARCHAR(6) NOT NULL, `model` VARCHAR(255) NOT NULL, `field` VARCHAR(255) NOT NULL, `content` MEDIUMTEXT, PRIMARY KEY (`id`), KEY `row_id` (`foreign_key`), KEY `locale` (`locale`), KEY `model` (`model`), KEY `field` (`field`) ) ENGINE=MyISAM, DEFAULT CHARACTER SET UTF8; The php code for Category model is: ?php class Category extend AppModel { public $name = 'Category'; public $actsAs = array( 'Translate' = array( 'name' ) ); } ? To correctly save a category to database (english and german) the data array should be like the following (title field value should be an associative array with locales as keys and titles as values) : $data = array( 'Category' = array( 'title' = array( 'eng' = 'some english title', 'ger' = 'some german title' ) ) ); And under the controller use this to save the category: $this-Category-save($data); Hope this will help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ClassRegistry::init vs loadModel
On Feb 9, 7:57 am, Henrik Gemal henrikge...@gmail.com wrote: I'm not sure what the most correct way to dynamicly load a model is: ClassRegistry::init(model_name) or loadModel(model_name) ? I use App::Import if I'm going to use a model instance more than once. Otherwise ClassRegistry::init can be used for one-time usage (e.g. ClassRegistry::init(Foo)-find(all);). However, you should make sure you are not loading a model in which the current model (of your controller) has an association with. If it does, then you can just do $this-Bar-Foo-find(all); instead if Bar is the current model. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Database Relationship and Design Help
On Feb 9, 3:11 am, ramonmar...@gmail.com wrote: Here is what I want it to be: Each member can apply for zero or more short term loan(s) A short term loan must have 1 or up to 3 comakers A comaker must also be a member. A member could be a comaker. It matters to know which member is the main 'loaner' and which member is the comaker for each loan. Here is what the relationship looks like atm in my source: Member $hasOne = array('ShortTermLoanComaker'); Member $hasMany = array('ShortTermLoan'); ShortTermLoan $belongsTo = array('Member'); ShortTermLoan $hasAndBelongsToMany = array('ShortTermLoanComaker'); ShortTermLoanComaker $belongsTo = array('Member'); ShortTermLoanComaker $hasAndBelongsToMany = array('ShortTermLoan'); That looks alright to me. To meet that last requirement, maybe you can have a column in ShortTermLoan for the main loaner member ID and force it to be non-null. Then of course all ShortTermLoanComakers associated with that ShortTermLoan that do not have the ID contained in that column, would be the comakers for the loan. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Database Relationship and Design Help
Also, this is just a personal design decision but I would remove the 'id' field on the join table and make both of the other two columns primary keys. That enforces the rule (at the database level anyway) that a member/comaker cannot be associated with the same loan multiple times. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using Configure class in custom AppError
Hi Loboto, that thought came across my mind already. So I will refraise my question; How do I run functions etc. found in the beforeAction of the AppController or at least run actions needed to initialize the Configure class without duplicating all code from the AppController - beforeAction to my AppError class.. Any guesses? Thanks On Feb 7, 1:06 pm, Dr. Loboto drlob...@gmail.com wrote: AppController::beforeFilter() isn't called if no controller found to serve request. So yours Configure just do not contain values you need on Missing Controller errors as they wasn't set. On Feb 6, 8:54 pm, oleonav o.verh...@wrg-nl.com wrote: Hi there, I have some variables set using the Configure class in the beforeFunction of the main AppController. I use for multiple things, for example to set the title of the page. I need a custom 404 error page, so I made a custom AppError class containing the function error404, which overrides the build function from the framework (see below). The problem is that the Configure class is not working at all in AppError. Any suggestions? regards, class sample -- class AppError extends ErrorHandler { function error404() { //read the config file $config = Configure::read('siteConfig'); //set it so it's available in layout views $this-set('config', $config); ... ... run other code . //run parent class function parent::__construct(); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: PHP mail() function not working in 1.1.19.6305
On Sun, Feb 8, 2009 at 11:04 PM, peterhf peter.f...@sbcglobal.net wrote: This code is not working: $result = mail('peter.f...@sbcglobal.net', 'This is a test.', 'This is a test.', 'From: peter.f...@sbcglobal.net' ); // Show the login page. $this-redirect( '/pages/home' ); exit(); If I echo $result, I get a 1. I have tried commenting out the redirect and exit code to no avail. I have tested the host email capability with this code: ?php echo mail( 'peter.f...@sbcglobal.net', 'TEST', 'TEST'); ? and it works. What am I missing? What error message do you have? Best regards. -- MARCELO DE F. ANDRADE (aka eleKtron) Belem, PA, Amazonia, Brazil Linux User #221105 [...@pará ~]# links http://pa.slackwarebrasil.org/ For Libby's backstory be told on Lost http://www.petitiononline.com/libby423/petition.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Firefox Search Engine Plug-In
Hi there, This is my first CakePHP post by the way. I'm kind of new to CakePHP but I already love it. I've created a search engine plug-in to search the 1.2 docs. You can download it here: https://addons.mozilla.org/en-US/firefox/search?q=cakecat=4%2C0 You'll have to register if you want to use it. This is because of their secutiry policy to new plug-ins. To make it public I'd need other people to review it so if try it and you like it, please review it so I can make it available to general public. Any feedback or help with it would be greatly appreciated! Also, the code is available if anyone wants it. It's just an XML with a base64 encoded icon. Thanks, Hernán --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Very slow response times with CakePHP
I've reduce the request time of a page by changing bootstrap.php file like this: //App::import('Core', array('Dispatcher')); include('dispatcher.php') I've noticed that it takes a lot of time to load the dispatcher using the App::import function, so since bootstrap and dispatcher are in the same folder I thought it won't be a problem to load the dispatcher using include. Emanuel On Dec 16 2008, 4:09 pm, GeneSys bernhard.bo...@gmail.com wrote: Hey Folks! So I'm using CakePHP for a couple of months now. The company I am working at asked me to write a new web portal for them, so I thought, Well, Cake could make it! After spending some hours the website was (nearly) finished and so I put it on the webspace the old webpage was at. I already noticed during development that the site requests took about 3 - 5 secs until the page displayed, but I thought this is due to my development environment (i just installed the XAMPP from apachefriends with all default settings), but after uploading the website on the host it got even worse. Request times are between 4 to (up to!) 15 secs. Which is really .. tooslowfor a business website. I also tried to cache a lot of database requests so I limited most of the page calls to only 3 or 4 queries. But still load times are as high as they were before. So there are some facts about my project: It is just a small project ... - Core - 1 Model, 1 Controller, some views - 5 Plugins: Often containing nothing more than a model and a controller - intended use: about 1000 visitors per month So i don't have the faintest idea why cakePHP is running thatslow? Probably someone could take a look at the website:http://www.eurolyser.com/v4/ (cakePHP)http://www.eurolyser.com/_new/(old website, plain PHP and html) and tell what could be the problem about the high load times? I don't know which configuration settings to post and due to security concerns I just don't want to publish the whole cake config or phpinfo. But if any information is necessary needed please don't hesitate to ask. Thank you all in advance guys! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Mod Rewrite problem
Here's a good writeup from the bakery: http://bakery.cakephp.org/articles/view/mod-rewrite-on-godaddy-shared-hosting On Feb 9, 5:53 am, thankyou gregbo...@gmail.com wrote: I'm not very familiar with modrewrite -- do I just add the text RewriteBase to the .htaccess file? On Feb 9, 12:17 am, Webweave webwe...@gmail.com wrote: You need to add the RewriteBase to the .htaccess files in the folder where you blog is. Assuming that blog.mywebsite.com is set up to serve the files from the /blog folder, you just need to make sure you have the .htaccess files as described here:http://book.cakephp.org/view/37/Apache-and-mod_rewrite On Feb 8, 8:17 am, thankyou gregbo...@gmail.com wrote: Hello, I have the .htaccess file setup so that it makes cakephp work fine at mywebsite.com. The problem is that I also want to add a blog to the website at the folder /blog, so I can make blog.mywebsite.com work. The folder is in /blog. My .htaccess file info is below, what do I need to do to make the blog.mywebsite.com work? IfModule mod_rewrite.c RewriteEngine on RewriteCond $1 !^favicon.ico RewriteCond $1 !^sitemap.xml RewriteRule ([^/]*)(.*) app/webroot/$1$2 [L] /IfModule Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Autocomplete items above input instead of below
Then let rephrase/ add the question: how do i edit the css to position somewhere else? On Feb 9, 12:01 pm, Miles J mileswjohn...@gmail.com wrote: Wouldn't you just edit the css to position somewhere else? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Autocomplete items above input instead of below
Simply check which HTML elements are generated by the autocomplete (via FireBug or whatever you use), and write some CSS for those elements. On Feb 9, 5:02 pm, safl simon.a.f.l...@gmail.com wrote: Then let rephrase/ add the question: how do i edit the css to position somewhere else? On Feb 9, 12:01 pm, Miles J mileswjohn...@gmail.com wrote: Wouldn't you just edit the css to position somewhere else? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Database Relationship and Design Help
column member_id in ShortTermLoan is the id of the applicant. On Feb 9, 10:27 pm, mscdex msc...@gmail.com wrote: On Feb 9, 3:11 am, ramonmar...@gmail.com wrote: Here is what I want it to be: Each member can apply for zero or more short term loan(s) A short term loan must have 1 or up to 3 comakers A comaker must also be a member. A member could be a comaker. It matters to know which member is the main 'loaner' and which member is the comaker for each loan. Here is what the relationship looks like atm in my source: Member $hasOne = array('ShortTermLoanComaker'); Member $hasMany = array('ShortTermLoan'); ShortTermLoan $belongsTo = array('Member'); ShortTermLoan $hasAndBelongsToMany = array('ShortTermLoanComaker'); ShortTermLoanComaker $belongsTo = array('Member'); ShortTermLoanComaker $hasAndBelongsToMany = array('ShortTermLoan'); That looks alright to me. To meet that last requirement, maybe you can have a column in ShortTermLoan for the main loaner member ID and force it to be non-null. Then of course all ShortTermLoanComakers associated with that ShortTermLoan that do not have the ID contained in that column, would be the comakers for the loan. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Database Relationship and Design Help
I thought I read somewhere that every table has to have an 'id' column in CakePHP. Anyway, I deleted the column and everything seems to be working fine still. I think I got it already. Thanks. On Feb 9, 10:40 pm, mscdex msc...@gmail.com wrote: Also, this is just a personal design decision but I would remove the 'id' field on the join table and make both of the other two columns primary keys. That enforces the rule (at the database level anyway) that a member/comaker cannot be associated with the same loan multiple times. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
Well, I'm certainly no expert, so you might well benefit from someone else jumping in here. ;-) Try removing these lines: App::import(Component,Email); $this-Email = new EmailComponent(); ... as well as the inititlaize line I suggested. Then, add this line to the top of AppController: public $components = array('Email'); (replace public with var if you're stuck with PHP4.x) See if that works. I have a feeling the problem stems from the fact that you're importing a component into AppController, rather than loading it in the normal fashion. If you don't send email from many controllers, this may not be the most efficient way, but you'll at least be a bit closer to figuring out why it's failing for you. The crux of it is that the component isn't getting a handle to the controller for some reason. On Mon, Feb 9, 2009 at 2:29 AM, Kyle Decot kdec...@gmail.com wrote: When trying to use the initialize method, I get a undefined method error: Fatal error: Call to undefined method EmailComponent::initialize() in / home/affinit3/public_html/theskateparkdirectory/app/app_controller.php on line 60 Any ideas? On Feb 9, 2:22 am, brian bally.z...@gmail.com wrote: change the method name to _sendEmailNotification (single underscore) to make it protected, rather than private $this-Email = new EmailComponent(); $this-Email-initialize($this); Those are the only things that I can think of. I've never imported a component inside of an AppController method - private, protected, or public. Maybe that's the problem? On Mon, Feb 9, 2009 at 1:57 AM, Kyle Decot kdec...@gmail.com wrote: Ah, stupid mistake but I've updated the set to be body instead of email_body and am still getting the same results. Any other ideas? On Feb 9, 1:55 am, brian bally.z...@gmail.com wrote: sorry, I should have unquoted that. This should be clearer. $this-set(email_body,$body); Notice (8): Undefined variable: body [APP/views/elements/email/html/ email_notification.ctp, line 1] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: need help with Views and models
h1sorry for not giving enough info ok here is my categories index=paging /h1 ?php $paginator-options(array('url' = $this-passedArgs)); ? table cellpadding=0 cellspacing=0 ?php $i = 0; foreach ($categories as $category): $class = null; if ($i++ % 2 == 0) { $class = ' class=altrow'; } ? tr?php echo $class;? ?=$html-link('h3'.$category['Category']['name'].'/h3','/categories/view/'.$category['Category'] ['slug'],null,null,false);? /tr ?php endforeach; ? /table h1when i click on this it wont show me the recipes in that category and here is the category controller /h1 ?php class CategoriesController extends AppController { var $name = 'Categories'; var $helpers = array('Html', 'Form'); function index() { } function paging() { $this-Category-recursive = 0; $this-set('categories', $this-paginate('Category')); } function view($id = null) { if (!$id) { $this-Session-setFlash(__('Invalid Category.', true), 'default', array(), 'error'); $this-redirect(array('action'='index')); } $category = $this-Category-read(null, $id); $this-set('category', $category); $this-set('recipesFormAction', '/recipe/add/category/'.$id); } h1and this is my recipes controller /h1 ?php class RecipesController extends AppController { var $name = 'Recipes'; var $helpers = array('Html', 'Form'); function index() { } function paging() { $this-Recipe-recursive = 2; $filters = $this-Recipe-getFilters($this-passedArgs); $this-set('recipes', $this-paginate('Recipe', $filters)); } function view($id = null) { if (!$id) { $this-Session-setFlash(__('Invalid Recipe.', true), 'default', array(), 'error'); $this-redirect(array('action'='index')); } $recipe = $this-Recipe-read(null, $id); $this-set('recipe', $recipe); } function form($form_action = 'add', $id = null) { if(!empty($id)){ $recipe = $this-Recipe-read(null, $id); $this-set('recipe', $recipe); } if (!empty($this-data)) { $this-Recipe-create(); if ($this-Recipe-save($this-data)) { $this-Session-setFlash(__('The Recipe has been saved', true), 'default', array(), 'info'); if(!empty($id)){ $this-redirect(array('action' = 'view', $id)); }else{ $this-redirect($this-referer()); } } else { $this-Session-setFlash(__('The Recipe could not be saved. Please, try again.', true), 'default', array(), 'error'); } }else{ $this-data = array(); $this-data['Recipe'] = array(); if(!empty($recipe)){ $this-data = $recipe; } foreach($this-passedArgs as $fieldName = $value){ $this-data['Recipe'][$fieldName] = $value; } } $categories = $this-Recipe-Category-find('list'); $this-set(compact('categories')); $form_url = '/' . $this-params['url']['url']; $this-set('form_url', $form_url); $this-set('form_action', $form_action); } h1this is my category model/h1 ?php class Category extends AppModel { var $name = 'Category'; var $actsAs = array( 'Slugged' = array( 'overwrite' = false, 'unique' = true, 'case' = 'low', ) ); //The Associations below have been created with all possible keys, those that are not needed can be removed var $hasMany = array( 'Recipe' = array('className' = 'Recipe', 'foreignKey' = 'category_id', 'dependent' = true, 'conditions' = '', 'fields' = '', 'order' = '',
Re: Autocomplete items above input instead of below
Allrighty then... Autocomplete() uses absolute positioning. The default behavior adds the attribute top: XXpx;. For it to behave the way i want it i simply add the attribute: bottom: XXpx and remove the attribute top: XXpx;. I've tried and tested it by using firebug and changing the attributes. This is great I found the CSS i need, hurray. But, the attribute top is constantly added dynamically and overrules the effect of the bottom property. How can work around this? On Feb 9, 5:08 pm, dr. Hannibal Lecter lecter...@gmail.com wrote: Simply check which HTML elements are generated by the autocomplete (via FireBug or whatever you use), and write some CSS for those elements. On Feb 9, 5:02 pm, safl simon.a.f.l...@gmail.com wrote: Then let rephrase/ add the question: how do i edit the css to position somewhere else? On Feb 9, 12:01 pm, Miles J mileswjohn...@gmail.com wrote: Wouldn't you just edit the css to position somewhere else? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Very slow response times with CakePHP
Do you have Firebug installed, by any chance? While it's incredibly useful, I've see it cause load times to exceed 30 seconds in some cases where I have a bunch of jquery stuff. I actually thought it was Cake at first. Suspending it showed an immediate drop in load times. On Mon, Feb 9, 2009 at 10:19 AM, Emanuel Nedelcu emanuel.nede...@gmail.com wrote: I've reduce the request time of a page by changing bootstrap.php file like this: //App::import('Core', array('Dispatcher')); include('dispatcher.php') I've noticed that it takes a lot of time to load the dispatcher using the App::import function, so since bootstrap and dispatcher are in the same folder I thought it won't be a problem to load the dispatcher using include. Emanuel On Dec 16 2008, 4:09 pm, GeneSys bernhard.bo...@gmail.com wrote: Hey Folks! So I'm using CakePHP for a couple of months now. The company I am working at asked me to write a new web portal for them, so I thought, Well, Cake could make it! After spending some hours the website was (nearly) finished and so I put it on the webspace the old webpage was at. I already noticed during development that the site requests took about 3 - 5 secs until the page displayed, but I thought this is due to my development environment (i just installed the XAMPP from apachefriends with all default settings), but after uploading the website on the host it got even worse. Request times are between 4 to (up to!) 15 secs. Which is really .. tooslowfor a business website. I also tried to cache a lot of database requests so I limited most of the page calls to only 3 or 4 queries. But still load times are as high as they were before. So there are some facts about my project: It is just a small project ... - Core - 1 Model, 1 Controller, some views - 5 Plugins: Often containing nothing more than a model and a controller - intended use: about 1000 visitors per month So i don't have the faintest idea why cakePHP is running thatslow? Probably someone could take a look at the website:http://www.eurolyser.com/v4/ (cakePHP)http://www.eurolyser.com/_new/(old website, plain PHP and html) and tell what could be the problem about the high load times? I don't know which configuration settings to post and due to security concerns I just don't want to publish the whole cake config or phpinfo. But if any information is necessary needed please don't hesitate to ask. Thank you all in advance guys! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Autocomplete items above input instead of below
And the answer to my own question is to add the !important tag so the properties aren't overridden. For reference then this is the css i ended up with: div.auto_complete { position: absolute; width: 150px; bottom: 60px !important; top: auto !important; background-color: white; border:1px solid #888; margin: 0; padding:0; z-index:200; } Thx, for input people! On Feb 9, 5:51 pm, safl simon.a.f.l...@gmail.com wrote: Allrighty then... Autocomplete() uses absolute positioning. The default behavior adds the attribute top: XXpx;. For it to behave the way i want it i simply add the attribute: bottom: XXpx and remove the attribute top: XXpx;. I've tried and tested it by using firebug and changing the attributes. This is great I found the CSS i need, hurray. But, the attribute top is constantly added dynamically and overrules the effect of the bottom property. How can work around this? On Feb 9, 5:08 pm, dr. Hannibal Lecter lecter...@gmail.com wrote: Simply check which HTML elements are generated by the autocomplete (via FireBug or whatever you use), and write some CSS for those elements. On Feb 9, 5:02 pm, safl simon.a.f.l...@gmail.com wrote: Then let rephrase/ add the question: how do i edit the css to position somewhere else? On Feb 9, 12:01 pm, Miles J mileswjohn...@gmail.com wrote: Wouldn't you just edit the css to position somewhere else? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: DebugKit plugin: not available for Windows users?
If your using Aptana or Eclipse for your IDE you can install the git plugin for source control and check it out from within the IDE http://git.or.cz/gitwiki/EclipsePlugin On Feb 6, 9:48 am, rcurzon s...@interlog.com wrote: I guess it would work fine in Windows... but you can't get it without git... which isn't ready for Windows? Let me know if I missed something please! -R --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: PHP mail() function not working in 1.1.19.6305
Why not update to 1.2? This is plan B, the client doesn't want to upgrade at this time. What error message do you have? None! And debug is set to 3. On Feb 9, 7:10 am, Marcelo Andrade mfandr...@gmail.com wrote: On Sun, Feb 8, 2009 at 11:04 PM, peterhf peter.f...@sbcglobal.net wrote: This code is not working: $result = mail('peter.f...@sbcglobal.net', 'This is a test.', 'This is a test.', 'From: peter.f...@sbcglobal.net' ); // Show the login page. $this-redirect( '/pages/home' ); exit(); If I echo $result, I get a 1. I have tried commenting out the redirect and exit code to no avail. I have tested the host email capability with this code: ?php echo mail( 'peter.f...@sbcglobal.net', 'TEST', 'TEST'); ? and it works. What am I missing? What error message do you have? Best regards. -- MARCELO DE F. ANDRADE (aka eleKtron) Belem, PA, Amazonia, Brazil Linux User #221105 [...@pará ~]# linkshttp://pa.slackwarebrasil.org/ For Libby's backstory be told on Losthttp://www.petitiononline.com/libby423/petition.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: PHP mail() function not working in 1.1.19.6305
On Mon, Feb 9, 2009 at 2:58 PM, peterhf peter.f...@sbcglobal.net wrote: Why not update to 1.2? This is plan B, the client doesn't want to upgrade at this time. What error message do you have? None! And debug is set to 3. This might actually be related to the sendmail wrapper (provided the mail function is enabled in php.ini). I had this exact problem just recently on a cPanel server and after looking the apache log, I found an error message saying sendmail couldn't be called directly, or something along those lines. If you *are* running cPanel, you have to turn off the following setting in exim: Track email origin through X-Source email headers. This setting causes the sendmail binary to be wrapped by a Perl script which tracks the email origin before calling the real sendmail binary. If you're not using cPanel, you might still want to check if the path to sendmail is a wrapper or a real sendmail (or equivalent) binary. If it is wrapped, try either changing the path to sendmail in php.ini to the real sendmail binary *or* renaming the wrapper and placing the real sendmail binary in its place. Good luck. - Gonzalo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: illegal offset type in components/acl.php
On Sun, Feb 8, 2009 at 10:52 AM, fain182 fain...@gmail.com wrote: I am trying to use IniAcl, but after a lot of attempts, it gives me always the same error... in cake/libs/controller/components/acl.php at line 490: if (isset($aclConfig[$aro]['deny'])) { but $aro is an array, so it gives error: Warning (2): Illegal offset type [COREcake/libs/controller/components/acl.php, line 490] while i was looking for the problem, i discovered that in acl.php at line 82: * @param string $aro ARO so, there is a problem in tha cakephp code, I suppose... no one can help me? thank you pietro what should I do? add a simple: $aro = $aro['User']['username'] ? this is the complete page of errors, with code and context: http://bin.cakephp.org/view/454637866 pietro PS. sorry for my bad english... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: nice new API layout
On Tue, Jan 27, 2009 at 6:02 PM, brian bally.z...@gmail.com wrote: (..) Just announcing: I created a small API search plugin for Firefox 3. Maybe it could be usefull for someone... :-P http://bin.cakephp.org/saved/42469 Best regards. -- MARCELO DE F. ANDRADE (aka eleKtron) Belem, PA, Amazonia, Brazil Linux User #221105 [...@pará ~]# links http://pa.slackwarebrasil.org/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: PHP mail() function not working in 1.1.19.6305
Thank you all for your consideration and especially you, Gonzalo, for this solution to my problem. I do not have access to php.ini as it is on the hosting server. In addition, as I stated in my original post, a plain vanilla PHP file containing a call to the mail function works. I have decided to address the issue be upgrading to v1.2.1.8004 and try the Email Component. Peter - On Feb 9, 9:11 am, Gonzalo Servat gser...@gmail.com wrote: On Mon, Feb 9, 2009 at 2:58 PM, peterhf peter.f...@sbcglobal.net wrote: Why not update to 1.2? This is plan B, the client doesn't want to upgrade at this time. What error message do you have? None! And debug is set to 3. This might actually be related to the sendmail wrapper (provided the mail function is enabled in php.ini). I had this exact problem just recently on a cPanel server and after looking the apache log, I found an error message saying sendmail couldn't be called directly, or something along those lines. If you *are* running cPanel, you have to turn off the following setting in exim: Track email origin through X-Source email headers. This setting causes the sendmail binary to be wrapped by a Perl script which tracks the email origin before calling the real sendmail binary. If you're not using cPanel, you might still want to check if the path to sendmail is a wrapper or a real sendmail (or equivalent) binary. If it is wrapped, try either changing the path to sendmail in php.ini to the real sendmail binary *or* renaming the wrapper and placing the real sendmail binary in its place. Good luck. - Gonzalo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
how to update comments
Hello! I paginate the previous comments. When I add a new comment, how should I put it on the top and removes the last shown comment. Can I just keep the middle comments unchanged? say: comment1 comment2 comment3 === I will add comment 1*, so it display comment1* comment1 comment2 == just remove the comment3 Thank you in advance Yuncong --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to Manage Multidimensional Array in Cakephp
I hope you understand the language POWERING CakePHP - that being PHP itself. foreach, while, for loops, as well as the SPL class (optionally). ...then there's also the count() function which can count the number of records within an array, or the number of records of an array within an array if an index to an array contains an array which was sent to the count() function. CakePHP assists with some of this in other aspects, such as the Set class, and certain helpers or behaviors, depending on your *specific* requirement. On Feb 7, 5:15 am, WebbedIT p...@webbedit.co.uk wrote: Maulik, That is a very generalised question. I advise you begin building your app and when you come to a specific real-time problem post your query along with some example code and someone will be happy to help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: ClassRegistry::init vs loadModel
Ok hopefully this will be the last time we need to explain this... App::import() only includes the file. So you would new to create a new instance every time. This is not recommended ClassRegistry::init() loads the file, adds the instance to the a object map and returns the instance. This is an easy and convenient way to access models. Controller::loadModel(); Uses ClassRegistry::init() adds the model to a property of the controller and also allows persistModel to be enabled. While you can do any of these things, you should ask yourself why you are creating dependencies on models that are not natural to the controller. If you have to do use any of these, then I would do so in reverse order of the way i described them. IE, Controller::loadModel () then CR::init() and actually I never use App::import() for models. Hope this helps. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Extract Data From An Array - Question
As an aside, you can also use the find('first' ...) method rather than find('all', ...) like you did, since you limit the result to one in your query anyway. Not much different, they both achieve the same thing, but it may be more readable in the code itself. On Feb 8, 5:06 pm, Alfredo Quiroga-Villamil laww...@gmail.com wrote: I really appreciate it guys, for some reason I didn't try this: Set::extract($aDestinationSummary, '{n}.0'); That extracts exactly the set I want, I knew there had to be a simple, clean way to get it but didn't try that for some reason. Thanks so much for the help. Alfredo On Sun, Feb 8, 2009 at 2:32 PM, brian bally.z...@gmail.com wrote: On Sun, Feb 8, 2009 at 10:47 AM, Alfredo Quiroga-Villamil laww...@gmail.com wrote: I have the following query: === $aParams = array( 'fields' = array( ifnull(CcCall.destination, 'Total') as destination ,'sec_to_time(sum(CcCall.sessiontime)) as duration' ,'truncate(sum(CcCall.sessionbill), 2) as charged' ) ,'conditions' = $aConditions ,'group' = 'CcCall.destination with rollup' ,'limit' = 1 ); $aDestinationSummary = $this-CcCall-find('all', $aParams); === which returns data as follows: === 2009-02-07 23:52:19 Debug: Array ( [0] = Array ( [0] = Array ( [destination] = algeria cellular algerie telecom [duration] = 00:01:30 [charged] = 0.51 ) ) ) === Typically I would use Set::extract to extract the data I want and format it to json to be rendered by the view. However, in this particular case, the data is returned in such a way that doesn't at least at first glance allow me to use Set::extract. Questions: 1- Is there a way to format the query above in such a way that returns the Model Name as the sub-index for the arrays, hence allowing me to use Set::extract? Cake can't know the model name here because of the use of DB functions, hence the 2nd 0 key. The first key is the results index, and so corresponds to Set's '{n}'. The 2nd key will always be 0. So, for example, to extract destination you just need to do: Set::extract($results, '{n}.0.destination'); 2- If 1 is not possible or even if it is, Do we hae a way to just get the elements containing data from the array. For instance, something like the following: $aDestSummary = Set::extract($aDestinationSummary, '{n}'); I'm not sure what you mean by that, based on the example result you posted. Perhaps you want an inner join?- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
Well if I remove the App::import(... and load the Email Component via the components var, then everything goes smoothly. I would like to avoid this however since this function is used across a large number of controllers but I'd really like to load it only when needed, as my app is already beginning to run slow. Any ideas? On Feb 9, 11:43 am, brian bally.z...@gmail.com wrote: Well, I'm certainly no expert, so you might well benefit from someone else jumping in here. ;-) Try removing these lines: App::import(Component,Email); $this-Email = new EmailComponent(); ... as well as the inititlaize line I suggested. Then, add this line to the top of AppController: public $components = array('Email'); (replace public with var if you're stuck with PHP4.x) See if that works. I have a feeling the problem stems from the fact that you're importing a component into AppController, rather than loading it in the normal fashion. If you don't send email from many controllers, this may not be the most efficient way, but you'll at least be a bit closer to figuring out why it's failing for you. The crux of it is that the component isn't getting a handle to the controller for some reason. On Mon, Feb 9, 2009 at 2:29 AM, Kyle Decot kdec...@gmail.com wrote: When trying to use the initialize method, I get a undefined method error: Fatal error: Call to undefined method EmailComponent::initialize() in / home/affinit3/public_html/theskateparkdirectory/app/app_controller.php on line 60 Any ideas? On Feb 9, 2:22 am, brian bally.z...@gmail.com wrote: change the method name to _sendEmailNotification (single underscore) to make it protected, rather than private $this-Email = new EmailComponent(); $this-Email-initialize($this); Those are the only things that I can think of. I've never imported a component inside of an AppController method - private, protected, or public. Maybe that's the problem? On Mon, Feb 9, 2009 at 1:57 AM, Kyle Decot kdec...@gmail.com wrote: Ah, stupid mistake but I've updated the set to be body instead of email_body and am still getting the same results. Any other ideas? On Feb 9, 1:55 am, brian bally.z...@gmail.com wrote: sorry, I should have unquoted that. This should be clearer. $this-set(email_body,$body); Notice (8): Undefined variable: body [APP/views/elements/email/html/ email_notification.ctp, line 1] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Firefox Search Engine Plug-In
That's actually a really good idea, Hernan. The OpenSearch plugins are quite easy to make, and can be very helpful (I love using the Sourceforge opensearch plugin). Similar functionality to bookmarklets but with less typing. ;) Using it for the CakePHP documentation is one of those Eureka moments that I just didn't have. :D On Feb 9, 10:04 am, Hernan hernancalabr...@gmail.com wrote: Hi there, This is my first CakePHP post by the way. I'm kind of new to CakePHP but I already love it. I've created a search engine plug-in to search the 1.2 docs. You can download it here:https://addons.mozilla.org/en-US/firefox/search?q=cakecat=4%2C0 You'll have to register if you want to use it. This is because of their secutiry policy to new plug-ins. To make it public I'd need other people to review it so if try it and you like it, please review it so I can make it available to general public. Any feedback or help with it would be greatly appreciated! Also, the code is available if anyone wants it. It's just an XML with a base64 encoded icon. Thanks, Hernán --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
Well, you're closer to a solution, at least. AFAIK, you shouldn't need to do anything special with the component after loading with App::import(). But, the component is obviously missing a handle to the controller. So, the problem might be a combination of the fact that you're doing this in AppController and that the method is private/protected. You could try making it a public method. That last bit is not much better than a wild guess, though. On Mon, Feb 9, 2009 at 1:27 PM, Kyle Decot kdec...@gmail.com wrote: Well if I remove the App::import(... and load the Email Component via the components var, then everything goes smoothly. I would like to avoid this however since this function is used across a large number of controllers but I'd really like to load it only when needed, as my app is already beginning to run slow. Any ideas? On Feb 9, 11:43 am, brian bally.z...@gmail.com wrote: Well, I'm certainly no expert, so you might well benefit from someone else jumping in here. ;-) Try removing these lines: App::import(Component,Email); $this-Email = new EmailComponent(); ... as well as the inititlaize line I suggested. Then, add this line to the top of AppController: public $components = array('Email'); (replace public with var if you're stuck with PHP4.x) See if that works. I have a feeling the problem stems from the fact that you're importing a component into AppController, rather than loading it in the normal fashion. If you don't send email from many controllers, this may not be the most efficient way, but you'll at least be a bit closer to figuring out why it's failing for you. The crux of it is that the component isn't getting a handle to the controller for some reason. On Mon, Feb 9, 2009 at 2:29 AM, Kyle Decot kdec...@gmail.com wrote: When trying to use the initialize method, I get a undefined method error: Fatal error: Call to undefined method EmailComponent::initialize() in / home/affinit3/public_html/theskateparkdirectory/app/app_controller.php on line 60 Any ideas? On Feb 9, 2:22 am, brian bally.z...@gmail.com wrote: change the method name to _sendEmailNotification (single underscore) to make it protected, rather than private $this-Email = new EmailComponent(); $this-Email-initialize($this); Those are the only things that I can think of. I've never imported a component inside of an AppController method - private, protected, or public. Maybe that's the problem? On Mon, Feb 9, 2009 at 1:57 AM, Kyle Decot kdec...@gmail.com wrote: Ah, stupid mistake but I've updated the set to be body instead of email_body and am still getting the same results. Any other ideas? On Feb 9, 1:55 am, brian bally.z...@gmail.com wrote: sorry, I should have unquoted that. This should be clearer. $this-set(email_body,$body); Notice (8): Undefined variable: body [APP/views/elements/email/html/ email_notification.ctp, line 1] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: how to update comments
'order' = array('Comment.created' = 'DESC') On Mon, Feb 9, 2009 at 12:08 PM, test njit...@gmail.com wrote: Hello! I paginate the previous comments. When I add a new comment, how should I put it on the top and removes the last shown comment. Can I just keep the middle comments unchanged? say: comment1 comment2 comment3 === I will add comment 1*, so it display comment1* comment1 comment2 == just remove the comment3 Thank you in advance Yuncong --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Model.save() works OK but cannot manage to get Model.savaAll() to work (rollback)
Hello, I am starting with CakePHP, the latest version. I have created 2 tables: 'users' and 'user_details' - they are obviously related ;) I am creating a record using Model.save(), it works OK. I am trying to do the same with saveAll(), expecting that my user **and** his details will be saved in the same transaction but I get a rollback immediatly after the user record is created :-( I am using MySQL innodb. I don't seem to get any more details as to why I get a rollback before the user details are stored - I am stuck. I was expecting to get a SQL error displayed in case some NOT NULL constraint or other SQL constraint was not met - I checked my code many time. Thanks for your help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
getting information from all your plugins
I'm trying to build a cms that works a lot with plugins. Now I need to compose a few menu's which are filled with links to my plugins. Those links also need to be provided by all my plugins. So my question is, how do I get info from all my plugins? It would be nice if I could do it like this: [CODE]/* /plugins/blog/blog_app_controller.php */ ?php class BlogAppController extends AppController { var $name = 'Blog'; var $menuLinks = array( 'Blog' = array('plugin' = 'Blog', 'controller' = 'blog', 'action' = 'index'), ); var $adminLinks = array( 'Blog Settings' = array('plugin' = 'Blog', 'controller' = 'blog', 'action' = 'settings', 'admin' = true), ); } ?[/CODE] of course, the admin-links will have the admin-routing, so that would be '/admin/blog/settings' Could anyone help me? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
iphone version of my site
i made an iphone version of my site is there any way to put a code in my index.ctp whenever iphone users go there redirect them to iphone version or any other solutions thank You -- View this message in context: http://n2.nabble.com/iphone-version-of-my-site-tp2298939p2298939.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: iphone version of my site
I am not sure if cakephp supports this; but you usually would have to find a way to recognize mobile headers. There might already be a library out there for this. Last time I worked on this was using modperl and we had all the headers in the DB allowing us to recognize the device. See this below to give you an idea: http://howto.devtoolsonline.com/content/tutorials/how-to-recognize-mobile-devices/how-to-recognize-mobile-devices.html Hope this helps and leads you in the right direction. Regards, Alfredo On Mon, Feb 9, 2009 at 2:25 PM, monirr444 muni...@hotmail.com wrote: i made an iphone version of my site is there any way to put a code in my index.ctp whenever iphone users go there redirect them to iphone version or any other solutions thank You -- View this message in context: http://n2.nabble.com/iphone-version-of-my-site-tp2298939p2298939.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Extract Data From An Array - Question
Appreciate the comment. The limit 1 was just there while I was testing the stuff, it went away soon after I found out the correct syntax. Thanks for the help, Alfredo On Mon, Feb 9, 2009 at 1:22 PM, BrendonKoz brendon...@hotmail.com wrote: As an aside, you can also use the find('first' ...) method rather than find('all', ...) like you did, since you limit the result to one in your query anyway. Not much different, they both achieve the same thing, but it may be more readable in the code itself. On Feb 8, 5:06 pm, Alfredo Quiroga-Villamil laww...@gmail.com wrote: I really appreciate it guys, for some reason I didn't try this: Set::extract($aDestinationSummary, '{n}.0'); That extracts exactly the set I want, I knew there had to be a simple, clean way to get it but didn't try that for some reason. Thanks so much for the help. Alfredo On Sun, Feb 8, 2009 at 2:32 PM, brian bally.z...@gmail.com wrote: On Sun, Feb 8, 2009 at 10:47 AM, Alfredo Quiroga-Villamil laww...@gmail.com wrote: I have the following query: === $aParams = array( 'fields' = array( ifnull(CcCall.destination, 'Total')as destination ,'sec_to_time(sum(CcCall.sessiontime)) as duration' ,'truncate(sum(CcCall.sessionbill), 2) as charged' ) ,'conditions' = $aConditions ,'group' = 'CcCall.destination with rollup' ,'limit' = 1 ); $aDestinationSummary = $this-CcCall-find('all', $aParams); === which returns data as follows: === 2009-02-07 23:52:19 Debug: Array ( [0] = Array ( [0] = Array ( [destination] = algeria cellular algerie telecom [duration] = 00:01:30 [charged] = 0.51 ) ) ) === Typically I would use Set::extract to extract the data I want and format it to json to be rendered by the view. However, in this particular case, the data is returned in such a way that doesn't at least at first glance allow me to use Set::extract. Questions: 1- Is there a way to format the query above in such a way that returns the Model Name as the sub-index for the arrays, hence allowing me to use Set::extract? Cake can't know the model name here because of the use of DB functions, hence the 2nd 0 key. The first key is the results index, and so corresponds to Set's '{n}'. The 2nd key will always be 0. So, for example, to extract destination you just need to do: Set::extract($results, '{n}.0.destination'); 2- If 1 is not possible or even if it is, Do we hae a way to just get the elements containing data from the array. For instance, something like the following: $aDestSummary = Set::extract($aDestinationSummary, '{n}'); I'm not sure what you mean by that, based on the example result you posted. Perhaps you want an inner join?- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: iphone version of my site
I haven't used it yet but the RequestHandler component has an isMobile() function call that may be enough to help change layouts depending on the device. Brett Wilton http://wiltonsoftware.co.nz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Custom validation error message not displaying
I have created a custom validation rule which is working as required, but does not pass the error message to $this-validationErrors when it is triggered. // Model: validate rules var $validate = array( ..., 'partner_information' = array( 'rule' = array('__validatePartnerInformation'), 'message' = 'This field cannot be left blank' ) } .. // Model: validate method function __validatePartnerInformation($data) { return $this-data[$this-name]['nature_id'] == 3 $this-data [$this-name]['partner_information'] == '' ? false : true; } // View .. echo debug($this-validationErrors); echo $form-input('Organisation.name', array('label' = 'Name')); echo $form-input('Scheme.partner_information'); .. I set debug to 2 when validation fails so I can echo debug($this- validationErrors); and whilst leaving the Organisation.name field blank triggers and displays this field cannot be blank my custom validation on Scheme.partner_information fails validation but does not show an error message. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: iphone version of my site
If ModelBaker can do it (built with CakePHP as the core), I'd imagine we can too! I haven't figured out how to make an iPhone based layout yet though so I won't be much help in that department. :( On Feb 9, 2:43 pm, Brett Wilton bdwil...@gmail.com wrote: I haven't used it yet but the RequestHandler component has an isMobile() function call that may be enough to help change layouts depending on the device. Brett Wiltonhttp://wiltonsoftware.co.nz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Form validation error not being displayed
I've just came across the same problem, my validation rules stop the form from submitting at thr right times, but no the error messages are not being sent to $this-validationErrors to be displayed apart from my one validation rule from an associated model which displays fine. Anyone else experiencing this/got a solution? My recent post on this topic: http://groups.google.com/group/cake-php/t/5780ddf17a1127c7 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Custom validation error message not displaying
Update: After searching and finding someone else having a similar unresolved problem last month (whoops - I should have searched first) I modified my validate variable to a single 'notEmpty' rule on one field (to take my custom rule out of the equation). Leaving that field empty stopped the save as expected, but still failed to pass the error message to $this-validationErrors. My related model validation message is passed perfectly if it triggers, could this be something to do with saveAll overwriting $this- validationErrors array when checking validation for my related tables? Grasping at straws here. Paul. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: iphone version of my site
i have the layout and the java script for the iphone i used the Joe Hewitt's IUI layout and javascrpt it worked fine just i dont have much experience with cakephp i dont know how this deafult.ctp works whatever i put in there it share it with other view if u can help with some BrendonKoz wrote: If ModelBaker can do it (built with CakePHP as the core), I'd imagine we can too! I haven't figured out how to make an iPhone based layout yet though so I won't be much help in that department. :( On Feb 9, 2:43 pm, Brett Wilton bdwil...@gmail.com wrote: I haven't used it yet but the RequestHandler component has an isMobile() function call that may be enough to help change layouts depending on the device. Brett Wiltonhttp://wiltonsoftware.co.nz -- View this message in context: http://n2.nabble.com/iphone-version-of-my-site-tp2298939p2299441.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Submit not translated in baked views
Hi. I used the console to bake some views and noticed that Submit in forms is not translated. I guess that line 47 in the template (cake/console/libs/templates/ views/form.ctp) should be changed from: echo ?php echo \$form-end('Submit');?\n; to: echo ?php echo \$form-end(__('Submit', true));?\n; - but maybe there is an even better way? (E.g. $form-end(array)) would give a submit button with the default submit text from the form helper). Regards Jonathan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
extended saveAll method
Let's see if some one can help me. I'm try to test is the method appSave in app_model.php ( http://bin.cakephp.org/view/1031421151 ) makes everything (insert, update or delete) in a single transaction, but I can't figure out how to do this. Here is the test_case so you can see it clear. http://bin.cakephp.org/view/826900459 Regards Martin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: iphone version of my site
something like this should work (from modelbaker...) var $components = array( 'RequestHandler' ); function beforeFilter() { if ($this-RequestHandler-isMobile() || stripos($_SERVER['HTTP_USER_AGENT'],'Android')) { if ($this-RequestHandler-isAjax()) { $this-layout = 'ajax'; } else { $this-layout = 'iphone'; } $this-mobileView = '.iphone'; } } On Feb 9, 2009, at 2:25 PM, monirr444 wrote: i made an iphone version of my site is there any way to put a code in my index.ctp whenever iphone users go there redirect them to iphone version or any other solutions thank You -- View this message in context: http://n2.nabble.com/iphone-version-of-my-site-tp2298939p2298939.html Sent from the CakePHP mailing list archive at Nabble.com. Andras Kende http://kende.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Firefox Search Engine Plug-In
On Mon, Feb 9, 2009 at 12:04 PM, Hernan hernancalabr...@gmail.com wrote: Hi there, This is my first CakePHP post by the way. I'm kind of new to CakePHP but I already love it. I've created a search engine plug-in to search the 1.2 docs. You can download it here: https://addons.mozilla.org/en-US/firefox/search?q=cakecat=4%2C0 You'll have to register if you want to use it. This is because of their secutiry policy to new plug-ins. To make it public I'd need other people to review it so if try it and you like it, please review it so I can make it available to general public. Any feedback or help with it would be greatly appreciated! Also, the code is available if anyone wants it. It's just an XML with a base64 encoded icon. Credits? http://bin.cakephp.org/saved/42469 -- MARCELO DE F. ANDRADE (aka eleKtron) Belem, PA, Amazonia, Brazil Linux User #221105 [...@pará ~]# links http://pa.slackwarebrasil.org/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
MooTools Ajax Pagination
The project that I am currently working on is constrained by the fact that I have to use MooTools for a few things we are using. I also don't really want to use Prototype as the load times in certain cases aren't exactly friendly. So I was wondering if there is anywhere I can learn how to implement AJAX Pagination with MooTools, I know there is a tutorial in the bakery for JQuery, I was hoping for something similar using MooTools. Or if someone can give me some examples here. Any help is appreciated, thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
I tried changing the method to be public but the problems still persist. Any other suggestions? I'm really stumped on this! On Feb 9, 1:51 pm, brian bally.z...@gmail.com wrote: Well, you're closer to a solution, at least. AFAIK, you shouldn't need to do anything special with the component after loading with App::import(). But, the component is obviously missing a handle to the controller. So, the problem might be a combination of the fact that you're doing this in AppController and that the method is private/protected. You could try making it a public method. That last bit is not much better than a wild guess, though. On Mon, Feb 9, 2009 at 1:27 PM, Kyle Decot kdec...@gmail.com wrote: Well if I remove the App::import(... and load the Email Component via the components var, then everything goes smoothly. I would like to avoid this however since this function is used across a large number of controllers but I'd really like to load it only when needed, as my app is already beginning to run slow. Any ideas? On Feb 9, 11:43 am, brian bally.z...@gmail.com wrote: Well, I'm certainly no expert, so you might well benefit from someone else jumping in here. ;-) Try removing these lines: App::import(Component,Email); $this-Email = new EmailComponent(); ... as well as the inititlaize line I suggested. Then, add this line to the top of AppController: public $components = array('Email'); (replace public with var if you're stuck with PHP4.x) See if that works. I have a feeling the problem stems from the fact that you're importing a component into AppController, rather than loading it in the normal fashion. If you don't send email from many controllers, this may not be the most efficient way, but you'll at least be a bit closer to figuring out why it's failing for you. The crux of it is that the component isn't getting a handle to the controller for some reason. On Mon, Feb 9, 2009 at 2:29 AM, Kyle Decot kdec...@gmail.com wrote: When trying to use the initialize method, I get a undefined method error: Fatal error: Call to undefined method EmailComponent::initialize() in / home/affinit3/public_html/theskateparkdirectory/app/app_controller.php on line 60 Any ideas? On Feb 9, 2:22 am, brian bally.z...@gmail.com wrote: change the method name to _sendEmailNotification (single underscore) to make it protected, rather than private $this-Email = new EmailComponent(); $this-Email-initialize($this); Those are the only things that I can think of. I've never imported a component inside of an AppController method - private, protected, or public. Maybe that's the problem? On Mon, Feb 9, 2009 at 1:57 AM, Kyle Decot kdec...@gmail.com wrote: Ah, stupid mistake but I've updated the set to be body instead of email_body and am still getting the same results. Any other ideas? On Feb 9, 1:55 am, brian bally.z...@gmail.com wrote: sorry, I should have unquoted that. This should be clearer. $this-set(email_body,$body); Notice (8): Undefined variable: body [APP/views/elements/email/html/ email_notification.ctp, line 1] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Firefox Search Engine Plug-In
Credits? I'm not sure what you mean by that Marcelo. If you want my full name is Hernán Calabrese (hernancalabrese arroba gmail.com) I'll add that the MIT license to the plugin, good idea. Glad you liked it. What I do, is assign the keyword cake to that plugin so I can type directly in the address bar cake something and it will search something in the cake docs. To assign a keyword to a Search Engine plugin you have to click Manage Search Engines..., then select and edit the keyword. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
International validation messages in a contact form
Hi everybody, i have set up a Contact-Model like this: http://paste.pocoo.org/show/103359/ (according to http://snook.ca/archives/cakephp/contact_form_cakephp/). i want to provide international validation messages so i output the form-fields like this: http://paste.pocoo.org/show/103365/ .. however the error-messages are still some default-ones... does anybody know why this could be? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
Actually, yes, I think I have one more idea. When I suggested calling $this-Email-initialize($this) I think that I should have said $this-Email-init($this) So, go back to what you had initially (heh): App::import(Component,Email); $this-Email = new EmailComponent(); $this-Email-init($this); If that doesn't work, I'm afraid you'll need to consult an expert. On Mon, Feb 9, 2009 at 6:28 PM, Kyle Decot kdec...@gmail.com wrote: I tried changing the method to be public but the problems still persist. Any other suggestions? I'm really stumped on this! On Feb 9, 1:51 pm, brian bally.z...@gmail.com wrote: Well, you're closer to a solution, at least. AFAIK, you shouldn't need to do anything special with the component after loading with App::import(). But, the component is obviously missing a handle to the controller. So, the problem might be a combination of the fact that you're doing this in AppController and that the method is private/protected. You could try making it a public method. That last bit is not much better than a wild guess, though. On Mon, Feb 9, 2009 at 1:27 PM, Kyle Decot kdec...@gmail.com wrote: Well if I remove the App::import(... and load the Email Component via the components var, then everything goes smoothly. I would like to avoid this however since this function is used across a large number of controllers but I'd really like to load it only when needed, as my app is already beginning to run slow. Any ideas? On Feb 9, 11:43 am, brian bally.z...@gmail.com wrote: Well, I'm certainly no expert, so you might well benefit from someone else jumping in here. ;-) Try removing these lines: App::import(Component,Email); $this-Email = new EmailComponent(); ... as well as the inititlaize line I suggested. Then, add this line to the top of AppController: public $components = array('Email'); (replace public with var if you're stuck with PHP4.x) See if that works. I have a feeling the problem stems from the fact that you're importing a component into AppController, rather than loading it in the normal fashion. If you don't send email from many controllers, this may not be the most efficient way, but you'll at least be a bit closer to figuring out why it's failing for you. The crux of it is that the component isn't getting a handle to the controller for some reason. On Mon, Feb 9, 2009 at 2:29 AM, Kyle Decot kdec...@gmail.com wrote: When trying to use the initialize method, I get a undefined method error: Fatal error: Call to undefined method EmailComponent::initialize() in / home/affinit3/public_html/theskateparkdirectory/app/app_controller.php on line 60 Any ideas? On Feb 9, 2:22 am, brian bally.z...@gmail.com wrote: change the method name to _sendEmailNotification (single underscore) to make it protected, rather than private $this-Email = new EmailComponent(); $this-Email-initialize($this); Those are the only things that I can think of. I've never imported a component inside of an AppController method - private, protected, or public. Maybe that's the problem? On Mon, Feb 9, 2009 at 1:57 AM, Kyle Decot kdec...@gmail.com wrote: Ah, stupid mistake but I've updated the set to be body instead of email_body and am still getting the same results. Any other ideas? On Feb 9, 1:55 am, brian bally.z...@gmail.com wrote: sorry, I should have unquoted that. This should be clearer. $this-set(email_body,$body); Notice (8): Undefined variable: body [APP/views/elements/email/html/ email_notification.ctp, line 1] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Firefox Search Engine Plug-In
Oh, I just saw your 1 star review in the mozzila dev site. Thank you very much. Well, I didn't know it existed and no, I didn't copy from it. I've made it from scratch wasting my time reading specification BS, coding it and uploading it, converting the icon to base64 etc. Do you really think I'd really waste my time on this add-on if I knew there was one??? C'mon man. I code, I don't steal other people's code for fun or money. I don't know when you coded that, but if you would have uploaded to the add-ons page you would saved me some time I could have used for something more productive for ME, instead of the community. But don't worry, if this is the trearment I'm going to get for contributing I'll prefer just to leech everything and keep my code for me (you know very well it takes an extra effort to publish it) Also, you should have come to me in the first place. We, people, talk. You have to understand that I don't visit every fking page on the internet just to be sure nobody has ever written something like that before...Specially when we are talking about something as dumb as a search plug-in! Oh, and BTW, mine uses another icon, and it searches the doc, not the API like your version. So it would be great if you could publish yours too so we, the community, can search both the doc AND the API. Voçe não comprende? Eu comprendo (mas o menos) português, fala português. (Aunque español sería melhor) Take care --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
Thanks for all your help but I'm still getting an undefined function for init as well as the other errors. Does anyone else have any ideas? Brian and myself are all out of them! On Feb 9, 6:56 pm, brian bally.z...@gmail.com wrote: Actually, yes, I think I have one more idea. When I suggested calling $this-Email-initialize($this) I think that I should have said $this-Email-init($this) So, go back to what you had initially (heh): App::import(Component,Email); $this-Email = new EmailComponent(); $this-Email-init($this); If that doesn't work, I'm afraid you'll need to consult an expert. On Mon, Feb 9, 2009 at 6:28 PM, Kyle Decot kdec...@gmail.com wrote: I tried changing the method to be public but the problems still persist. Any other suggestions? I'm really stumped on this! On Feb 9, 1:51 pm, brian bally.z...@gmail.com wrote: Well, you're closer to a solution, at least. AFAIK, you shouldn't need to do anything special with the component after loading with App::import(). But, the component is obviously missing a handle to the controller. So, the problem might be a combination of the fact that you're doing this in AppController and that the method is private/protected. You could try making it a public method. That last bit is not much better than a wild guess, though. On Mon, Feb 9, 2009 at 1:27 PM, Kyle Decot kdec...@gmail.com wrote: Well if I remove the App::import(... and load the Email Component via the components var, then everything goes smoothly. I would like to avoid this however since this function is used across a large number of controllers but I'd really like to load it only when needed, as my app is already beginning to run slow. Any ideas? On Feb 9, 11:43 am, brian bally.z...@gmail.com wrote: Well, I'm certainly no expert, so you might well benefit from someone else jumping in here. ;-) Try removing these lines: App::import(Component,Email); $this-Email = new EmailComponent(); ... as well as the inititlaize line I suggested. Then, add this line to the top of AppController: public $components = array('Email'); (replace public with var if you're stuck with PHP4.x) See if that works. I have a feeling the problem stems from the fact that you're importing a component into AppController, rather than loading it in the normal fashion. If you don't send email from many controllers, this may not be the most efficient way, but you'll at least be a bit closer to figuring out why it's failing for you. The crux of it is that the component isn't getting a handle to the controller for some reason. On Mon, Feb 9, 2009 at 2:29 AM, Kyle Decot kdec...@gmail.com wrote: When trying to use the initialize method, I get a undefined method error: Fatal error: Call to undefined method EmailComponent::initialize() in / home/affinit3/public_html/theskateparkdirectory/app/app_controller.php on line 60 Any ideas? On Feb 9, 2:22 am, brian bally.z...@gmail.com wrote: change the method name to _sendEmailNotification (single underscore) to make it protected, rather than private $this-Email = new EmailComponent(); $this-Email-initialize($this); Those are the only things that I can think of. I've never imported a component inside of an AppController method - private, protected, or public. Maybe that's the problem? On Mon, Feb 9, 2009 at 1:57 AM, Kyle Decot kdec...@gmail.com wrote: Ah, stupid mistake but I've updated the set to be body instead of email_body and am still getting the same results. Any other ideas? On Feb 9, 1:55 am, brian bally.z...@gmail.com wrote: sorry, I should have unquoted that. This should be clearer. $this-set(email_body,$body); Notice (8): Undefined variable: body [APP/views/elements/email/html/ email_notification.ctp, line 1] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: view pdf files?
Thanks Brian. I created a folder in webroot that leads to my pdf. It works great! Just on a side note, is this a standard way of doing this, creating additional folder structures in the webroot? I was just under the impression that all this was supposed to be done in the views folder. Thanks! justclint On Feb 8, 10:45 pm, brian bally.z...@gmail.com wrote: Oh, I thought you meant it was a direct link to the PDF. Which your link appears to be. But your controller action seems to be trying to render the PDF. Do you have a route set up for health_questionaire.pdf to point to YourController::health_questionnaire()? Unless you've overloaded render() in some funky fashion, that's not going to work. If you want Cake to feed the PDF file, have a look at MediaView.[1] But, if you just need a direct link to a PDF file, the URL should point to wherever the file is relative to the webroot dir (eg /fitness_lab/forms/health_questionnaire.pdf if the file is in app/webroot/fitness_lab/forms dir). Just make sure it's below webroot. MediaView can serve files that are parked above webroot, btw (ie inaccessible to normal requests). [1]http://api.cakephp.org/class/media-view On Mon, Feb 9, 2009 at 12:39 AM, justclint justcl...@gmail.com wrote: Thanks for replying Brian. Actually I had a wrong link in there but after fixing it I dont get the error message anymore. Now it just renders my index page while the url still end in .pdf. In my controller I got this: function forms() { $this-pageTitle = 'Fitness Lab : Forms'; $this-set('page', 'forms'); $this-set('pageName', 'Forms'); $this-render('/fitness_lab/forms/index'); }// end forms() function health_questionnaire() { $this-pageTitle = 'Fitness Lab : Forms : Health Questionnaire'; // set page info $this-set('page', 'forms'); $this-set('pageName', 'Health Questionnaire'); // set view file $this-render('/fitness_lab/forms/health_questionnaire.pdf'); }// end health_questionnaire() Im not using a mode since the content is static. In my views folder I have fitness_lab/forms. My link in fitness_lab/forms/index looks like this a href=health_questionaire.pdf ?=$html-image('/img/logos/pdficon_small.gif', array('class' = 'pdficon')); ?/a If it helps heres a url to the page im working on. http://www.networkfitness.com/nf_dev/fitness_lab/forms/ You can see that when you click on the download a form link that the url displays correctly but the page does not render the pdf file. Thanks! justclint On Feb 8, 9:18 pm, brian bally.z...@gmail.com wrote: I guess the obvious questions are, what does your link URL look like, and what's in this error.php file at line 25? Shouldn't that be app_error.php, btw? On Mon, Feb 9, 2009 at 12:01 AM, justclint justcl...@gmail.com wrote: Everything I've seen doing a search on google and in this group seems to be based on converting files/views to pdf. I have pdf files that I just need to link to. I keep getting this parse error when I click on the link to the pdf file: Parse error: syntax error, unexpected ';', expecting T_FUNCTION in / data/15/1/101/96/1753748/user/1895223/htdocs/nf_dev/app/error.php on line 25 Is there a way to just link to existing pdf files? Thanks! justclint --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: view pdf files?
Thanks mscdex. Your 2nd suggestion is exactly what Im trying to do. Brian suggested adding the directory to webroot which works as intended. However, I did have the pdfs in a the views folder and I tried the redirect() but I run into the same problem trying to define what the controller and action would be for a pdf file. How would I use this redirect to show the pdf file? Thanks! justclint On Feb 8, 10:08 pm, mscdex msc...@gmail.com wrote: Generally if you are manually rendering a view, you should do: $this-autoRender = false; If you are trying to get the PDF to show up instead of the controller action's view, you could try doing a $this-redirect() as documented here:http://book.cakephp.org/view/425/redirect --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: MooTools Ajax Pagination
Here is the code of a really basic mootools JS object that can pretty much be dropped in for paging a standard cake index view http://pastebin.com/d43137c All you have to do is wrap your view code in a div and specify that id as your pagingDivId This is extremely basic and doesnt make allowance for request failure events etc - just the basics. HTH, Paul. On Feb 10, 11:45 am, Arak Tai'Roth nielsen.dus...@gmail.com wrote: The project that I am currently working on is constrained by the fact that I have to use MooTools for a few things we are using. I also don't really want to use Prototype as the load times in certain cases aren't exactly friendly. So I was wondering if there is anywhere I can learn how to implement AJAX Pagination with MooTools, I know there is a tutorial in the bakery for JQuery, I was hoping for something similar using MooTools. Or if someone can give me some examples here. Any help is appreciated, thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: view pdf files?
You don't need the controller serve PDFs unless you have some reason to keep them inaccessible to casual browsers and want to use some kind of authorisation. In that case, you'd want to look at MediaView. Otherwise, just let Apache serve it as any other file. Hence, you put it under webroot. Anything that's under that directory is accessible with a direct link--images, javascript, CSS files, etc. So, you can create whatever directory structure you want in there if you have reason to. Perhaps the confusion stems from the fact that the HtmlHelper has a method to create image links. But, if you look carefully, you'll see that the URL points directly to the image file under webroot, not a controller. I think that maybe the only reason $html-image() exists is because too many people were becoming confused by Cake's mysterious DOCUMENT_ROOT shuffling (I was) that they were messing up their img links. To answer your other question about the views dir, all those files in there are basically templates for displaying a controller's output. That's not the webroot, but simply a convenient directory in which to store template files. What mscdex was suggesting is, if you happened to have a controller action where you wanted to redirect the request to some PDF file, you'd use the public URL as the param to redirect(). Something like $this-redirect('/fitness_lab/forms/health_questionnaire.pdf'); But I'm pretty sure that's not what you're after here. Just leave the controller out of it. On Mon, Feb 9, 2009 at 8:01 PM, justclint justcl...@gmail.com wrote: Thanks mscdex. Your 2nd suggestion is exactly what Im trying to do. Brian suggested adding the directory to webroot which works as intended. However, I did have the pdfs in a the views folder and I tried the redirect() but I run into the same problem trying to define what the controller and action would be for a pdf file. How would I use this redirect to show the pdf file? Thanks! justclint On Feb 8, 10:08 pm, mscdex msc...@gmail.com wrote: Generally if you are manually rendering a view, you should do: $this-autoRender = false; If you are trying to get the PDF to show up instead of the controller action's view, you could try doing a $this-redirect() as documented here:http://book.cakephp.org/view/425/redirect --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Something wrong with authentication with multiple roles
I'm new in cakePHP. And I don't know how to question directly to cakePHP development team. I think Acl in cakePHP is good. But I've found some thing wrong with authentication check, with multiple roles. Details: File: cake/libs/controller/components/acl.php Class: DbAcl Method: Check Line: 282. Code: return false; Line: 299. Code: return false; I've had some tests with this method. I've seen that, DbAcl::check($aro, $aco, $action = '*') accept multiple request object (mean that $aro may have 1, 2, 3 or more request object). But in the code, return false is used at above line (282 and 299), there is only one $aro in list to be checked. In my case, I've change all these line to continue. What is your opinion ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
Just out of curiousity, what version of CakePHP are you using? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Email Notification Problem
I'm using 1.2.1. Any thoughts? On Feb 9, 10:43 pm, mscdex msc...@gmail.com wrote: Just out of curiousity, what version of CakePHP are you using? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using Configure class in custom AppError
It depends on what do you do in beforeFilter (and there is NO callback named beforeAction) On Feb 9, 8:44 pm, oleonav o.verh...@wrg-nl.com wrote: Hi Loboto, that thought came across my mind already. So I will refraise my question; How do I run functions etc. found in the beforeAction of the AppController or at least run actions needed to initialize the Configure class without duplicating all code from the AppController - beforeAction to my AppError class.. Any guesses? Thanks On Feb 7, 1:06 pm, Dr. Loboto drlob...@gmail.com wrote: AppController::beforeFilter() isn't called if no controller found to serve request. So yours Configure just do not contain values you need on Missing Controller errors as they wasn't set. On Feb 6, 8:54 pm, oleonav o.verh...@wrg-nl.com wrote: Hi there, I have some variables set using the Configure class in the beforeFunction of the main AppController. I use for multiple things, for example to set the title of the page. I need a custom 404 error page, so I made a custom AppError class containing the function error404, which overrides the build function from the framework (see below). The problem is that the Configure class is not working at all in AppError. Any suggestions? regards, class sample -- class AppError extends ErrorHandler { function error404() { //read the config file $config = Configure::read('siteConfig'); //set it so it's available in layout views $this-set('config', $config); ... ... run other code . //run parent class function parent::__construct(); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: FileMaker database driver
Hi bdb, I'm highly interested in your work in this area. I was just thinking of starting this project myself. Can you tell me if you've made any progress since April 2006? - Alex On Jan 13, 12:10 am, Louie Miranda lmira...@gmail.com wrote: Hi! Very interested. Where could we see the component for FX.php to be able to integrate cakephp+fm. I am also wondering if FX.php will ever work for FM 9 and 10. Louie On Apr 12 2006, 7:48 pm, bdb amfm...@gmail.com wrote: I have hacked together a version of The Cake Blog Tutorial from manual.cakephp.org that uses a FileMakerdatabasefor data storage and retrieval. Currently it is very specific to the tutorial example, but I am working on making the functions generic so they can be applied to other projects I have going. I am utilizing FX,php (www.iviking.org) which I placed in the vendors folder and then created a dbo_fmpro.php file in cake/libs/model/dbo/ that defines a class called DboFmpro. Since FileMaker does not use SQL, the DboFmpro class DOES NOT extend DboSource, so I have had to recreate much of the functionality that is typically inherited from dbo_sourse.php, datasource.php, and model_php5.php into either dbo_fmpro.php or app_model.php. The app/config/database.php file has a 'driver' value of 'fmpro' and contains the parameters that are usually found in the server_data.php file under FX. At this point I am curious to know if there's anyone else out there that would be interested in this project. I'm very comfortable with the concepts of OOP and objectify my FileMaker scripts as much as possible, but I am currently hacking my way through this with a big, ugly machete -- using it as a OOPHP learning process while creating a framework for various FileMaker-hosted web sites that I have designed. The Cake Blog Tutorial uses exactly the same code as the manual provides so you can easily switch back and forth between the mysql-based system and the fmpro-based system by simply changingdatabase.php and removing (or just renaming) app_model.php -- which was my ultimate design goal from the outset. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
using ajax helper to reload an element
Hello everyone, I'm new to CakePHP (like everyone else on here, it seems), and so I'm having trouble utilizing the ajax helper to refresh a div containing an element. Right now I have my default (home) controller setup to show a view which utilizes an element to pull in a truncated version of a search result. So you have: home controller (no logic here yet) - home view - search element1 I'm trying to figure out a way to refresh the div the element is within by calling the element with a different parameter (to apply a filter, for example). In my home controller I have a refreshSearchElement() method that tries to return the output of the element, which my ajax observeField calls when a drop down menu is changed. Apparently that doesn't work, because I get 'Call to undefined method HomeController::element()' when I call $this-element ('search_element_1'). I guess that only works in views? Is there a way to pull in an element's contents inside a Controller (and preferably utilize any caching)? Or can anyone recommend different method to approach this? Thanks! -- Corey Crawford --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
hasMany
Hi How to make query or hasmany relation in model There is three table 1.Members 2.Network 3.News Network (Table) will provide the member associate with user. Member (Table) will provide the type of member. then News will selected. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
hasMany
Hi How to make query or hasmany relation in model There is three table 1.Members 2.Network 3.News Network (Table) will provide the member associate with user. Member (Table) will provide the type of member. then News will selected. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problems with combining COUNT(*) and GROUP BY
Dear group, I've got a questions_tags table that has a column for the tag_id and question_id. I want to do a proper CakePHP model find('all') query to pull the tag_id's with the related COUNT for each time a tag_id is used. So far I can do this: $this-QuestionsTag-find('all', array('fields'=array('*', '(COUNT (*)) AS count'), 'group'='tag_id')); However, the output is this: Array ( [QuestionsTag] = Array ( [tag_id] = 3 [question_id] = 1 [created] = -00-00 00:00:00 [updated] = -00-00 00:00:00 ) [Tag] = Array ( [id] = 3 [title] = testtag [created] = -00-00 00:00:00 [updated] = 2009-02-09 16:26:15 ) [0] = Array ( [count] = 2 ) ) How can I get the $array[0][count] up there in the $array[QuestionsTag] ['count'] where it belongs? Why is it out there by itself under an index of 0? Thanks, Seth --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Session
Hi majna, Thx for the tip. It was helpful and it works. Regards Sijo Jose C On Thu, Feb 5, 2009 at 2:40 PM, majna majna...@gmail.com wrote: try with Configure::write('Session.checkAgent', false); Configure::write('Security.level', 'medium'); On Feb 5, 9:26 am, Cjo jose.s...@gmail.com wrote: Hi all, I have peculiar issue right now. When ever i double click on a link or a button, I get session out and thrown out. Is this my configuration issue and is there any remedies. Can I get some help.?? Regards Sijo Jose C -- Sijo Jose Chakramakkil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---