Expire a blog post?
How would I go along to setting an entry to expire after a certain amount of days? If I made a post and wanted it to be hidden or "disabled from being viewed or even deleted. How would I go along to doing that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [EMAIL PROTECTED] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Bake error model_php4.php on line 445
The nighty build of 1.2.x and even 1.1.3.x have some real major problems when it comes to bake.php I can' build a controller because it is giving me a Cannot instantiate non-existent class error now. On Mar 14, 3:34 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I've been having this error while trying to bake a controller > on version 1.1.12.4205 > > Fatal error:Cannotinstantiatenon-existentclass: healthsinfo in / > Users/Rolando/Documents/working/yougotinsurance/cake/libs/model/ > model_php4.php on line 445 > > these are the lines 444 and 445 > $this->{$assoc} =& new $className(); > $this->{$className} =& $this->{$assoc}; > > I changed those to: > eval('$this->{$assoc} =& new '.$className.'()'); > $this->{$className} =& $this->{$assoc}; > > so i can bake controllers and views now > but getting this parse errors > Parse error: parse error in /Users/Rolando/Documents/working/ > yougotinsurance/cake/libs/model/model_php4.php(445) : eval()'d code on > line 1 > > I get the parse errors but im getting the files ok so if you just want > this to work it will be ok. > I've been having trouble baking with the latest stable release it is > just me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: is acl.php not working?
Having the same problem. Looked everything over don't know what the problem could be. - Jon On Mar 15, 3:24 pm, "rtconner" <[EMAIL PROTECTED]> wrote: > I cannot getacl.php to work in 1.2. I've tried the latest "stable" > build and the latest nightly build. Both give me the same error > -->phpacl.php > > PHP Fatal error: Class 'Dispatcher' not found in [path]\cake\libs > \error.php on line 58 > > Fatal error: Class 'Dispatcher' not found in [path]\cake\libs > \error.php on line 58 > - > > I don't even care if I can use this script or not, but I need to > create theACLtables so I can start to use them. If this is not > working, does anyone know of another way to create the tables in my > database, and then set cake up so it knows to use my db for Access > control. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Cake Recipes cancelled
Mullet I believe what he meant was you can not advertise that you will develop a CakePHP app for money or your company will develop a cakephp for commercial use and sell it. Please correct me if I am wrong. I have dealt with some trademark issues lately with a company I am working with for my employer and they told me it's okay to mention the companies trademark as long as it mentions who owns the trademark and has the trademark symbol by it. Again this might be different for CakePHP but from what I have dealt with I have only had to put the symbol and mention who owns it. Now the Source Code for CakePHP is different it's name CakePHP that is trademarked not the source code. You can distribute the cakephp source with your apps as long as you don't alter the header information in the source of what was written by the CSF. The source is under the MIT license ... you should check it out so you have more of an understanding of it. http://www.opensource.org/licenses/mit-license.php If any of these is wrong please correct me anyone. I am sorry to hear that the book has been canceled and there was problems amoung the community but we are better then that we can get past the problems and be more concerned about the community then our personal means. - Jon On Mar 11, 9:02 am, "The Mullet" <[EMAIL PROTECTED]> wrote: > > @Mullet > > Trademark and Copyright are two seperate issues. The MIT license > > covers the copyright on the code. > > gwoo, I would like to cite your very words from another thread: > > >But you cannot use the CakePHP logo or name to promote your web > >development company or your services, unless you are a certified > >CakePHP Engineer. > > This basically means, that you intended to keep me from using the term > CakePHP, thus violating fair use rules on trademarks. Now, how can I > offer a download for CakePHP, if you forbid me the use of the word > CakePHP (remeber that the sources themself carry the word "CakrPHP" > all over)? Obviously, your legal position is wrong, and it did violate > the MIT license by restricting my right to redistribute the sources. > > Fortunately, you decided to set up a fair use policy. I am glad this > issue can finally be closed after that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: First bite?I am trying
What web server software are you running on your localhost? Seems you might have not placed the cake directory in the right place .. I am just assuming that and I could be wrong :) . On Mar 3, 6:02 pm, "SIXS" <[EMAIL PROTECTED]> wrote: > Hi, > I am trying cakePHP and using first bite. I get the first screen and also get > the screen to say that I have connected with mysql database. I then put in > the model and controller in c\cake\app\model and c:\cake\app\controller\ and > try to locate it with thehttp://localhost/notes/I get 404 .error I do not see > wher the scaffold is executed either. > What gives I see another tutorial Managing fantesy football and I get to the > scaffold sttement and am confused with add, (crud) as I don't see any files > created? > > Thanks > Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Pagination Page Numbers in 1.2?
Ya! Awesome Thank You bbuchs! I have a few question(s) though if you can answer them or if anyone else can. How can I default the displaying of the home page for the controller to the last page. So if there is 10 pages ... instead of going to page 1 ... it goes to page 10 first. Is this possible? My second questions I answered myself :) ... so just that one question. Thank You once again! - J On Feb 23, 12:57 pm, "bbuchs" <[EMAIL PROTECTED]> wrote: > loop through the pageCount paramater and output the links > > params['paging'] > [$paginator->__defaultModel]['pageCount']; $page++): ?> > current() ): ?> > link($page, > '/admin/'.$paginator->params['controller'].'/index/page:'.$page) ?> > > > > > > > On Feb 23, 1:23 pm, "Jon M." <[EMAIL PROTECTED]> wrote: > > > Nobody can help me out :( ? > > > I tried doing a search but couldn't find anything on it. Please :) > > > On Feb 22, 3:11 pm, "Jon M." <[EMAIL PROTECTED]> wrote: > > > > I am curious if anyone can show me how to add selectable page numbers > > > along side the "prev" and "next" links. Having 50 pages and having to > > > click next 50 times to get to the last page is not fun :) so if > > > someone can help me out with that ... I would be very thankful :D ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Pagination Page Numbers in 1.2?
Nobody can help me out :( ? I tried doing a search but couldn't find anything on it. Please :) On Feb 22, 3:11 pm, "Jon M." <[EMAIL PROTECTED]> wrote: > I am curious if anyone can show me how to add selectable page numbers > along side the "prev" and "next" links. Having 50 pages and having to > click next 50 times to get to the last page is not fun :) so if > someone can help me out with that ... I would be very thankful :D ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Pagination Page Numbers in 1.2?
I am curious if anyone can show me how to add selectable page numbers along side the "prev" and "next" links. Having 50 pages and having to click next 50 times to get to the last page is not fun :) so if someone can help me out with that ... I would be very thankful :D ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What editor do you use for CakePHP?
TextMate and YummyFTP for FTPing. On windows I use Intype and PSPad then Filezilla for FTPing. On Feb 12, 4:02 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > G'day all, > > Matt from Australia here. In the past I've done all my PHP coding > using a text editor such as Wordpad, and then a few years back I've > begun using Dreamweaver. > > Currently I'm using Dreamweaver 8 and I've found it to be quite good > when dealing with .php files. It's not great when editing .thtml > files though, since it doesn't recognize them as code, and so doesn't > give you all the nice code colouring and auto-closing of tags, etc... > At least the automated uploading/downloading is nice. > > What do you use for Cake cooking? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problem with pagination in 1.2
Awesome thanks nate! I am having one problem though after I add the code from that post. I am coming up with this --> Warning: Invalid argument supplied for foreach() in /home/path/app/views/products/index.ctp on line 10 This is what I have on line 10 --> ? php foreach ($products as $product): ? - Jon On Jan 17, 5:03 pm, "nate" <[EMAIL PROTECTED]> wrote: > http://cake.insertdesignhere.com/posts/view/16 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Problem with pagination in 1.2
I am having a hard time figuring out how to use pagination in my cakephp app. I suppose I don't understand what the Dec. 25th Announcement explained about the pagination feature. Can anyone give me an example or clear things up for me please? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Help - How do I Use CakePHP?
Hello here are some links I can recommend to you that should get you started and get a taste of CakePHP. Just remember ... CakePHP is not hard ... it makes your life easier ... really it does :) . http://www.sitepoint.com/article/application-development-cakephp http://www.developer.com/lang/php/article.php/3636686 http://www.developer.com/lang/php/article.php/3642016 http://grahambird.co.uk/cake/ http://www.ibm.com/developerworks/views/opensource/libraryview.jsp?search_by=cook+web+sites+CakePHP http://www.avatarfinancial.com/pages/cake/ http://bakery.cakephp.org/ http://www.google.com/search?q=CakePHP Enjoy Baking :) - Jon On Dec 28, 3:19 pm, "PHPBABY3" <[EMAIL PROTECTED]> wrote: I have been using PHP for a few years part-time. Now I have to use CakePHP. Where is is the best documentation? Could someone walk me through it or something? We can make this a business relationship if you are a business. Reply to Author, please. PB --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Joining 2 tables - better practice?
You would use $data['Product'] as $product I believe since your using association with it then it should recognize the holiday already(i think). - J On Dec 18, 12:54 pm, "leamas" <[EMAIL PROTECTED]> wrote: > I tried to follow the information from the link you provided, but it > didn't work. Nor did trying $product['Holiday']['Product'] > > Here is basic output of my array ( I removed most of the output ): > > Array > ( > [Holiday] => Array > ( > [id] => 1 > [holiday_name] => Halloween > ) > > [Product] => Array > ( > [0] => Array > ( > [id] => 668 > [product_name] => Cathy B Vellum Stickers - Crazy > Candies > [description] => This is a package of bright and > festive Cathy B vellum stickers that are "raised and glitter-glazed." > It includes approx. 20 various types of candy like lollipops, > jellybeans, gum and more. > [price] => 1.29 > [URL] > =>http://www.scrapstop.com/shop.php?op=itemdetails&item=10612&refid=839... > [image] =>http://www.scrapstop.com/images/10612_sm.jpg > [category_id] => 12 > [holiday_id] => 1 > [added] => 2006-04-29 > [newProd] => 0 > [stock] => 1 > [hits] => 3 > ) > ... > > Now if I change foreach ($data as $product) to foreach($data['Holiday'] > as $product) > and this returns the error: > Warning: Invalid argument supplied for foreach() > > Jon M. wrote: > > I has the same question/problem the other day and nate came to the > > rescue. > > > --> > >http://groups-beta.google.com/group/cake-php/browse_thread/thread/44f... > > Hopefully that helps. > > > Nate is the man! :) > > > - J > > > On Dec 17, 12:38 pm, "leamas" <[EMAIL PROTECTED]> wrote: --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Joining 2 tables - better practice?
I has the same question/problem the other day and nate came to the rescue. --> http://groups-beta.google.com/group/cake-php/browse_thread/thread/44f343a620af343d Hopefully that helps. Nate is the man! :) - J On Dec 17, 12:38 pm, "leamas" <[EMAIL PROTECTED]> wrote: > class Holiday extends AppModel > { > var $name = 'Holiday'; > var $hasMany = 'Product'; > > }class Product extends AppModel > { >var $name = 'Product'; >var $belongsTo = 'Holiday'; > > }This is what I've done and now my next question will be: If I have > this, then in my view (/views/holidays/christmas.thtml), how do I > retrieve the products that only pertain to Christmas when I can only > access the holidays table? > > Brandon Olivares wrote: > > Why not a hasMany association for holidays to products, and a belongsTo > > association for the other way? I don't see why this wouldn't work? > > > -Original Message- > > From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf > > Of leamas > > Sent: Sunday, December 17, 2006 2:27 PM > > To: Cake PHP > > Subject: Joining 2 tables - better practice? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Errors in the View
Thank you that worked. I am so documenting this and write something up in the bakery about it if possible. Nate you rock and I am a strong believer in CakePHP everyone I know that deals in PHP I have been telling them about this so far nothing but good things about it :) CakePHP F.T.W!!! - J On Dec 15, 4:06 pm, "nate" <[EMAIL PROTECTED]> wrote: > Okay, my fault, I gave you the wrong syntax. This: > > should be: > > > I'm actually surprised that didn't give you a syntax error, now that I > think about it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Problems to get cake running
Make sure you have enabled the rewrite module in your httpd.conf. \xampp\apache\conf\httpd.conf ... around LINE 118 just delete the # infront of the line. That should do it. - J On Dec 15, 2:48 pm, "moonraker" <[EMAIL PROTECTED]> wrote: > Hi guys, > > i'm very interested in cakephp and tried to get it running on my local > webserver (a xampp under winxp). > > I've putted the cake files under localhost/cake so that for example > "app" is under localhost/cake/app. > > Afterwards i tried to do the "Cake Blog Tutorial" and exactly followed > the tutorial but the application isn't running, i only get the "Missing > controller" information site > (http://img436.imageshack.us/img436/4200/cakenr1.jpg)! > > Is there any other special reason which i have to consider? > > Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Errors in the View
Okay maybe you can help me understand that then as well because I don't think I am understanding that part right. Sorry :( I know you have helped me out a lot and it doesn't go unappericated trust me I am greatful for the help but I think this is the part that I been having a majority of problems on. Changed the View to how we talked but it displays the Category in the 1st row of the table and the second row gets nothign but errors ... but it reconizes that there is two entries in the notes table. *sigh* - J On Dec 15, 2:01 pm, "nate" <[EMAIL PROTECTED]> wrote: > Okay, both the result data and the queries being executed look correct > now. Going based off of that, you should have no trouble fixing the > array index issues in the view. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Errors in the View
Okay I changed the way I associate the tables in the models. Changed it to the way you mentioned and I agree simple is just easier ... isn't that why we have CakePHP? :P I am using the latest copy of CakePHP on the site. By doing that right away I saw a change but yet I still get that index error( like the one I mentioned previously). Now it displays to 2 sections in the category view for the Test Category before it was only doing one and it also now displays the Array reflecting the notes instead of the Categories array. -- Array ( [Category] => Array ( [id] => 1 [title] => Test Category ) [Note] => Array ( [0] => Array ( [id] => 1 [title] => Test Note [body] => Testing to see if this works :) [created] -00-00 [modified] -00-00 [category_id] => 1 ) [1] => Array ( [id] => 2 [title] => Another Test Note [body] => Testing body of note [created] -00-00 [modified] -00-00 [category_id] => 1 ) ) ) -- Here is the query: -- Nr Query 1 DESC `categories` 2 DESC `notes` 3 SELECT `Category`.`id`, `Category`.`title` FROM `categories` AS `Category` WHERE (`Category`.`id` = 1) LIMIT 1 4 SELECT `Note`.`id`, `Note`.`title`, `Note`.`body`, `Note`.`created`, `Note`.`modified`, `Note`.`category_id` FROM `notes` AS `Note` WHERE `Note`.`category_id` = '1' -- You assume correct about my class names and model file. - J On Dec 15, 1:05 pm, "nate" <[EMAIL PROTECTED]> wrote: > Well, I tend to favor my way of doing it, since Cake will always fill > in the defaults. It's always better to keep things simple, especially > when adding complexity is redundant. > > Also, I'm assuming your model file and class names are both singular? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Errors in the View
hmm I think I have done that. In my first post I posted this: Notes Model: -- var $name = 'Note'; var $belongsTo = array ('Category' => array( 'className' => 'Category', 'conditions' =>'', 'order' =>'', 'foreignKey' => 'category_id') ); Category Model: - var $name = 'Category'; var $hasMany = array ('Note' => array( 'className' => 'Note', 'conditions' =>'', 'order' =>'', 'foreignKey' => 'category_id') ); Is this not right? Should I change it to the way you said so cakephp handles it on its own? On Dec 15, 12:15 pm, "nate" <[EMAIL PROTECTED]> wrote: > Yes, you're missing something fairly important: you didn't actually > associate your models with each other, so Cake has no idea that you > also want Notes when you ask for Categories. Your model classes should > look a little something like the following: > > class Category extends AppModel { > var $name = 'Category'; > var $hasMany = 'Note'; > > }class Note extends AppModel { > var $name = 'Note'; > var $belongsTo = 'Category'; > > } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Errors in the View
Alrighty, I set DEBUG to 2 and this is what I get 1 SELECT `Category`.`id`, `Category`.`title` FROM `categories` AS `Category` WHERE (`Category`.`id` = 1) LIMIT 1 I am now getting that error again though @ localhost/categories/view/1: Notice: Undefined index: title in ... Notice: Undefined index: id in ... Am I missing something? You can see why this is really confusing for me ... I have read almost every tutorial gone thru the manual and done numerious serches on the net to see why I can't get this to work. What else could be wrong? Is it not possible to list the Notes in the Category view? This is just so fustrating :( Nate thank you once again for your help I am just clueless on why this thing wont work. - J On Dec 15, 11:30 am, "nate" <[EMAIL PROTECTED]> wrote: > Okay, since you added this: > > > This: > link($row['Note']['title'], > '/notes/view/'.$row['Note']['id']) ?> > becomes > link($row['title'], '/notes/view/'.$row['id']) ?> > > Also, what version of Cake are you on? Even if if there are no Notes > results, there should still be an empty array nested under Category. > Get the latest version of Cake, and turn DEBUG up to 2, so you can see > what queries are being executed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Errors in the View
Okay well I did that and it only displays the Category Names now. I did a pr($data) and it came up with this: -- Array ( [Category] => Array ( [id] => 1 [title] => Test Category ) ) -- The View now looks like this: -- Title Created Actions link($row['Note']['title'], '/notes/view/'.$row['Note']['id']) ?> link('View', '/notes/view/'.$row['Note']['id']) ?> | link('Edit', '/notes/edit/'.$row['Note']['id']) ?> | link('Delete', '/notes/delete/'.$row['Note']['id'], null, 'Are you sure you want to delete "'.$row['Note']['title'].'"?') ?> -- Under localhost/categories/view/1 it displays the table like this: | 1 | Test Category | ... error msg ... | View | Edit | Delete | Doesn't display the Actual Note title though. Did I do something wrong? This is the only thing that shows also. I have more then one note entry for that category. Thanks Again Nate! - J On Dec 15, 9:03 am, "nate" <[EMAIL PROTECTED]> wrote: > > should be > > > Then take the ['Note'] part out of the subsequent array references. A > helpful thing to do when coding your views is to put ?> at the bottom of your view, so you can read the structure of the > array as you are designing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Errors in the View
Thanks for the reply nate! hmm, I just tried those, changed it in BOTH controllers and it didn't work. I get the same error. Do I have to change something in the View when using that code? - J On Dec 14, 9:27 pm, "nate" <[EMAIL PROTECTED]> wrote: > The problem is here: > > function view($id) > { > $this->set('data', $this->Category->read()); > } > > You aren't passing the $id to read. The line should read either: > $this->set('data', $this->Category->read(null, $id)); > or, my personal favorite: > $this->set('data', $this->Category->findById($id)); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Errors in the View
[ ... SORRY FOR THE LONG POST ... ] Hello! First off I love CakePHP, I was having issues working with RoR but CakePHP allows me to actually do something. I have played around with CakePHP and have learned a lot from my mistakes and the great people that have put up great examples and answers to peoples questions. I am having one problem now that I can't seem to find a right answer to, maybe I am just not understanding what I am trying to do or just no one has attempted it(which I highly doubt I am sure it has been done). What I am trying to do is a simple idea yet it is driving me crazy. I am trying to create a Notes App for my local work server ... like the one Fabio Cevasco did @ http://www.sitepoint.com/article/application-development-cakephp but I want to have categories(or tags even). Simple enough right? Not for me :-( . When I go to localhost/notes/ it lists the notes along I even have the Category matching up with the Notes Post. I go to localhost/notes/view/1 and again no problem I see the note and the category in which it is in. When I visit localhost/categories/ it lists the categories and when I visit localhost/categories/view/1 (for the first category) I get errors telling me this "Notice: Undefined index: Note in ./view.thtml on line ##". How would I be able to have the list of Notes show up under the category it is under? Here is some of the snips of my code. Table Setup: Notes -- id title body created modified category_id Category id title Notes Model: -- var $name = 'Note'; var $belongsTo = array ('Category' => array( 'className' => 'Category', 'conditions' =>'', 'order' =>'', 'foreignKey' => 'category_id') ); Category Model: - var $name = 'Category'; var $hasMany = array ('Note' => array( 'className' => 'Note', 'conditions' =>'', 'order' =>'', 'foreignKey' => 'category_id') ); Notes Controller: -- var $name = 'Notes'; // var $scaffold; function index() { $this->set('data', $this->Note->findAll()); } function view($id) { $this->set('data', $this->Note->read()); } Categories Controller -- var $name = 'Categories'; //var $scaffold; function index() { $this->set('data', $this->Category->findAll()); } function view($id) { $this->set('data', $this->Category->read()); } Categories View.thtml -- Title Created Actions link($row['Note']['title'], '/notes/view/'.$row['Note']['id']) ?> link('View', '/notes/view/'.$row['Note']['id']) ?> | link('Edit', '/notes/edit/'.$row['Note']['id']) ?> | link('Delete', '/notes/delete/'.$row['Note']['id'], null, 'Are you sure you want to delete "'.$row['Note']['title'].'"?') ?> Now this all works perfect if I enable Scaffolding but when I comment out Scaffolding I get the errors. What am I doing wrong? Please help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---