routing issue with languages language switch links
Hi everyone, I've asked this a few times on IRC, but I guess it's too complicated(?) to be answered over IRC. I'm trying to build a multilingual web site, so I've created the following route: Router::connect('/:language/:controller/:action/*', array(), array('language' = '[a-z]{3}')); Now, if I want to create a few links for switching languages, I do the following: foreach ($availableLanguages as $locale = $params) { $link = array_merge(array('language' = $locale), $this- params['named'], $this-params['pass']); echo $this-Html-link($image, $link, array('escape' = false)); } And this actually works, and produces correct results. For example, if I open an URL: /hrv/tests/index/drink The generated links will be in the form of: /eng/tests/index/drink HOWEVER... If the url contains a named param: /hrv/tests/index/drink/feck:arse Cake will generate links like this one: /tests/index/drink/language:eng/feck:arse So..either I'm missing something, or something is amiss.. I know the named params are the cause because I can remove $this-params['named'] from the array_merge call and everything works fine. Any ideas what's wrong here? Is this a router bug? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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: 2 question about cakeohp
H.you might want to take a look at the official documentation. I'd start well..from the start: http://book.cakephp.org/ At least go through the blog tutorial before asking any more questions: http://book.cakephp.org/view/219/Blog To solve your css and green(?) header/footer issues, read about layouts: http://book.cakephp.org/view/96/Layouts On Jul 1, 9:25 am, heli007 pcfi...@gmail.com wrote: 1) i put a home.ctp file into \app\views\pages ,when i browse it i can see the page but without css style, in that home.ctp file I wrote link href=default.css rel=stylesheet type=text/css / between head,and i have out default.css to the \app\webroot\css directory,why does it not work how to add css to a page 2)does every page made by cakephp has that cakephp green header and footer? --~--~-~--~~~---~--~~ 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: correct results with find() :: any help or advice welcome
Well, obviously your Task model is not used directly in that controller. You should probably drop Task from $this-Task-Company-... and just use $this-Company-... On May 26, 8:00 am, programguru ja...@w3developing.com wrote: hello, this is currently what I am using: $companies = $this-Task-Company-Status-find('all', array('conditions'=array('Status.name !='='Completed'))); $this-set(compact('companies')); i am simply trying to display all listings with Status.name not equal to Completed. this is working fine in my tasks_controller view.. but when I attempt to run it in my companies_controller view.ctp, i get the following error: Notice (8): Undefined property: CompaniesController::$Task [APP\controllers\companies_controller.php, line 29] Notice (8): Trying to get property of non-object [APP\controllers\companies_controller.php, line 29] anyone know what i am doing wrong here? the tables are all associated and working fine otherwise.. -- View this message in context:http://www.nabble.com/correct-results-with-find%28%29-%3A%3A-any-help... 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: User Registration Default Group
Take a look at the AclBehavior: http://book.cakephp.org/view/545/Using-the-AclBehavior On May 21, 6:49 pm, nic nic.mang...@gmail.com wrote: Can someone inform me of the best way to set a default group for a new user? --~--~-~--~~~---~--~~ 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: Dynamic RSS feed title?
This works for me (in controller): $this-set ( 'channel', array ( 'title' = $dynamicTitleHere, 'description' = 'Yer description' ) ); On May 22, 5:57 pm, number9 xpozit...@gmail.com wrote: Is there anyway to set make an RSS feed title dynamic? I'm not talking about the item titles, but the single title that is referenced from pageTitle. I know that you can alter it statically, but I have setup an RSS feed for all of my categories (from one view/action), so cannot declare an individual title for each feed (besides that would go against the DRY philosophy). I have tried in both the view and controller to use a variable for the title but it just doesn't work. E.g: // grab category name and store in a variable: $pageTitle = $this-pageTitle = $data['Category']['name']; // Set channel variables for feed: $channel = array ( 'title' = $pageTitle, Has anybody managed this? Thanks in advance! --~--~-~--~~~---~--~~ 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: displaying records in index through specific field criteria
Well, if you want to filter your data *in the view*, you're doing it wrong. It would be silly to fetch ten thousand records from the database just to show five of them. I sure hope that's not what you're trying to do. Like Richard said, this is the solution to your problems: $data = $this-ModelName-find ( 'all', array ( 'contain' = array('RelatedModel'), // use this if you use the Containable behaviour, if not well, fail.. 'conditions'=array('RelatedModel.field' = $yesValue) ) ); Does that help or did you have something else in mind? On May 21, 6:42 am, programguru ja...@w3developing.com wrote: Is it possible to just run it all in the foreach like? foreach ($task['Status=YES'] as $task): -- View this message in context:http://www.nabble.com/displaying-records-in-index-through-specific-fi... 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: AppController issue
As Luke already pointed out, to prepare any kind of variable / data for your views, you need to use the Controller::set() method. Declaring a variable is not enough because it is only a local var then, isn't it? Besides, if you view could see every single variable from your controller, that wouldn't be very clean, right? :) Also, since this is a very basic question, you might want to take a look at the blog tutorial in the cookbook. On May 21, 12:57 pm, lakers fan lakersfa...@msn.com wrote: Hello, I want to create a variable and initialize it in say AppController in beforeFilter() and use the variable in the view (ctp file). I created a variable $admin = false and tried to use it in view and I get error saying $admin is undeclared variable. Is there any other way of doing this? Thanks, Bharani _ Hotmail® has a new way to see what's up with your friends.http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM... --~--~-~--~~~---~--~~ 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: Poll: what do you hate about CakePHP?
Oh yeah, +1 on everything you sad man. That action thing is a real mystery and a major pain. On May 21, 4:49 pm, rich...@home richardath...@gmail.com wrote: One minor niggle-ette for me: I hate how form helpers $form-create() doesn't default to the current actions (it defaults to add). I always end up having to type: ?echo $form-create(User, array(action=$this-action)) ? oh, and another: $html-css() defaults to inline, it should default to putting it in the $script_for_layout. As it doesn't, you have to type: $html-css(my_css, null, array(), false); (same with the $javascript helper too) --~--~-~--~~~---~--~~ 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: last_login update
Oh heavens... Paulos, you also need to configure your Auth properly so your login() function will be called after your user logs in. Id est: $this-Auth-autoRedirect = false; in your AppController along with all the other Auth stuff. HTH On May 19, 3:07 pm, andy andy.baugh...@gmail.com wrote: What displays when you print_r($this-Session) or print_r($_SESSION)? On May 18, 7:21 am, paulos nikolo paulitosthe...@gmail.com wrote: it prints this AuthComponent Object ( [_loggedIn] = [components] = Array ( [0] = Session [1] = RequestHandler ) [authenticate] = [authorize] = controller [ajaxLogin] = [userModel] = User [userScope] = Array ( ) [fields] = Array ( [username] = username [password] = password ) [sessionKey] = Auth.User [actionPath] = [loginAction] = Array ( [controller] = users [action] = login ) [loginRedirect] = Array ( [controller] = users [action] = index ) [logoutRedirect] = Array ( [controller] = users [action] = login ) [object] = [loginError] = Invalid username or password [authError] = You are not authorized to access that location. [autoRedirect] = 1 [allowedActions] = Array ( [0] = display [1] = index [2] = add ) [actionMap] = Array ( [index] = read [add] = create [edit] = update [view] = read [remove] = delete [create] = create [read] = read [update] = update [delete] = delete ) [data] = [params] = Array ( [pass] = Array ( ) [named] = Array ( ) [controller] = users [action] = login [plugin] = [form] = Array ( ) [url] = Array ( [url] = users/login ) ) [_methods] = Array ( [1] = index [2] = view [3] = add [4] = delete [5] = edit [6] = change_status [7] = login [8] = logout ) [_log] = [enabled] = 1 [Session] = SessionComponent Object ( [__active] = 1 [__started] = 1 [__bare] = 0 [valid] = 1 [error] = [_userAgent] = 99eaa36d863fae669cb83f33c1ad01af [path] = /my_cake/index.php [lastError] = [security] = high [time] = 1242649223 [sessionTime] = 1242649233 [watchKeys] = Array ( ) [id] = [_log] = [host] = localhost [enabled] = 1 [cookieLifeTime] = 0 ) [RequestHandler] = RequestHandlerComponent Object ( [ajaxLayout] = ajax [enabled] = 1 [__responseTypeSet] = [params] = Array ( ) [__requestContent] = Array ( [javascript] = text/javascript [js] = text/javascript [json] = application/json [css] = text/css [html] = Array ( [0] = text/html [1] = */* ) [text] = text/plain [txt] = text/plain [csv] = Array ( [0] = application/vnd.ms-excel [1] = text/plain ) [form] = application/x-www-form-urlencoded [file] = multipart/form-data [xhtml] = Array ( [0] = application/xhtml+xml [1] = application/xhtml [2] = text/xhtml ) [xhtml-mobile] = application/vnd.wap.xhtml+xml [xml] = Array ( [0] = application/xml [1] = text/xml ) [rss] = application/rss+xml
Re: CAKEPHP UNDEFINED VARIABLE
Hello, 1. NO NEED TO WRITE LIKE THIS IN THE SUBJECT 2. Are you overriding your beforeFilter() in your other controllers? If true, are you calling parent::beforeFilter()? If not, do it now. 3. If step no.2 didn't help, did you try calling debug($this- viewVars) in your view to see what's going on there? On May 18, 4:41 pm, lakers fan lakersfa...@msn.com wrote: Hello, I get an error undefined variable $left_content. This variable has been defined in beforeFilter() of app_controller.php. In beforeFilter(), the code is: $this-set(left_content,$left_content); Somehow the variable is not passed on to the view files.. Any clues?? Thanks, Bharani _ Hotmail® goes with you.http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_T... --~--~-~--~~~---~--~~ 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: Poll: what do you hate about CakePHP?
Here's another interesting kick in the Matt Groening. Inability to use FormHelper::error() to show our own errors on the fly, i.e. $form-error('Arse.biscuits', 'A pair of women's knickers is missing'); regardless of whether I'm using a model to create a form or not. Workaround: $form-validationErrors['Arse']['biscuits'] = 'Dancing like a mad eejit is not an allowed action'; echo $form-error('Arse.biscuits'); But why?? Form error should be looking for an validation error message only if I didn't provide one as a param. Am I the only one who finds that logical? On May 18, 2:27 pm, Henrique Machado henri@gmail.com wrote: What about create a true poll for it? First create a poll for all suggestions, after create a poll to vote on that suggestions and voilá =) Henrique Machado 2009/5/18 Aivaras faifas1...@gmail.com Hey, actually the most annoying thing is that we cannot download separate parts of Cake. It would be cool if advanced users could choose what do they need for their project, just like mootools made in their download page. I certainly understand that this is just *wishful thinking* because Cake's core uses nearly everything :x Anyway, upload component would be totally usable! Also, switching from scriptaculous + prototype to jQuery would be awesome. People would create and share plugins, which means that our lovely community would become even bigger and ADmad would be even more mad (sorry AD :x) Enjoy, Faifas On Sat, May 16, 2009 at 06:00, Brendon Kozlowski brendon...@hotmail.comwrote: Thought of another one. Paginate settings, and paginate call. Why do they have the same name? When learning how Cake works, although it's proper OOP to do so, it's a bit confusing to see: $this-paginate = array('contain' = 'User'); $this-set('posts', $this-paginate()); I think it would be clearer (from a name the variable what it is type of coding style) to use something like: $this-paginateOptions = array('contain' = 'User'); Every time I see $this-paginate when skimming through code, I immediately see the method, completely forgetting it's also a property. I hate 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: Performance question about Cache against database query
I use this method to store my global settings: http://dsi.vozibrale.com/articles/view/simple-db-based-configuration-for-cakephp-apps And also cache them so they are fetched from the database only when changed from the app, as you can see here: http://github.com/lecterror/neutrinocms/blob/da9a1f7633564f86330c098f20457e7e7ac371a0/models/configuration.php#L43 Just remember to clear the cache afterSave() and afterDelete() and you should be grand. On May 14, 6:43 pm, Pixelastic timcc.pe...@gmail.com wrote: Hello, My app needs a couple of settings to work, settings I have to fetch on every page request (like the default metadescription, and some other strings and booleans I will need in every views). These settings are global (they are the same for every page and for every user), and I have to change them about once every three weeks. I used to keep them in my database and getting them on every request. But hitting my db on every request for so much little data seems a little overhead to me now, and I was wondering if (in terms of performance) it had a real impact ? The amount of data queried is really small, but it takes 5-6 requests. And if so, what would be a possible alternative ? (Maybe using cake Cache ?) Thanks in advance to anyone who could give me some pointers about 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: password field
Auth is a component, therefore, in your controller: var $components = array('Auth'); And you also need to set the params where necessary. But you've read the manual, right? On May 13, 9:54 am, lakers fan lakersfa...@msn.com wrote: it didnt.. should I just use $uses = array('Auth');?? Date: Wed, 13 May 2009 00:51:25 -0700 Subject: Re: password field From: drlob...@gmail.com To: cake-php@googlegroups.com Auth component hashes password automatically. On May 13, 2:38 pm, lakers fan lakersfa...@msn.com wrote: Hello, Isnt password field automatically hashed??. if not can someone let me know how i can hash the password field automatically? Thanks,Bharani _ Windows Live™: Keep your life in sync.http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009 _ Hotmail® has ever-growing storage! Don’t worry about storage limits.http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_... --~--~-~--~~~---~--~~ 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: After logout browser back button shows all visited page
Why not call $this-disableCache() in your controller and let cake take care of that? http://api.cakephp.org/class/controller#method-ControllerdisableCache On May 9, 4:36 pm, brian bally.z...@gmail.com wrote: Yes, they handle things differently, of course. I'm not sure of the correct procedure. Have a look here: http://blog.httpwatch.com/2008/10/15/two-important-differences-betwee... On Sat, May 9, 2009 at 2:08 AM, sunil.rajput sunil.rajpu...@gmail.com wrote: Dear brian, Thanks for response and solution regarding the cache, The problem has been solved in IE browser but in mozila the problem is still same. So please what about for mozila. Thanks, On May 8, 10:13 am, brian bally.z...@gmail.com wrote: Have a look at Controller::disableCache() or manually set these headers in AppController::beeeforeRender(): header('pragma: no-cache'); header('Cache-Control: no-cache, must-revalidate'); header('Expires: Sat, 1 Jan 2005 00:00:00 GMT'); You can also put these in META tags in your layout but those aren't as effective as proper headers. On Fri, May 8, 2009 at 8:34 AM, sunil.rajput sunil.rajpu...@gmail.com wrote: Dear Frinds, I am developing a project using cakephp and i have a problem with that, after logout when i am click onbrowserback buttonit shows every page without checking the session . i want that after logout no page display frombrowserhistory it should be first check the session for login. please help me. thanks Sunil.Rajput --~--~-~--~~~---~--~~ 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: Poll: what do you hate about CakePHP?
Ignoring callbacks on associative queries++ Inconsistency on model joining in queries Explanation: I might be wrong on this, please correct me if I am, but it seems like the following: A hasMany B hasMany C C belongsTo B belongsTo A If I want to get Bs where C.notAPrimaryKeyField = 'somevalue', things work well (just contain it and we're fine). But if I want to get all the Bs where A.notAPrimaryKeyField = 'somevalue', things break and people die. This logic may seem backwards (if it's a belongsTo relation, there should be only one parent, right?), but it's not always like that. Some databases I've worked with had to be forced into the following: a field which defines the type of relation, let's call it area_scope. Then I'd have the area_id which points to different models, depending on the value of area_scope. I think this is somewhat common in real life databases. That being said, the same issue exists with the relation definitions in models with the conditions key. I can do this (in the Document model): var $hasMany = array('Item' = array('conditions' = array ('Document.author' = 'Jack Hackett'))); but I can't do this var $hasMany = array('Item' = array('conditions' = array ('Item.content' = 'feck arse drink girls'))); So making conditional joins is sometimes very tricky.. * Lack of bootstrap file for plugins would be another one (possibly even core.php and routes). * MediaView still depends on the array of predefined MIME types (WTF?) * Defining custom find types is is unintuitive. It should be as simple as defining a function called _findCabbage() in your model to be able to use find('cabbage'). * I know this probably won't happen but...: composite keys anyone? Sometimes I have to deal with Nazi DBAs: Artificial keys raus!. Ich verstehe, main Führer... I have also seen people complain about poor performance, and while I didn't experience it myself, it might be worth investigating if the complaints continue. That's all for now.. :) On May 8, 9:18 am, Richard rclay...@gmail.com wrote: PHP4 Support is a definite peeve. The Ajax helper being tied into prototype/scriptalicious - I've a preference for jQuery. Particularly like the extensive use of hashtables in cake; really, really like that. On Fri, May 8, 2009 at 5:55 AM, park park@gmail.com wrote: No HABTM counterCache Ignoring callbacks on associative queries On May 8, 6:29 am, Nate nate.ab...@gmail.com wrote: Well, maybe hate's a strong word. Let's say, what do you like the least? Kind of an odd question, I know, but since we've kick-started development of a new version, I'd like to know what the most frustrating things with the framework are, even if they're things we can't fix right away. I'll get us started: PHP 4 support. Who's next? TIA for the input. --~--~-~--~~~---~--~~ 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: Poll: what do you hate about CakePHP?
@zonium: I believe you can accomplish the separation with additional class paths: http://book.cakephp.org/view/35/Advanced-Installation#Additional-Class-Paths-36 On May 8, 11:05 am, zonium zon...@gmail.com wrote: - Hard / impossible to organize a large application into smaller / manageable pieces. When you have 50 controllers or more in one folder you'll hate cakephp because it's difficult to locate things. (same problem with models and views) . I would like to organize the Model/Views/Controller files into feature-related, sub-application folders (e.g. newsletter , photoeditor, coupon etc.) If 'plugins' is the answer then I hate the term 'plugin'. My 'newsletter' feature is part of my application, not a plugin. - Documentation / User guide should be the focus. People who write the core should care more about the doc. I would prefer having a better doc and more examples to having a newer version of cake. --~--~-~--~~~---~--~~ 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 Upgrading Cake - best practices: Release: 1.2.3.8166
There is a difference, but you can use either one. /app/vendors is 3rd party code for your application. /vendors however is 3rd party code for all the apps sharing that particular cake setup (see http://book.cakephp.org/view/35/Advanced-Installation for more info on that). On May 6, 5:35 pm, JamesF usaexportexpe...@gmail.com wrote: thanks for the tip..i didn't exactly know that you shouldn't mess with the /cake/ dir does the same apply to the /vendors folder as opposed to /app/vendors? On May 6, 10:22 am, dr. Hannibal Lecter lecter...@gmail.com wrote: Uh, you're not supposed to touch anything in the cake folder. Your app_controller.php should be inside your app folder, i.e. ~/app/ app_controller.php As far as other upgrading go, If you're using 1.2 you can simply overwrite everything in ~/cake and it should work without a problem. Just don't forget to clear your app cache. On May 6, 4:17 pm, JamesF usaexportexpe...@gmail.com wrote: with the release of 1.2.3.8166 that fixes that nasty xss vulnerability (https://trac.cakephp.org/ticket/6336) i feel compelled to upgrade from an earlier build of 1.2. i am not sure of the best way to go about this without losing code i have already made. for example, i have added some things to app_controller.php but it was the core version in /cake/libs/ i assume i need to move that file to my /app/controllers/ dir question: when i upgrade cake, do i just extract the /cake/ dir and overwrite everything? or do i have to worry about config files in the app dir as well? looking for advice from some who have upgraded on nearly complete projects/ live sites! 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: remove the blue header on cake1.2
The blue header is a part of what surrounds your content, also known as layout. To learn more about those, read the book: http://book.cakephp.org/view/96/Layouts On May 7, 7:52 am, salmia69 salmi...@gmail.com wrote: hi guys, I'm newbie here.now I'm doing project with cake1.2. i want to remove the blue header with link but till now i don't know how to do it. i have check at css file but nothing i can do.. please 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 -~--~~~~--~~--~--~---
Re: Need help with Upgrading Cake - best practices: Release: 1.2.3.8166
Uh, you're not supposed to touch anything in the cake folder. Your app_controller.php should be inside your app folder, i.e. ~/app/ app_controller.php As far as other upgrading go, If you're using 1.2 you can simply overwrite everything in ~/cake and it should work without a problem. Just don't forget to clear your app cache. On May 6, 4:17 pm, JamesF usaexportexpe...@gmail.com wrote: with the release of 1.2.3.8166 that fixes that nasty xss vulnerability (https://trac.cakephp.org/ticket/6336) i feel compelled to upgrade from an earlier build of 1.2. i am not sure of the best way to go about this without losing code i have already made. for example, i have added some things to app_controller.php but it was the core version in /cake/libs/ i assume i need to move that file to my /app/controllers/ dir question: when i upgrade cake, do i just extract the /cake/ dir and overwrite everything? or do i have to worry about config files in the app dir as well? looking for advice from some who have upgraded on nearly complete projects/ live sites! 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: Pulling fields of a corresponding foreign key
You're probably missing the correct display field: class Donor { var $displayField = 'first_name'; } and class Cause { var $displayField = 'cause_title'; } Note that 'cause' is superfluous in 'cause_title'. Why not just 'title'? On May 6, 4:22 pm, swiftguy vikram@gmail.com wrote: Hello Experts, Trying out a module where in donations for a social cause will be accepted through a webform. For every donation record we need to accept the donor_id,cause_id,amount being donated. In the Donations Add form instead of displaying the actual donor_id we want to display its corresponding Donor.first_name (this should be the drop down). Similarly instead of displaying cause_id we want to display the Cause.cause_title in the drop down. This way the user will be easily create a donation record. The concerned DB table structures,model,controller and view functions are listed below. Kindly help me out. Thanks in advance. Donations Module = Model (donation.php) = ?php class Donation extends AppModel { var $name = 'Donation'; //The Associations below have been created with all possible keys, those that are not needed can be removed var $hasOne = array( 'Cause' = array( 'className' = 'Cause', 'foreignKey' = 'cause_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '' ), 'Donor' = array( 'className' = 'Donor', 'foreignKey' = 'donor_id', 'dependent' = false, 'conditions' = '', 'fields' = '', 'order' = '' ) ); } ? Donations Module = Controller (Add function) = function add() { if (!empty($this-data)) { $this-Donation-create(); if ($this-Donation-save($this-data)) { $this-Session-setFlash(__('The Donation has been saved', true)); $this-redirect(array('action'='index'));} else { $this-Session-setFlash(__('The Donation could not be saved. Please, try again.', true));} } $donors = $this-Donation-Donor-find('list'); $causes = $this-Donation-Cause-find('list'); $this-set(compact('donors', 'causes')); } Donations Module = View (add.ctp) == div class=donations form ?php echo $form-create('Donation');? fieldset legend?php __('Add Donation');?/legend ?php echo $form-input('donor_id'); echo $form-input('cause_id'); ? /fieldset ?php echo $form-end('Submit');? /div div class=actions ul li?php echo $html-link(__('List Donations', true), array ('action'='index'));?/li /ul /div MySQL Table Structures = create table causes ( id int(11) auto_increment, cause_title varchar(255), cause_desc text, funds_needed int(11), funds_collected int(11), cause_status varchar(255), cause_snaps text, primary key(id)); create table donors ( id int(11) auto_increment, first_name varchar(255), last_name varchar(255), surname varchar(255), address text, city varchar(255), state varchar(255), country varchar(255), cause_id int(11), primary key(id)); create table donations( id int(11) auto_increment, donor_id int(11), cause_id(11), amount int(11), primary key(id)); --~--~-~--~~~---~--~~ 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: CakePHP hacked many times
If we knew *anything* about your system, we might know what's wrong with it. Do you not have any log files? Do you sanitize your input (*everywhere*)? On Apr 17, 9:10 am, Kal kalpatt...@gmail.com wrote: Hi CakePHP gurus, My name is Kal and our website developed over CakePHP is crashing partially every month. We are getting 404 errors on some of the pages and all thumbnails disapper too. The only way to fix it is to restore the backup. Any suggestions why this is happening? Regards Kal --~--~-~--~~~---~--~~ 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: Paginator sort() links not switching between asc and desc?
Yup... https://trac.cakephp.org/ticket/6218 On Apr 17, 8:38 am, George H acher...@gmail.com wrote: Hi guys, I have a list of users displayed in my view in a table, and the resultset is parsed by Paginator. I am also echoing $paginator-sort () in my view. When I view the page the links work and they sort by the columns that I have specified in my code. But I thought that if I was to click on the same column again (eg. sorting by last logged in date) that it would sort in descending order, click again sort ascending, etc. It's not doing this – it just sticks to ascending order only. Is this the way it supposed to work? In the documentation (http:// api.cakephp.org/class/paginator-helper#method-PaginatorHelpersort) it says under return: string A link sorting default by 'asc'. If the resultset is sorted 'asc' by the specified key the returned link will sort by 'desc'. I've taken this to interpret as the link is like a toggle, but in my case this isn't the case. You can see my code here:http://pastebin.com/f64b7e200 TIA. -- George --~--~-~--~~~---~--~~ 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: Static page without default header
Just set your layout to 'ajax', i.e. in your controller/view: $this-layout = 'ajax'; On Apr 15, 10:15 pm, Paco Gomez paco.gomez.ar...@gmail.com wrote: Hello, I'm developing a register user form where I have the typical checkbox with an agreement text. This is a link to the agreement conditions. How Could I do for opening a page without the content from default.ctp? Thank you very much --~--~-~--~~~---~--~~ 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: Layout Columns
Of course you can. $content_for_layout is nothing but a regular view variable, like the ones you set in your controller with $this-set(). On Apr 15, 10:43 pm, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: Can you take 1 template (default.ctp) and define sections within it? I have a 2 col layout and would like to define what modules to load depending on the page a user is on / if logged in / by group How can this be done if all i have is ?php echo $content_for_layout; ? Thinking of Joomla where you can set what modules for each page is the idea. Is that possible? Dave --~--~-~--~~~---~--~~ 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: Paginating related items
Well, I'm no expert, but this line stinks: $this-set('day', $this-Day-read(null, $id), $this-paginate ('Birthday')); as you can see in the API[1] and The Book[2], Controller::set() accepts only two params.. [1]: http://api.cakephp.org/class/controller#method-Controllerset [2]: http://book.cakephp.org/view/427/set Try fixing that and we'll see what's the next step :-) On Apr 14, 12:42 am, Cody Sortore rebel2noav...@gmail.com wrote: Okay, so I'm working on creating a website where one of the things people can do is add their birthdays, each day of the year is listed, and peoples birthdays are listed inside of the views for the days as related birthdays with standard bake format. Been trying forever to figure out what I need to do to get only the birthdays to show that I've approved though. This is the latest attempt of mine... which seems like it should work? but obviously does not... or else I wouldn't be on here now. Thanks in advance for any help you guys can offer! This group has been a great help to me in the past. ?php class DaysController extends AppController { var $name = 'Days'; var $helpers = array('Html', 'Form'); var $paginate = array('Day' = array('limit'=31), 'Birthday' = array ('conditions' = array('Birthday.approve' = 1))); function index() { $this-Day-recursive = 0; $this-set('days', $this-paginate('Day')); } function view($id = null) { if (!$id) { $this-Session-setFlash(__('Invalid Day.', true)); $this-redirect(array('action'='index')); } $this-set('day', $this-Day-read(null, $id), $this-paginate ('Birthday')); } } ? --~--~-~--~~~---~--~~ 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: Anyone has used a cakePHP paginator class that can paginate for non database records
Haven't seen anything like that yet.. Why not make one yourself and put it in the Bakery? :) On Apr 10, 5:26 pm, Anibigi anamikasarkhe...@gmail.com wrote: Hi, I'm a newbie to cakePHP. I want a paginator class that would work well with both database and non database record set. I found a couple of classes for paginating records pulled from database but none so far for any temporaray arrays of records. Can anyone help with this please --~--~-~--~~~---~--~~ 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: Use another model function from an unrelated model
grigri had a nice clean solution for this: http://bin.cakephp.org/saved/38624 On Apr 9, 12:13 am, Joe Critchley joecri...@gmail.com wrote: You should probably use the ClassRegistry class. You can instantiate an unrelated model by doing the following: $ModelName = ClassRegistry::init('ModelName'); ... and then use the functions from that variable, e.g... $ModelName-delete($id); Hope this helps. On Apr 8, 10:55 pm, lemp goo...@forgenumerique.com wrote: I’m building a statistical application and I need to access a function that return reference values from a model that is unrelated with the model where I need this data. What is the best way to achieve this? --~--~-~--~~~---~--~~ 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: AJAX pop-up form - where should a newbie start?
Well, why not start with the AJAX helper and the already built-in feature: http://book.cakephp.org/view/632/autoComplete I believe that will be much faster to develop than your proposed solution with the modal form. And since you're in a hurry... On Apr 7, 9:32 pm, Faza f...@ansi.pl wrote: Hello, this is the scenario: - I have a rather large form with some production details, blahblah. One of the inputs can contain value from over 1300 available (more to be exact, because it's ID, dimensions and layout - 5 to 7 fields each) - as it would be silly and resource-hungry to parse all this data into javascript arrays within the view, I've decided that I want to have a popup window with a small form, which will close after choice made and free the resources - this form won't POST the data into controller, because it's only a part of the whole form; the only thing it's gotta do is change value of few inputs. I've been googling and read some examples using fancy modal forms using jQuery, MooTools etcetc, but what I really need is just a simple popup window with some AJAX calls. (later, when the project will be ready, I will play around with more complex things for this, but atm i'm rather in a hurry). The problem is, this is my first encounter with AJAX (not to mention I'm a cake noob) and frankly, I don't even know where to start. I'll be really grateful for any tips/pointers/tuts/anything. Regards, Jacek --~--~-~--~~~---~--~~ 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: What do ARO and ACO stand for?
http://book.cakephp.org/view/465/Understanding-How-ACL-Works Answers are drawing near.. On Apr 5, 8:56 pm, bearlee brianleeu...@gmail.com wrote: It a novice quesiton, but these acronyms bother me if I don't know what they mean (my pet-peeves). What do ARO and ACO stand for? -Brian --~--~-~--~~~---~--~~ 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: New to CakepHp.. question
This is a very very very bad design decision. User data != internal system data. Use another column for your serial, and leave User.id to cake. BUT, if you really have to use it as a primary key, you could try leaving it named serial_number or whatever and customizing your model to use that field as primary key, but I'm not sure how this will work. On Apr 2, 9:48 am, vanushv van...@gmail.com wrote: The serial will be entered manually by an operator On Apr 2, 5:15 pm, John Andersen j.andersen...@gmail.com wrote: My question is, when are you going to enter the user serial? Is it done manually by you or can it be done automatically? If automatically, then ensure that you have the new user serial available when a user is being registered! Enjoy, John On Apr 2, 8:17 am, vanushv van...@gmail.com wrote: Hey i'm trying set up a fairly simple webapp and so far I've used the bake script and it worked pretty good to establish a base for me In my database there is a table of users; each user has a serial number. i want the serial number to be a primary key - so i renamed the serial column to 'id'. But.. when Adding new users I want to be able to enter the user serial (id). When i set everything up with bake and tried to add a new user it failed because the primary key (id) is empty - (i didn't set an auto_increment on it). Anyone have any ideas? VaNuSh --~--~-~--~~~---~--~~ 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: Cannot connect to database
If you're 100% sure this is a firewall issue, that it is NOT a CakePHP related question. You should go to the firewall related forums. As a tip, you should definitely stop using the built-in windows firewall and try something functional. Comodo is one of the best and it's free (http://personalfirewall.comodo.com/), just skip the antivirus during installation. Hope that helps. On Mar 30, 7:17 am, Pittore solounpitt...@gmail.com wrote: I am using Windows XP with a wamp installation...starting to get somewhere but when I attempt to run CakeTooDoo from CAKEPHP Application Development by Bari and Syam, I get cannot connect to database. I have been doing some diagnostics and found out my firewall is blocking port 3306 which is needed to connect to any of my mysql databases. Not sure how to add this port. When I go to control center under Firewall exceptions I attempt to add this port but it says port already exists. I guess I do not need to add it, if it exists, I just need to open it (get Firewall to stop blocking it). any ideas? I think I have resolved all my mysql and php userid and password issues...but one never knows. I have not yet edited my.ini which is something one can get to from the wamp mysqladmin. I haven't edited that because I might screw everyhting up. My php seems to be working. My apache is working. The problem is getting php to talk connect to mysql database. Is there some kind of test to run? The wampserver console indicates I have databases and displays their structure and all. I can run SQL queries on them. Just cannot get CAKEPHP to function yet. Why should this be so difficult? I have only been working on this for 4 months now! Pittore --~--~-~--~~~---~--~~ 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: incorrect action attribute when creating a form
Url is missing: ?php echo $form-create('User', array('url' = array('action' = 'login')));? On Mar 25, 9:52 pm, jonas jonas.subscripti...@gmail.com wrote: When I create a form there goes something wrong when the action attribute of the form element is created. View code: ?php echo $form-create('User', array('action' = 'login'));? ?php echo $form-input('username');? ?php echo $form-input('password');? ?php echo $form-submit('Login');? ?php echo $form-end(); ? Outputs: form id=UserLoginForm method=post action=/~jonas/cake-template/ index.php/users/users/login ... Clearly this should have been action=/~jonas/cake-template/index.php/ users/login ! Why is this happenings ? --~--~-~--~~~---~--~~ 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: Creating Post Views (Blog tutorial)
Do you get a HTTP 404 not found or some other flavour of not found? If it's 404, do you have .htaccess set up correctly? If it's not, did you check the naming of your classes, files, folders? Do you have anything written in your log files? On Mar 26, 6:35 pm, albe radia...@libero.it wrote: Hello everybody, I had a problem following the tutorial to build a blog on the Cookbok. When is thehttp://book.cakephp.org/view/336/Creating-Post-ViewsMOMENT to create the View file, I exactly do what's written on the tutorial. I create a file located in /app/views/posts/index.ctp and containing the code as written in the code box (whithout any other tags...). The problem is that pointing the browser at the address athttp://localhost/cakeblog/posts/indexthe file results NOT FOUND. Can someone help me? Thanks! -- View this message in context:http://www.nabble.com/Creating-Post-Views-%28Blog-tutorial%29-tp22727... 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: How to get a unique session id.
How about the session id? o_0 On Mar 19, 11:24 pm, asoft boateng.kwa...@gmail.com wrote: Does any one know how to get the unique session id that is created. It's like in CakePHP the closest thing to the session_id() is the useragent. I want to make an ecommce site where users don't create an account to shop. Can i get any help. 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: how to send email
You send an email to yahoo and gmail the same way you send to any other account, right? Also, why are you working on cakephp 1.1? On Mar 19, 2:40 pm, sandhya sandhyanair...@gmail.com wrote: send email to yahoo and gmail accounts using cakephp 1.1.19.6305 --~--~-~--~~~---~--~~ 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 Pass a variable value from any controller to the default.ctp ?
You're probably looking for flash: http://book.cakephp.org/view/568/flash On Mar 18, 2:34 pm, Sourav souravbas...@gmail.com wrote: How to Pass a variable value from any controller to the default.ctp ? I want to display the success/failure message of a signup operation on a particular place on the main layout (default.ctp). How to accomplish this ? Thanks in advance. --~--~-~--~~~---~--~~ 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: Issues For Template Integration with Multi language String Variables
That syntax should absolutely work. Did you check the error log? Are you getting an error? And how does this not working manifest itself? On Mar 18, 1:52 pm, keyurvagh...@gmail.com keyurvagh...@gmail.com wrote: Hello Friend, I am working on cakephp1.2 project and having facility of multi languages. I am using L10n $this-L10n = new L10n(); method for applying language based on selection. I have made two different files for loading message string id variable as below location: For English: app/locale/eng/LC_MESSAGES/default.po and For French: app/locale/fre/LC_MESSAGES/default.po but facing following issues while template integration and using cake convention for following controls: When i have set variable of multi language file as label with html control element like button and link it will not work correctly. For example, - General syntax of cake php to display link as below: echo $html-link('Link Text' , array('attrkey' = 'attrvalue')); suppose if i want to display following link with multi language string variable echo $html-link('Create User',array('attrkey' = 'attrvalue')); - If I want to display above link with multi language string variables then I have to write as below: echo $html-link(__('Create User',true),array ('attrkey'='attrvalue')); But above thing or syntax will not be worked and same thing happened with buttons too. Same issue facing on button if i want to display button like echo $form-button(__('Create User',true),array ('attrkey'='attrvalue')); but not working any one help me on this issue please.or having any kind of solution then please reply me ASAP. Thanks, Keyur. --~--~-~--~~~---~--~~ 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 remove the action name from the URL
How about: Router::connect('/*', array('controller' = 'sites', 'action' = 'page')); Of course, you need to consider the option when someone doesn't send you the page-id.. On Mar 18, 6:00 pm, koala kid alexhob...@gmail.com wrote: I am making some changes to a CMS someone else has developed using cake. Currently all pages are served up using a controller called sites so any given url will look like: /sites/page-id However is there a way using Routes to direct the simple /page-id to the sites controller. My Routes currently looks like this: Router::connect('/', array('controller' = 'sites', 'action' = 'index')); Router::connect('/sites/*', array('controller' = 'sites', 'action' = 'page')); --~--~-~--~~~---~--~~ 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 remove the action name from the URL
Try removing that first route.. On Mar 18, 7:11 pm, koala kid alexhob...@gmail.com wrote: Thanks for the reply. I tried that but I just get a timeout error. My Routes looks like this: Router::connect('/', array('controller' = 'sites', 'action' = 'index')); Router::connect('/*', array('controller' = 'sites', 'action' = 'page')); On Mar 18, 1:25 pm, dr. Hannibal Lecter lecter...@gmail.com wrote: How about: Router::connect('/*', array('controller' = 'sites', 'action' = 'page')); Of course, you need to consider the option when someone doesn't send you the page-id.. On Mar 18, 6:00 pm,koalakidalexhob...@gmail.com wrote: I am making some changes to a CMS someone else has developed using cake. Currently all pages are served up using a controller called sites so any given url will look like: /sites/page-id However is there a way using Routes to direct the simple /page-id to the sites controller. My Routes currently looks like this: Router::connect('/', array('controller' = 'sites', 'action' = 'index')); Router::connect('/sites/*', array('controller' = 'sites', 'action' = 'page')); --~--~-~--~~~---~--~~ 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: Users with ACL problem
What brian is suggesting is the following: 1. Right not your ARO (requester) is a User, which forces you to distinguish between students and teachers 2. If you make Teacher an ARO and Student another ARO, you eliminate that problem (this is easily done with ACL) On Mar 16, 3:12 am, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: Over my head...this is my first attempt using Cake and with ACL and AUTH and everything else its just overwhelming... So I am not even sure what your trying to explain to me. Forgive my rookie aspect. Still trying to figure out the contain message you sent to me. When you want to list your Bookmark, use contain to grab the Post info, as well. 'contain' = array( 'Post' = array( 'fields' = array( 'title', 'description' ) ) ) I am not using the list. Its all showing up in the related info that shows up on the index page of the user/view so the user can see his bookmarks on his page. Thanks, Dave -Original Message- From: brian [mailto:bally.z...@gmail.com] Sent: March-15-09 11:29 PM To: cake-php@googlegroups.com Subject: Re: Users with ACL problem Actually, I was going somewhere else with this but ... couldn't you just assign the ARO to Teacher instead of User? AFAIK, there's no reason an ARO can't be assigned to something other than a User. On Sun, Mar 15, 2009 at 9:49 PM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: Yes that is correct. Both the TEACHERS and STUDENTS have a user_id field which is the USER ID. -Original Message- From: brian [mailto:bally.z...@gmail.com] Sent: March-15-09 10:20 PM To: cake-php@googlegroups.com Subject: Re: Users with ACL problem But Teacher should also have a user_id field, yes? On Sun, Mar 15, 2009 at 8:09 PM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: I think I may have caused my self more of a headache then necessary and would like to hear your thoughts on my set up. On my site there are 2 different GROUPS a USER can sign up as. Each form creates the USER and corresponding TEACHER profile (table has USER_ID) or STUDENT profile (table has USER_ID). So when either signs up it creates a USER and a TEACHER or STUDENT with the USER_ID being the USER ID. I chose to break the USERS for the TEACHERS and STUDENT because the profiles are completely different and have different validation criteria. Now when add the Auth and ACL I want to now set it so the TEACHER or STUDENT can edit their own contributions to the site. Where I am finding the headache is when checking to see if the user can perform specific actions. For example a TEACHER adds a new test the only person who can edit that test would be the teacher who created it (among many other owner related operation). But when the test was created it was done so by using the teacher id and AUTH checks the User id. Now I am sure I can get the user id front the teacher id but that seems like more work than needed because when it comes to the STUDENT side of the site everything will have to be done the same way to find the USER ID there as well. Another problem is the TEACHERS have a lot of HABTM tables where they can select SUPPLIES , BOOKS, SKILLS...etc related to their TEST or EXAM they create which are all related to the TEACHER thru the teacher id not the user_id. In theory I would like to use only the user id but in my situation is that possible because I choose to break up my users? Thanks for you time and insight to all... Dave --~--~-~--~~~---~--~~ 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 component
You might want do a DISTINCT select on that one if you're talking about per-page keep me updated. On Mar 15, 5:42 pm, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: I am using the email component in my site and what I want to do is when a USER posts a new comment to a specific page it will notify all USERS who in their profile have selected Keep me updated of new comments. So I was thinking when a new post is added write a function basically like this emailAll () sendTo = find all USERS where Keep_me_updated = 1; set sendTo, $sendTo ; foreach ($sendTo['User'] as $sendTo) : the sending info and such. endforeach; Is this the best way to go about it? Dave --~--~-~--~~~---~--~~ 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: cakephp, wampserver and mod_rewrite
Did you AllowOverride on your document root and the alias? On Mar 15, 1:24 pm, terje tros...@gmail.com wrote: Hi. I have just downloaded and installed wampserver. I have an exisiting cakephp app which i previously had working beautifully under my own custom setup of apache. Now i have wamp installed on c:/wamp and my cakephp app is placed in d:/development/myapp. I created an apache alias (myapp) via wampserver and if i DON'T have mod_rewrite enabled on apache i'm able to accesshttp://localhost/myapp and cake lists up my front page and some database queries etc. But if i try to access anything except the frontpage i get a 400, Not Found and an error message saying the directory: The requested URL /myapp/ journals/view/1 was not found on this server. Now, if i enable mod_rewrite i can't even access the frontpage of my application. Hope someone can help me with this issue. I have read through other posts and googled, but can't seem to find a solution for this. 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: Ajax reload of an element.
Did you go through the AJAX helper chapter in the good book? http://book.cakephp.org/view/212/Methods On Mar 15, 10:25 am, marco.rizze...@gmail.com marco.rizze...@gmail.com wrote: Hi I have a page where I have an element (with params) that is a list of items. Now I would that when user click on a certain button the element is reload . I would make this with ajax. How can I do the ajax reload of an element? Many 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: recursive in parents
A silly guess would be that you didn't set up your B=A relation properly. Could you please show us your relations? Hint: http://bin.cakephp.org/ On Mar 11, 6:39 pm, fain182 fain...@gmail.com wrote: my situation is this: A has many B B has many C in the view of C i see only the data of B and C, i want to see the data of A too.. i tried to set the recursive to 2 or 3 but it makes something like: array A array B that has A array A that belongs to B did you have any suggestion? 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: recursive in parents
Yes, it seems ok. How do you get your data with find()? On Mar 11, 10:26 pm, fain182 fain...@gmail.com wrote: mhmm.. i think that's all right with relations... I baked them.. http://bin.cakephp.org/saved/43619 On Wed, Mar 11, 2009 at 9:40 PM, dr. Hannibal Lecter lecter...@gmail.com wrote: A silly guess would be that you didn't set up your B=A relation properly. Could you please show us your relations? Hint:http://bin.cakephp.org/ On Mar 11, 6:39 pm, fain182 fain...@gmail.com wrote: my situation is this: A has many B B has many C in the view of C i see only the data of B and C, i want to see the data of A too.. i tried to set the recursive to 2 or 3 but it makes something like: array A array B that has A array A that belongs to B did you have any suggestion? 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: Why we cann't use Auth component in AppController?
That depends on how did you set up your Auth. Are you denying everything in UsersController? On Mar 4, 4:01 pm, Joshua josh...@gmail.com wrote: It seems that if I use Auth component in AppController and then I use it again in my UserController again. All the request like ../users/ method_a will be redirect to login page. If I remove the Auth component from UserController, everything works fine! Why? Is there any explanation for this? --~--~-~--~~~---~--~~ 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: Accented character in a TextArea
Encoding is probably the problem. Try the following: http://dsi.vozibrale.com/articles/view/cakephp-character-encoding-special-characters On Mar 2, 10:47 am, whitewolf lorenzofornare...@gmail.com wrote: Hi guys, I'm new with CakePhp, I have my first hurdle with my pratical excercise. When i try to fill one textarea with a string that contains an accented character (this comes from mysql databasefield), it doesn't. But when replace that character with an alfabetical character the textarea displays correctly the string. I used the form helper in this way echo $form-input('project_details', array('type'='textarea','label' = 'Dettagli Progetto','rows'='5','cols'='10'); project_details is a TEXT database field. What is the matter? Thanks in advance 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 -~--~~~~--~~--~--~---
Re: how to use template in email
Here is a simple step by step guide: http://dsi.vozibrale.com/articles/view/using-emailcomponent-in-cakephp-1-2 Hope that helps! On Mar 3, 11:36 am, vikas vikas...@gmail.com wrote: Hello every one.. I am trying to use inbuilt email component of cakephp to send email. In article given atwww.cakephp.org (http://book.cakephp.org/view/270/Class-Attributes-and-Variables) we can set some values: in that they have given: template- The email element to use for the message (located in app/ views/elements/email/html/ and app/views/elements/email/text/) I cant understand how to use template in email here.. somebody please help me on this issue.. --~--~-~--~~~---~--~~ 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: Style Submit
Send an empty string instead of Delete string? On Mar 3, 9:50 pm, WidePixels d...@widepixels.com wrote: Does anyone know how to style the SUBMIT button when using the AJAX helper? I know how to styles the button, issue is I am using a custom button in a css sprite (2 states of the button, rest / hover as 1 image) and my button has its own text. So how can I remove the text from the ajax link? I want to remove the Delete text. ?php echo $ajax-link('delete', '...'', array('update' = '', 'class' = 'delete_btn', 'loading'= .., 'loaded'= ..., 'confirm' = 'Are you sure you want to delete this item?', null, FALSE)); ? CSS: a.delete_btn {float:right;background:url(images/hf_btn_delete.jpg) top left no-repeat; height:21px; width:49px; display:block} a.delete_btn:hover{ background-position:0px -21px} Thanks, Dave --~--~-~--~~~---~--~~ 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: Error handling in production
I know this may seem like a strange idea, but why not iron out those notices before going live? On Mar 2, 7:52 am, Aidan Lister aidanlis...@gmail.com wrote: I have two questions for error handling in a production environment. a) How can I log warnings notices b) What's the best way to display custom error pages This is what I know so far, I can define app_error.php and create my custom error handlers there. This works fine for development, but once I switch to production these errors are replaced by error500. I can define an appError in app_controller.php, but this doesn't catch notices, and I see no obvious mechanism for calling my custom error handlers in app_error.php. I can overwrite __construct in app_error.php to do something like: ?php function __construct($method, $messages) { $methods = array('paypal', 'system', 'payflow', 'cart', 'generate'); if (in_array($method, $methods)) { Configure::write('debug', 1); } parent::__construct($method, $messages); } ? But I've been told this is an exceptionally bad idea by the gurus in #cakephp. So, I ask, what does everyone else do? Thanks, Aidan --~--~-~--~~~---~--~~ 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: Is it possible to create sub-controllers - directorys?
You don't need the extra folder, this is solvable by simple routing. Put your GroupNewsController in /controllers/ group_news_controller.php And add this line in /config/routes.php: Router::connect('/group/news/:action/*', array('controller' = 'group_news')); Hope that helps! On Mar 1, 5:20 pm, r.ausser...@googlemail.com r.ausser...@googlemail.com wrote: Hello, is it possible to create something like this:www.domain.com/group/news/list with a path of this: /controllers/group/news_controller.php and the fitting view? thx ;) --~--~-~--~~~---~--~~ 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: What do you develop in (ide, text editor, etc.)?
NetBeans it is. Everything else is either too simple or to bloated. NetBeans developers seem to know how to dance on that fine line of usability and simplicity. On Mar 1, 1:21 pm, Terr mega...@gmail.com wrote: I'm using Notepad++ and Eclipse PDT, but without code completion for Cake's way of model loading it doesn't matter too much which you pick. But yesterday I stumbled across this video (http://www.pseudocoder.com/ archives/2009/02/25/programming-cakephp-app-with-komodo-ide/) that demonstrates the CakePHP addon for Komode Edit (free) / IDE (paid) that does just that: understanding Cake's dynamic models and providing code completion. I haven't got it working yet, but as soon as I do it's time for me to wave goodbye to all other editors. On Feb 28, 9:14 pm, adam abennett...@sbcglobal.net wrote: I'm using Eclipse with PDT, but Dreamweaver for making layouts. --~--~-~--~~~---~--~~ 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: CakePHP Newbie about dropdown
Hmmm...which version of cake are you using? The error you're getting is because your model names should be singular, not plural. So instead: var $uses=array('Courses','Providers'); try var $uses = array('Course', 'Provider'); And see if that helps. On Feb 26, 11:00 pm, Jose jfe...@gmail.com wrote: Hi All, I have two controllers: courses and providers defined as: class CoursesController extends AppController { var $name='Courses'; var $uses=array('Courses','Providers'); var $belongsTo = array('Provider' = array('className' = 'Provider', 'conditions' = '', 'order' = '', 'foreignKey' = 'provider_id' )); class ProvidersController extends AppController { var $name='Providers'; var $hasMany=array('Course'); in the add function at the CoursesController I have: function add() { if (!empty($this-data)) { if ($this-Course-save($this-data)) { $this-flash('Your Course has been saved.', '/courses'); } } else { $this-set('providers', $this-Course-Provider-generateList()); $this-render(); } } and at the view for the add I have: echo $form-create('Course'); echo $form-input('name'); echo $form-input('provider_id'); $html-selectTag('Course/provider_id', $providers, $html-tagValue ('Course/provider_id'), array(), array(),false, true))); echo $form-end('Save Post'); The problem then getting into the /add is: Notice (8): Undefined property: CoursesController::$Course [APP \controllers\courses_controller.php, line 32] Notice (8): Trying to get property of non-object [APP\controllers \courses_controller.php, line 32] Fatal error: Call to a member function generateList() on a non-object in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\app \controllers\courses_controller.php on line 32 the line 32 is: $this-set('providers', $this-Course-Provider- generateList()); I have read several samples and it looks I am doing the right thing, but something it's missing! --~--~-~--~~~---~--~~ 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: afterDelete question
You are correct, model callbacks are not called for related models. You will probably have to handle that in Member::afterDelete(). On Feb 25, 8:57 am, Deividas deividas.sen...@gmail.com wrote: I have two controller's, for example Members and MemberPictures, when I delete Member i want MemberPicture also deleted, i have set MemberPictures dependable in Member model, but I also want to unlink actual picture from the file system. I've tried using afterDelete() in MemberPicture model, but it doesn't seem to be called when i delete Member. Maybe I am doing something wrong? p.s 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: Trouble fetching database information
Obviously, User model is not used in SupplierController, i.e. you're missing the following var $uses = array('User'); In your controller. That's why Undefined property error occurs when you do $this-User. Hope that helps! On Feb 25, 3:27 pm, Matt mmanai...@gmail.com wrote: Hi all, I'm new to CakePHP (but not PHP) and I have followed the 5 part series by IBM to get me going on Cake PHP. I'm building a mini CMS for a client, and I am stuck... here's how the system should work: the client logs in and adds a supplier. The supplier is added to the database and has a field user_id which needs to automatically populate with the logged in user's id. My problem is that when I try to get the userid, I get the following error: Notice (8): Undefined property: SuppliersController::$User [APP/ controllers/suppliers_controller.php, line 27] Fatal error: Call to a member function findByUsername() on a non- object in /var/www/online_contractors/app/controllers/ suppliers_controller.php on line 27 In the supplier controller I attempt to fetch the userid as so: $results=$this-User-findByUsername($username); $this-set('user', $results['User']); The username is what gets written to session when logged in. Any help would be greatly appreciated! Thanks! -Mathieu --~--~-~--~~~---~--~~ 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: AuthComponent problem
If you're having problem with a piece of your code, use the CakeBin (http://bin.cakephp.org/) to show us your code, give us a detailed description of your problem, i.e. what do you want to accomplish, what is the expected output and what is the output you're getting. Then someone might try to answer your question. On Feb 24, 8:05 am, lakersfan74 lakersfa...@msn.com wrote: Hello, I have a problem with AutoComponent. I want to use AutoComponent in two different controllers. If I use it in only one controller its fine. If I use it in the second controller, the AutoComponent in the first controller is not valid and password field is not encrypted. Any help will be greatly appreciated. Thanks, Bharani -- View this message in context:http://www.nabble.com/AuthComponent-problem-tp22176142p22176142.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: Password field not encrypting
Do you have beforeFilter() in your users controller? Are you calling parent::beforeFilter()? On Feb 23, 3:39 pm, lirc201 brian.e.lave...@gmail.com wrote: I'm trying to implement the Auth component for the first time into my application. On my registration page I noticed that the password was getting inserted into the database as plain text. The application does not use the default names username and password so I defined the fields as stated in the documentation. app_controller: function beforeFilter() { // Configure Authuentication Component $this-Auth-loginAction = array( 'controller' = 'users', 'action' = 'login' ); $this-Auth-fields = array( 'username' = 'email', 'password' = 'passwd' ); $this-Auth-authorize = 'controller'; $this-Auth-logoutRedirect = /; $this-Auth-loginError = 'Invalid email/password combination, please try again.'; } So in my signup code I added: $this-data['User']['passwd'] = $this-Auth-password($this-data ['User']['passwd']); to get the encrypted password put into the database, and that seems to work. Next I proceed to the login page to test the new account (standard login, cut and pasted code from documentation, but using my email, and passwd fields). I then get my Auth-loginError, which I believe is because the password is not getting encrypted automatically. I was under the impression that by using the $this-Auth-fields, that the automagic would still work for me. Does the Auth-fields work as intended? Thanks, Brian --~--~-~--~~~---~--~~ 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: Problem with selecting value from select helper
Hi Maulik, you cannot be that vague about your problem. People need more details to be able answer your question. If you're having problem with a piece of your code, use the CakeBin (http://bin.cakephp.org/) to show us your code, give us a detailed description of your problem, i.e. what do you want to accomplish, what is the expected output and what is the output you're getting. You know, clues. People might not be as polite when you do all the above with a demanding post like give me the right way for it. Remember that people here are answering questions in their own spare time. They are not paid and don't have the time to investigate what you meant to ask. A well asked question is bound to get an answer. Poorly asked question will simply be ignored. Keep that in mind. Cheers. On Feb 21, 2:51 pm, Maulik maulik@gmail.com wrote: hi to all there is a problem that i hv created a helper of different cities but when i try to edit the user profile form then the helpers values could not locate on that page.. give me the right way for it 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: Question about the actions in aros_acos
A zero has a lot to do with the process. It means that specific permission is inherited from a parent node. On Feb 21, 3:49 am, Joshua josh...@gmail.com wrote: I got it! //code switch ($perm['_' . $action]) { case -1: return false; case 0: continue; break; case 1: return true; break; } //code end 0: will has nothing to do with your check process; -1: if _create was setted -1 , and you write like this '$this-Acl-check('group.anonymous', $aco, write)', you will get a false return. That means we can set these four actions separately. On Feb 21, 10:29 am, Joshua josh...@gmail.com wrote: Steve, thank you! Yeah, I found this in cake source code //code /** * Determines whether the given user is authorized to perform an action. The type of * authorization used is based on the value of AuthComponent:: $authorize or the * passed $type param. * * Types: * 'controller' will validate against Controller::isAuthorized() if controller instance is * passed in $object * 'actions' will validate Controller::action against an AclComponent::check() * 'crud' will validate mapActions against an AclComponent::check() * array('model'= 'name'); will validate mapActions against model * $name::isAuthorized(user, controller, mapAction) * 'object' will validate Controller::action against * object::isAuthorized(user, controller, action) * * @param string $type Type of authorization * @param mixed $object object, model object, or model name * @param mixed $user The user to check the authorization of * @return boolean True if $user is authorized, otherwise false * @access public */ function isAuthorized($type = null, $object = null, $user = null) { //code end There is another question, if _create action was setted -1 and others were setted 1. What will happen? Hope somebody can help! :-) On Feb 21, 8:03 am, stevel isig...@gmail.com wrote: I'm not an expert in this. This is my understanding. How the 4 action settings are used depends on the type of authorization mode you are using. If you select the CRUD mode Auth-authorize = 'crud', then the full functionality of the aros_acos table will be utilized, so that access will be granted to an action only if the column for that action is set to a value of ‘1’. So for this situation, you can have a mixture of 1 and 0 for the 4 action column. But if you set Auth-authorize = 'actions' or Auth-authorize = 'controller', then the 4 settings are used differently. For example, I use Auth-authorize = 'actions'; then in the aros_acos table for a particular action, I have to set all 4 settings to 1 to allow access permission to that action or set to 0 to deny access. If any one of the 4 is set to ‘0’ or ‘-1’ no permission will be granted to the entire node. Which is what you brought up as true and false setting. So if you want it to be true, set all 4 columns to 1, or if you want it to be false, set all to 0 (or at least one column to 0). Not sure if that helps or not. If my understanding is incorrect, hopefully some experts will help explain it better. Cheers, Steve On Feb 20, 6:42 am, Joshua josh...@gmail.com wrote: Thanks for your reply! So what's meaning of these four actions, like _update,_create,_read,_delete in table aros_acos? We say an user has the read rights of an action post? In my opinion, there should be only two status, true or false instead of these four actions. If true, we can say an user has the right of post action. If false, an user has no rights to the action. ? On Feb 20, 10:09 pm, James Louie Puro james.louie.p...@gmail.com wrote: I think not...while AROs are elements trying to gain access to a protected system like users and groups, ACOs are elements (actions) that are being protected. so you can add acos (action) in your controller just like function index, view...etc and assign AROs to it. On Fri, Feb 20, 2009 at 5:01 PM, Joshua josh...@gmail.com wrote: Is there anybody can help me? On Feb 20, 8:22 pm, Joshua josh...@gmail.com wrote: Hi, I try to add ACL to my application, but when I take a look at the table 'aros_acos', it seems there is only four actions in the table.
Re: new to cakephp
I want to know it is possible to only lock some of features in a page and leave other portion of the lage open to public without requiring login. Yes. I also want to know where i can find existing code that supports basic login/logout and basic user control panel. http://book.cakephp.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: Problem with email component after upgrade to 1.2 final
This is related to ticket #5904 (https://trac.cakephp.org/ticket/ 5904). If you use 1.2.1 stable it should work as expected without any extra calls. On Jan 8, 6:08 pm, Brenda rld0...@gmail.com wrote: H... I don't have any $controller to change to $this-controller. I tried adding the code for startup, and that didn't seem to make a difference. I'm not really clear on what that would do? I've tracked this down a little bit more, and it seems the problem is with the email elements. I set them in the controller, like this: $this-set('messageText','A new message is waiting for you on the MySite.com website. Log into the member area to view your messages.'); The email template uses $messageText, but it seems not to exist and that is what generates the error. This worked fine in RC3... I wonder what changed? --~--~-~--~~~---~--~~ 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: Auth/ACL - edit forms and password problems
I hope this might be of some help: http://dsi.vozibrale.com/articles/view/manually-hashing-password-and-password-validation On Feb 16, 5:21 pm, Chris c.gra...@hpani.org.uk wrote: Perhaps I am just having a blonde moment, but I seem to be having difficulties with ACL and passwords. I followed the example athttp://book.cakephp.org/view/641/Simple-Acl-controlled-Application and then once I was confident of what I was doing implemented it into my current project. It has all worked fine, AROS/ACOS all generated, logging in and out fine, permissions working however there is a problem. The edit form for users pulls in the password by default and I wanted to leave it blank so that the user can update extra info on themselves without having to change their password, so I passed in empty string as the value in the input. When the post occurs $this-data contains an sha1 encrypted string it seems that auth or acl is taking empty string, adding the salt and then encrypting... before validation!!! I decided to just check the value for $_POST['data']['User'] ['password'] and if that is blank then unset $this-data['User'] ['password'].. problem solved. in a not so nice way. However another issue has now raised its ugly head. My validation rules are now meaningless. I have a minimum length validation rule on the password field to ensure that passwords are 8 characters or more. This rule is now always met because the string is sha1 encrypted before validation and is therefore always 40 characters long. The only solution I can think of, for now, is controller based validation on the raw post data. which isn't very clean. If anyone has a better idea please let me know. --~--~-~--~~~---~--~~ 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: cookbook - 81,000 unique visitors this month
Hah, maybe the group is so good that all of their questions have already been aswered? :) On Feb 15, 11:47 am, keymaster ad...@optionosophy.com wrote: Gwoo recently posted that from Jan. 12-Feb. 11/2009, there were 81,000 unique visitors to CakePHP.com. Firstly, that is absolutely outstanding. Wondering why the discussion group membership lags so far behind, though, at only 11,300 members. Do we really have 70,000 people who are reading posts but are afraid to join? Let's encourage all those who have not yet registered for the discussion group, to do so. --~--~-~--~~~---~--~~ 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: Rendering a view without layout
Use the ajax layout in controller, $this-layout = 'ajax', that should do it. On Feb 14, 4:21 pm, pavan pavan@gmail.com wrote: Hi Friends, I have problem in rendering a view bascially which belongs to different controller without layout.This is my following code pages/index.ctp: ?php echo $this-element('note'); ? ?php echo $this-render('/learning/index',null,null); ? i am using cakephp1.2 Please help me to fix this problem. --~--~-~--~~~---~--~~ 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: dashes in action names
In action names as such, I don't think so. But.. http://book.cakephp.org/view/46/Routes-Configuration you can make it look that way. spence wrote: Hi, Are you allowed to use dashes in action names. IE: domain.com/ controllerName/action-name I know underscores work, but I did not have any luck with dashes? Do you need to configure something for it to work? Thanks, Spence --~--~-~--~~~---~--~~ 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: Link to Image using Helpers
If by app/img you mean app/webroot/img, then the standard $html-link () should be sufficient, right? http://api.cakephp.org/class/html-helper#method-HtmlHelperlink On Feb 12, 10:08 am, Adrian Marte adrian.ma...@gmail.com wrote: Hi, How can I create a link to an image (in the app/img directory) using the HTML helper? I only find solutions for image links, but not links to images. Thank, Adrian --~--~-~--~~~---~--~~ 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: first program in cakephp
Hmmm, well what did you expect? CakePHP is a framework, not an application. http://book.cakephp.org/view/9/where-to-get-help On Feb 11, 9:12 am, kapil kapilut...@gmail.com wrote: i want to run my first cakephp program. but after installation nothing is happened just database is connected nothing more. plz help me thanks in advance --~--~-~--~~~---~--~~ 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: Router, NamedParameters Urls...
URL encoded query strings perhaps? On Feb 10, 6:30 pm, CraigFisher crayfis...@gmail.com wrote: What's the best way of using named parameters to pass URLs into a controller... The router groks because it picks up the : and / as separators. Obviously I can perform some sort of specific code/decode in the code but I feel there must be a 'proper' way of doing it. I've tried using rawurlencode to switch the punctuation to %xx etc - but despite that the Router picks them up as / and : Anyone got any clues? hints? suggestions? I can't be the only one wanting to pass URLs as parameters... -C --~--~-~--~~~---~--~~ 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: help plz
(At the risk of seeming like an evil bastard) You know, I think we should put that message on some sort of a auto- responder here and just go for a beer or something. On Feb 4, 5:09 pm, Smelly_Eddie ollit...@gmail.com wrote: read the manual. http://book.cakephp.org/ On Feb 3, 12:41 pm, monirr muni...@hotmail.com wrote: ok here is my problem i'm new to cake and i bulid every thing ok so i have categories and recipes categories has many recipes , recipes belongs to categories i wanna access recipes by categories this for my public website what code should i put in order to access it by link and shows the recipes in that categories this is my categories table strucature Id Name Area Slug =this one i made it so it can act as slug Active this my categories index a?php $paginator-options(array('url' = $this-passedArgs)); ? table cellpadding=0 cellspacing=0 tr id=categoriesSorting /tr ?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);? ?php endforeach; ? /table div class=paging id=categoriesPaging ?php echo $paginator-prev(' '.__('previous', true), array(), null, array('class'='disabled'));? | ?php echo $paginator-numbers();? ?php echo $paginator-next(__('next', true).' ', array(), null, array('class'='disabled'));? /div and this is my view h2?php __('Recipes By Category');?/h2 br / table ?=$html-link('h3'.$category['Category']['name'].'/h3','/recipes/view/'.$category['Category'] ['slug'],null,null,false);? /table /div div class=clear /div /div /div script type=text/javascript $(#tabpanel ul).tabs(); /script and one more thing when i click on categories lets say new it takes me to the view u know then i can see the link -- View this message in context:http://www.nabble.com/help-plz-tp21814971p21814971.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: Upgraded cake to 1.2.1.8004 and getting Undefined offset error in configure.php in every action
Just a dumb guess, but did you clear your app cache? On Feb 3, 1:17 pm, ieatfood ieatf...@gmail.com wrote: I just upgraded my system to use CakePHP 1.2.1.8004 from RC2, and I'm getting the following error even on actions with just a die(); command in them: Notice (8): Undefined offset: 0 [/home/rmsc/rmsc/cake/cake/libs/ configure.php, line 1185] __destruct - [internal], line ?? app::__destruct() - /home/rmsc/rmsc/cake/cake/libs/configure.php, line 1185 [main] - [internal], line ?? Context: $this = app app::$_log = NULL app::$search = array app::$return = false app::$__cache = true app::$__map = array app::$__paths = array app::$__loaded = array $core = array() Line 1185 in configure.php is: unset($this-__paths[rtrim($core[0], DS)]); I just noticed that these two more are also coming up all the time: Warning: mkdir(../cake) [function.mkdir]: Permission denied in /home/ rmsc/rmsc/cake/cake/libs/folder.php on line 465 Fatal error: Undefined class name 'i18n' in /home/rmsc/rmsc/cake/cake/ basics.php on line 605 These are all core functions, and I don't make any explicit use of any of these these in my app. Can someone help me out? I really want to be able to use the new cake releases and some of the new classes (like Xml). Thank you in advance, Kuba --~--~-~--~~~---~--~~ 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 pagination inside elements
Xoubaman, use var $helpers = array(..., 'Paginator'); in your AppController. make sure you fetch your data by using $this-paginate() in your controller to avoid the undefined indexes you're getting. Don't use renderElement() it has been deprecated, use element() instead. Hope that will set you on the right track. On Feb 2, 6:16 pm, Xoubaman xouba...@gmail.com wrote: I've discovered the view method renderElement, that has a parameter called loadHelpers, false but default, that looked good. But it doesn't work. The paginator helper isn't loaded and I'm getting the same odd undefined indexes notices. The renderElement method isn't properly explained neither in the doc or the api, so I don't know if it's useful, deprecated or whatever. If i can't use the paginator inside an element, I think is far away from the shining proclamed in the doc :( On Jan 30, 11:54 am, Xoubaman xouba...@gmail.com wrote: Some progress: adding thepaginatorhelper to the helpers array avoid the call to a memeber function in a non-object, but thepaginator doesn't paginate anything. In each helper call an undefined index error is shown. Notice (8): Undefined index: pageCount [CORE\cake\libs\view\helpers \paginator.php, line 476] Notice (8): Undefined index: count [CORE\cake\libs\view\helpers \paginator.php, line 416] ... Any idea? Note that thepaginatorhelper must be added to the items controller, not the item_comments controller. On Jan 30, 1:10 am, dr. Hannibal Lecter lecter...@gmail.com wrote: This is just a wild guess, but perhaps it is not applied when you're using requestAction()? It is (if I understand correctly) a separate request as far as cake is concerned. Try adding thepaginatormanually in your controller, and if that doesn't work maybe someone else will offer more help. On Jan 29, 10:06 pm, Xoubaman xouba...@gmail.com wrote: I edited some code to make it more readable in the group, looks like that is a misstip. The requestAction works fine, in fact if I comment all $paginatormentions the foreach shows the expected results. The doc reads that setting var $paginate and using the method paginate () automatically adds the PaginationHelper. On Jan 29, 8:50 pm, dr. Hannibal Lecter lecter...@gmail.com wrote: Well, maybe you didn't include the PaginatorHelper in your app. Other thing which seems odd to me is that your controller is ItemsComments, but in yourelementyou're calling $this-requestAction('items/get_comments/'.$id). Is 'items/get_comments/' properly mapped to ItemsComments::index()? On Jan 29, 7:22 pm, Xoubaman xouba...@gmail.com wrote: I'm trying to code anelementthat shows the comments about a certain item, but when I'm using thepaginatorhelper i get a Fatal error: Call to a member function numbers() on a non-object in[...] message. Searching the group i found that some users had the same problem, but never received a valid answer, so... let's try again. The code: CONTROLLER: class ItemsCommentsController extends AppController { function index($id = null) { if (!$id) { $this-Session-setFlash(__('Invalid Item.', true)); $this-redirect(array('action'='index')); } $comments = $this-paginate('ItemComment', array ('ItemComment.item_id =' = $id)); if(isset($this-params['requested'])) { return $comments;} $this-set('comments', $comments); } } VIEW: echo $this-element('item_comments',array('id'=$item['Item']['id'])); ELEMENT: ?php $comments = $this-requestAction('items/get_comments/'.$id); ? ?php echo $paginator-numbers(); ? echo $paginator-prev('« Previous ', null, null, array('class' = 'disabled')); echo $paginator-next(' Next »', null, null, array('class' = 'disabled')); foreach ($comments as $comment){ echo 'br /User: '.$comment['User']['username']).'br /'; echo $comment['ItemComment']['content'].'br /'; } ? --~--~-~--~~~---~--~~ 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 pagination inside elements
Well, maybe you didn't include the PaginatorHelper in your app. Other thing which seems odd to me is that your controller is ItemsComments, but in your element you're calling $this- requestAction('items/get_comments/'.$id). Is 'items/get_comments/' properly mapped to ItemsComments::index()? On Jan 29, 7:22 pm, Xoubaman xouba...@gmail.com wrote: I'm trying to code an element that shows the comments about a certain item, but when I'm using the paginator helper i get a Fatal error: Call to a member function numbers() on a non-object in[...] message. Searching the group i found that some users had the same problem, but never received a valid answer, so... let's try again. The code: CONTROLLER: class ItemsCommentsController extends AppController { function index($id = null) { if (!$id) { $this-Session-setFlash(__('Invalid Item.', true)); $this-redirect(array('action'='index')); } $comments = $this-paginate('ItemComment', array ('ItemComment.item_id =' = $id)); if(isset($this-params['requested'])) { return $comments;} $this-set('comments', $comments); } } VIEW: echo $this-element('item_comments',array('id'=$item['Item']['id'])); ELEMENT: ?php $comments = $this-requestAction('items/get_comments/'.$id); ? ?php echo $paginator-numbers(); ? echo $paginator-prev('« Previous ', null, null, array('class' = 'disabled')); echo $paginator-next(' Next »', null, null, array('class' = 'disabled')); foreach ($comments as $comment){ echo 'br /User: '.$comment['User']['username']).'br /'; echo $comment['ItemComment']['content'].'br /'; } ? --~--~-~--~~~---~--~~ 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 pagination inside elements
This is just a wild guess, but perhaps it is not applied when you're using requestAction()? It is (if I understand correctly) a separate request as far as cake is concerned. Try adding the paginator manually in your controller, and if that doesn't work maybe someone else will offer more help. On Jan 29, 10:06 pm, Xoubaman xouba...@gmail.com wrote: I edited some code to make it more readable in the group, looks like that is a misstip. The requestAction works fine, in fact if I comment all $paginator mentions the foreach shows the expected results. The doc reads that setting var $paginate and using the method paginate () automatically adds the PaginationHelper. On Jan 29, 8:50 pm, dr. Hannibal Lecter lecter...@gmail.com wrote: Well, maybe you didn't include the PaginatorHelper in your app. Other thing which seems odd to me is that your controller is ItemsComments, but in your element you're calling $this-requestAction('items/get_comments/'.$id). Is 'items/get_comments/' properly mapped to ItemsComments::index()? On Jan 29, 7:22 pm, Xoubaman xouba...@gmail.com wrote: I'm trying to code an element that shows the comments about a certain item, but when I'm using the paginator helper i get a Fatal error: Call to a member function numbers() on a non-object in[...] message. Searching the group i found that some users had the same problem, but never received a valid answer, so... let's try again. The code: CONTROLLER: class ItemsCommentsController extends AppController { function index($id = null) { if (!$id) { $this-Session-setFlash(__('Invalid Item.', true)); $this-redirect(array('action'='index')); } $comments = $this-paginate('ItemComment', array ('ItemComment.item_id =' = $id)); if(isset($this-params['requested'])) { return $comments;} $this-set('comments', $comments); } } VIEW: echo $this-element('item_comments',array('id'=$item['Item']['id'])); ELEMENT: ?php $comments = $this-requestAction('items/get_comments/'.$id); ? ?php echo $paginator-numbers(); ? echo $paginator-prev('« Previous ', null, null, array('class' = 'disabled')); echo $paginator-next(' Next »', null, null, array('class' = 'disabled')); foreach ($comments as $comment){ echo 'br /User: '.$comment['User']['username']).'br /'; echo $comment['ItemComment']['content'].'br /'; } ? --~--~-~--~~~---~--~~ 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: plugins, SWFs and dispatcher
Yeah, that seems like a very good idea, thanks for the tip ;) On Jan 22, 9:08 pm, snowdog zwo...@gmail.com wrote: I had the same problem in my mediaplayer plugin and solved it by using mediaView to serve flash (.swf) files from webroot. It works. --~--~-~--~~~---~--~~ 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: Encoding problem with helpers
1. Make sure everything in your database is utf8 (or other encoding needed). 2. Make sure you're connecting to your database with utf8[1]. 3. Make sure your pages are served in utf8. [1] http://groups.google.com/group/cake-php/browse_thread/thread/dcdbcc085dcd09a0 Hope that helps! On Jan 22, 11:04 pm, ABY bno...@gmail.com wrote: hi, i am currently developing an application with CakePHP, but i have a serious problem with encoding. my database records are in Turkish. when i view a record, there is no problem and i can view Turkish characters. but when i try to edit a record, all fields that contain at least a Turkish character are just empty. for example when i set a new variable like $var = $this-data in the controller, in edit.ctp i can display the $var correctly (by pr() command), but the edit form that i create using $form helper does not display the fields with Turkish characters. i have the same problem with $html helper. for example; echo $post['title'] displays çağrı,but $html-link($post['title'], '/posts') displays nothing.. can somebody help me with that problem please. i have been trying to fix it for hours by changing database encodings, but it didin't work out.. 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: To pull a .ctp page in the divison of other .ctp page with or without controller
I think the thing you're looking for is called element. http://book.cakephp.org/view/97/Elements Helps? On Jan 23, 1:11 pm, boNty bontywo...@gmail.com wrote: I have a page in articles folder ie. articles/home.ctp and i want to display this home.ctp page in the divison contained by a page in folder users ie.users/home.ctp. Can any one help me out --~--~-~--~~~---~--~~ 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: Set::extract() with threaded and associated data
I am very unsure about this, but I believe you might be looking for Set::classicExtract() http://api.cakephp.org/class_set.html#e8412492e8a6c81939b4fb037043eaa3 Hope that helps! On Jan 23, 1:42 pm, Jon Bennett jmbenn...@gmail.com wrote: hi, I'm sure this is possible, it's just alluding me at present! I have 2 models: MixtureCategory Mixture MixtureCategory is a parent/child self association, so I'm getting the data like so: $this-data = $this-MixtureCategory-find('threaded'); I'm looping over $this-data in my view, but only need to display info about the top level category, and would like to output list of links to all mixtures that belong to a second level category. foreach($this-data as $category): // name echo $category['MixtureCategory']['name']; // mixtures $mixtures = array_combine( Set::extract($category, 'children.{n}.MixtureCategory.{s}.Mixture.name'), Set::extract($category, 'children.{n}.MixtureCategory.{s}.Mixture.slug') ); // test debug($mixtures); endforeach; this gives me total garbage though. any ideas? cheers, Jon -- jon bennett w:http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~~---~--~~ 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: The best way to use named parameters as search conditions for pagination?
You're going in the right direction. Your function will only use the conditions for fields in your table. It doesn't really matter if your user specifies additional conditions because they will be ignored. I haven't tried it, but I assume you could always make a whitelist of allowed params and unset everything else. Just don't forget to sanitize them.. :-) On Jan 21, 3:20 pm, die...@be dieterplaeti...@gmail.com wrote: Hi all, I want to use pagination, but also named parameters to form conditions to restrict my resultset. Example: Customer hasmany contract, contract belongsTo Customer (foreign key customer_id) I want to be able to paginate contracts, but also only view (paginated) the contracts of a certain customer. Url's would be something like this: /contracts/index/customer_id: 1 # only look for records where customer_id = 1 /contracts/index/page:1/sort:customer_id/ direction:asc/ # some paginated view /contracts/index/page:1/sort:customer_id/direction:asc/customer_id:1 # pagination + search condititon combined My first idea: since $this-passedArgs is an array of key-value pairs of the named parameters, I can directly use it to specify the conditions, like so: $this-set('contracts', $this-paginate('Contract',$this-passedArgs)); The problem with this is that the user can pass any parameter he want, thus forming invalid queries. In fact the parameters from the paginator end up in my conditions also and make the query invalid. So.. I should filter the $this-passedArgs to only use the entries that match a column of my model, right? So I came up with this:http://bin.cakephp.org/view/737267546 This is better, but still the user can specify any value. Is there any way to validate the arguments before using them as conditions? Or am I just looking to far, is there a more elegant way to handle this? Thanks, Dieter --~--~-~--~~~---~--~~ 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: TinyMCE inside vendor folder
On Jan 20, 10:08 am, eXistent pirkl.lu...@gmail.com wrote: Hi, when TinyMCE is placed inside webroot/js folder, everything works fine. But when i place it inside vendor folder (more apps can use it) TinyMCE run and display their window in place of textarea, but icons don't load. When mouse move over button, button highlight but still dont display icon. Is there some way how to put TinyMCE into vendor folder with 100% functionality? Thanks for tips --~--~-~--~~~---~--~~ 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: TinyMCE inside vendor folder
Erouch...sorry for the wrong click there earlier... I think problem lies within the dispatcher in the _cached()[1] TinyMCE is probably using an unsupported mime type/extension[2]. I'm having the same problem with SWFs in my plugin[3], and no solution in sight. [1] https://trac.cakephp.org/browser/branches/1.2.x.x/cake/dispatcher.php#L611 [2] https://trac.cakephp.org/browser/branches/1.2.x.x/cake/dispatcher.php#L621 [3] http://groups.google.com/group/cake-php/browse_thread/thread/970c7783f92fb115?hl=xx-bork Again, I apologize for spamming with the previous um...misclickage. On Jan 20, 10:08 am, eXistent pirkl.lu...@gmail.com wrote: Hi, when TinyMCE is placed inside webroot/js folder, everything works fine. But when i place it inside vendor folder (more apps can use it) TinyMCE run and display their window in place of textarea, but icons don't load. When mouse move over button, button highlight but still dont display icon. Is there some way how to put TinyMCE into vendor folder with 100% functionality? Thanks for tips --~--~-~--~~~---~--~~ 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: TinyMCE inside vendor folder
Changing cake is always a bad idea. I'm still hoping for a real solution. Until then, my code will go through a process called hackiddy hack.. On Jan 20, 5:56 pm, eXistent pirkl.lu...@gmail.com wrote: I found where the problem is. The directory where the images are, is js/tiny_mce/themes/simple/img/icons.gif. And directory img/ makes this little error. I try change two lines with strpos($url, 'img/') within the dispatcher in the _cached() changed to strpos($url, 'imgs/') and now it works fine. But it is not the greatest solution i think. On 20 Led, 17:33, dr. Hannibal Lecter lecter...@gmail.com wrote: Erouch...sorry for the wrong click there earlier... I think problem lies within the dispatcher in the _cached()[1] TinyMCE is probably using an unsupported mime type/extension[2]. I'm having the same problem with SWFs in my plugin[3], and no solution in sight. [1]https://trac.cakephp.org/browser/branches/1.2.x.x/cake/dispatcher.php... [2]https://trac.cakephp.org/browser/branches/1.2.x.x/cake/dispatcher.php... [3]http://groups.google.com/group/cake-php/browse_thread/thread/970c7783... Again, I apologize for spamming with the previous um...misclickage. On Jan 20, 10:08 am, eXistent pirkl.lu...@gmail.com wrote: Hi, when TinyMCE is placed inside webroot/js folder, everything works fine. But when i place it inside vendor folder (more apps can use it) TinyMCE run and display their window in place of textarea, but icons don't load. When mouse move over button, button highlight but still dont display icon. Is there some way how to put TinyMCE into vendor folder with 100% functionality? Thanks for tips --~--~-~--~~~---~--~~ 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, auth and security components
That's a bit broad question, don't you think? Did you go through the manual? http://book.cakephp.org/ Did you use the other manual? http://www.google.com/search?q=cakephp+acl+auth On Jan 20, 10:46 pm, Delirium tremens pedbe...@gmail.com wrote: How do they relate to each other? --~--~-~--~~~---~--~~ 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: Rendering an add form within another controller's view (with all automagicness)
It is very difficult to see what the problem is without the code. Also, it would be the best if you can avoid the requestAction :-) On Jan 15, 10:19 am, jwerd lamerh...@gmail.com wrote: Hello fellow bakers, I've searched this group before I was going to post this question but I cant' seem to find my current dilema addressed yet. I have two controllers, which serve different purposes, but for the sake of this example, they share some things in common : shows_controller is used to pretty much the shows in the system show_attendees_controller is used to capture the attendees of any given show On the view /shows/view/# page I need to include the add form of show_attendees/add/ but what's happening is, it's not doing all the automagicness, and it's creating weird drop down menus that don't really capture the same format they do if I was directly accessing them from /show_attendees/add/. Also, I'm using requestAction, just so everyone knows. Any help is much appreciated. --~--~-~--~~~---~--~~ 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: Bakery Article Comment Notification broken
I have reported this a while ago: https://trac.cakephp.org/ticket/5001 Still having the same problem. On Jan 15, 8:32 am, majna majna...@gmail.com wrote: I cant open mail notification in gmail. content type is multipart/alternative, message is attached as unknown file. --~--~-~--~~~---~--~~ 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 well I can use CakePHP for building static site ?
Hi Sridhar, Of course you can use CakePHP to build a static site. Search for articles regarding PagesController, a built-in controller which enables you to do just that - show static pages. Your header, side navigation etc are handled with view layouts. Hope that helps a bit. Welcome to cake world, keep learning it, it's worth it. ;) Cheers! On Jan 12, 3:33 pm, Sridhar Kuppalli sridhar.kuppa...@gmail.com wrote: Hi All, I am new to cakePHP, but really impressed with the blog example and tried similar other example also. Now I want to design a static website, with less dynamic functionality, (3 to 4 through out the site). But it has common modules, like header, side navigation etc. Can I use cakePHP to implement this. Any tutorial or material for this? Thanks Regards Sridhar Kuppalli --~--~-~--~~~---~--~~ 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: the Gift of 1.2 Final
I may be a bit late with this, but... Congratulations to everyone on this fine release, I'm sure your efforts will be acknowledged among the PHP developers. This will surely confirm that CakePHP is *the* framework for PHP. Let them eat cake! On Dec 26, 1:51 am, Gwoo gwoo.cake...@gmail.com wrote: //Warning: this message is long and full of goodies. History does not happen, it is made. Today, the history of the CakePHP grows stronger. December 25, 2008 will be remembered as one of the most important points in this history. After exactly 2 yrs from the first development release, we can happily say we have the most stable and powerful web framework available. Please enjoy our big present to you, CakePHP 1.2 stable [1]. For this release, we have removed the test files from the build, and created a tag in SVN. Through the last two years, we have been blessed by a dedicated, talented, and opinionated community[2]. We have shared disagreements [3] and triumphs. We have won popularity contests[4] and been hated on. We have seen CakePHP grow into a truly international community[5]. All of these events have generated an immense amount of passion for CakePHP. No one is more passionate about CakePHP than the developers[6] who close tickets and fix bugs. We started out two years ago with a small team that dedicated countless hours to implementing new features into 1.2 and maintaining 1.1 stable. This team ensured the integrity of code and vision of the project. When we needed to grow, we found members of the community who showed the same amount of dedication and passion for CakePHP. And with the launch of CakeBOOK, onhttp://book.cakephp.org, we have seen the dedication and passion further extend to all the contributors and translators[7] of the fantastic documentation that makes learning about the power of CakePHP a bit easier. We have seen CakePHP adopted by large projects[8] and the growth of dedicated service companies[9]. We have held a workshop[10] to spread the knowledge and passion of CakePHP. And ultimately, we implemented a huge list of features... - Tests! - All classes are test-covered, with good code coverage - Test suite now integrated into the framework - test generation - support for coverage analysis - Command-line infrastructure - with more shell scripts and ability to write custom ones easily - Plugin architecture - Plugins are now distributable as packaged collections of files - Can be loaded from your main app with a dot syntax - Internationalization and Localization support - i18n and l10n classes - Support for unicode strings - Auth component - automatically handles sessions for authenticated users - ties into ACL for automatic denial of protected content or actions - Email component - for generation of text and html email - Security component - HTTP auth support, great for web services - CSRF protection - Cookie component - for secure cookie handling - Custom model finders - simplified syntax - powerful and extensible - Join models - for modeling and accessing HABTM join tables - Behaviors, new way to extend models - Supports mixing in new functionality - Containable behavior - simplified query optimization - Validation system extended - with new Validation class, lots of rules - multiple rules and messages - Database drivers - support for many more databases including DB2 and Oracle - Caching - Adapter-driven caching, with support for APC/XCache/Memcache - Set class, - for magical array hacking - Socket and HttpSocket classes - for dealing with remote data and services - Debugger class, for detailed introspection of errors - Get stack traces anywhere in your code - Introspected help on errors, with context information - Pagination - one of the first additions to the new version - one of the simplest systems known - Proper Routing - mapResources() method for exposing controllers via REST - Reverse routing support - Named arguments - Magic variables for common regexes - Support for file extensions with custom content type mappings - View stuff - Separate templates for different content types - automatic switching with RequestHandler
Re: A table with average total row
Depends. If you can do it in DB without performance loss, that's the best way. If not, view is good enough. I tend to do as much as possible in the database, because the damn thing is optimized to work with (large) sets of data. But in the end, if that's not an option for you, whatever gets the job done... :-) On Dec 23, 6:31 pm, mathie trung...@gmail.com wrote: Hello, This is a design question on MVC separation. Say I need to display a table with many rows, then a total and an average row. Should the calculation of this total/average be done in the view (in the loop) or in the controller (after getting the rows from DB)? A related question. For an invoice: $amount = $price * $quantity; Could that be in the view or not? Basically I guess my question: what is considered view logic? 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: Getting related data
You should probably change this: $this-set('ingredient_list', $this-IngredientList-find('WHERE recipe_id = ' . $id)); to something like this: $this-set('ingredient_list', $this-IngredientList-find('all', array ('recipe_id' = $id)); And then see what happens. Also, I don't see where are you using $ingredient_list in your view? On Dec 24, 1:31 pm, rhythmicde...@gmail.com rhythmicde...@gmail.com wrote: I have recipes and I have ingredient_lists. A single recipe has many entries in the ingredient_lists table. When I pull back the recipe I want to get it's ingredient_list but I cant see quite how to do it. This is the 'edit' action of the RecipesController: function edit($id = null) { $this-Recipe-id = $id; $this-set_recipe_types(); $this-set_ingredients(); $this-set_measurement_types(); $this-set('ingredient_list', $this-IngredientList-find('WHERE recipe_id = ' . $id)); if (empty($this-data)) { $this-data = $this-Recipe-read(); } else { if ($this-Recipe-save($this-data)) { $this-flash('Your recipe has been updated.','/recipes'); } } } The line that sets the 'ingredient_list' var only pulls back a single record because of the limit clause. How do I pull back all the records? Here is the query for ingredient_list SELECT `IngredientList`.`recipe_id`, `IngredientList`.`ingredient_id`, `IngredientList`.`amount`, `IngredientList`.`measurement_type_id`, `IngredientList`.`description`, `IngredientList`.`created`, `IngredientList`.`modified` FROM `ingredient_lists` AS `IngredientList` WHERE recipe_id = 17 LIMIT 1 Here are all the queries run for the edit page:' DESCRIBE `recipes` DESCRIBE `recipe_types` DESCRIBE `ingredients` DESCRIBE `measurement_types` DESCRIBE `ingredient_lists` SELECT `RecipeType`.`id`, `RecipeType`.`recipe_type` FROM `recipe_types` AS `RecipeType` WHERE 1 = 1 ORDER BY `RecipeType`.`recipe_type` ASC SELECT `Ingredient`.`id`, `Ingredient`.`ingredient` FROM `ingredients` AS `Ingredient` WHERE 1 = 1 ORDER BY `ingredient` ASC SELECT `MeasurementType`.`id`, `MeasurementType`.`measurement_type` FROM `measurement_types` AS `MeasurementType` WHERE 1 = 1 ORDER BY `measurement_type` ASC SELECT `IngredientList`.`recipe_id`, `IngredientList`.`ingredient_id`, `IngredientList`.`amount`, `IngredientList`.`measurement_type_id`, `IngredientList`.`description`, `IngredientList`.`created`, `IngredientList`.`modified` FROM `ingredient_lists` AS `IngredientList` WHERE recipe_id = 17 LIMIT 1 SELECT `Recipe`.`id`, `Recipe`.`recipe`, `Recipe`.`description`, `Recipe`.`instructions`, `Recipe`.`servings`, `Recipe`.`recipe_type_id`, `Recipe`.`created`, `Recipe`.`modified` FROM `recipes` AS `Recipe` WHERE `Recipe`.`id` = '17' LIMIT 1 Here is the edit view h1Edit Recipe/h1 ?php echo $form-create('Recipe', array('action' = 'edit')); echo $form-input('Recipe.recipe'); echo $form-input('Recipe.servings', array('maxlength' = 5, 'size' = 5)); echo $form-label('Recipe.servings', 'Recipe Type'); echo $form-select('Recipe.recipe_type_id', $recipe_types); ? div h2Ingredient List/h2 table tr td?php echo $form-input('IngredientList.amount'); ?/td td?php echo $form-label('IngredientList.measurement_type_id', 'Measurement Type'); echo $form-select('IngredientList.measurement_type_id', $measurement_types); ?/td td?php echo $form-input('IngredientList.description'); ?/td td?php echo $form-label('IngredientList.ingredient_id', 'Ingredient'); echo $form-select('IngredientList.ingredient_id', $ingredients); ?/td /tr /table h2Instructions and Description/h2 ?php echo $form-input('Recipe.description', array('rows' = '3')); echo $form-input('Recipe.instructions', array('rows' = '3')); echo $form-end('Save Recipe'); ? 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: Find Topic with highest number of Comments
I have used this bit of code in my model..It's probably not the best way, but it works for me: function getMostCommented($limit) { $commentsCount = $this-Comment-find ( 'all', array ( 'fields' = array('article_id', 'count(*) as count'), 'conditions' = '1 = 1 GROUP BY article_id', 'order' = 'count DESC', 'recursive' = -1, 'limit' = $limit ) ); $articles = array(); foreach ($commentsCount as $comment) { $articles = array_merge ( $articles, $this-find ( 'all', array ( 'conditions' = array('id' = $comment['Comment'] ['article_id']), 'fields' = array ( 'id', 'title', 'slug' ), 'recursive' = -1 ) ) ); } return $articles; } This would return the top $limit article with most comments. On Dec 24, 2:14 pm, Fahad faha...@gmail.com wrote: hi, i am developing a forum application in cakephp. and need to find a list of 5 popular topics (threads). popularity is based on the number of Comment each Topic has. is it possible to find popular Topics using cake models only? or do I have to use custom SQL query for this? 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: plugins, SWFs and dispatcher
Seriously, anyone? Are plugins limited to certain asset types on purpose? On Dec 18, 10:35 am, dr. Hannibal Lecter lecter...@gmail.com wrote: Hi all, I'm creating a plugin which needs .swf files in vendors folder, and it seems impossible to make it work. I've managed to trace the problem to Dispatcher::cached() where only certain content types are marked as assets ('text/javascript', 'text/css', 'image/gif', 'image/jpeg', 'image/png'), which somewhat repeats the MediaView issue. Now, I can work around this problem by moving my flash files to the app/webroot/img or similar, but that kind-of ruins the concept of plugins. Is this a ticket material or should I just roll over and die? 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 -~--~~~~--~~--~--~---
plugins, SWFs and dispatcher
Hi all, I'm creating a plugin which needs .swf files in vendors folder, and it seems impossible to make it work. I've managed to trace the problem to Dispatcher::cached() where only certain content types are marked as assets ('text/javascript', 'text/css', 'image/gif', 'image/jpeg', 'image/png'), which somewhat repeats the MediaView issue. Now, I can work around this problem by moving my flash files to the app/webroot/img or similar, but that kind-of ruins the concept of plugins. Is this a ticket material or should I just roll over and die? 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: Association not producing dropdown list, help! :(
I'm just guessing here, but I assume your table should be called store_tables (plural). Of course I might be completely wrong if your StoreTable model is working as expected..? On Dec 12, 6:17 pm, _Z zmcar...@gmail.com wrote: Hello, I am expecting a dropdown box in my /add action, but only a textbox is produced. Another field is associated and configured the same way, and I get a dropdown box. Details: The association is setup so that 'store_table' belongsTo 'Waitlist'. In the /add.ctp , echo $form-input('highchair_number'); echo $form-input('store_zone_id'); //echo $form-input('comments'); //echo $form-input('est_wait_min'); ... echo $form-input('store_table_id'); The store_zone is associated 'store_zone' belongsTo Waitlist, and I get a dropdown. However, I do not get any dropdown for store_table_id. Both foreign keys are present in the Waitlist table. I'm really stuck on this one, any guidance is appreciated! Thanks! _Zach --~--~-~--~~~---~--~~ 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: Tip: FormHelper can create field names like Model[][field]
Sweet! Thanks for sharing this, it should probably be added to the official manual or something.. On Dec 8, 2:14 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, This is just a small thing but I did not find a mention of it in the manual. I found this out today, after a few years of using Cake :) I want a form input to have the name Modelname[][fieldname] so that I can post an array of fieldname values. The manual only mentions creating these hard coded as Modelname.0.fieldname = Modelname[0] [fieldname] and then incrementing the number. The reason I like the empty version is that is makes for a lot simpler javascript when I want to create these additional fields on the fly in the GUI and don't know how many I will need at the time of rendering the form on the server. Then I tried this (half by accident): $form-input('Modelname. .fieldname'); // notice the space between the dots Voila! The form has the empty space in the field name but Cake creates the array of values just the way Iike it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to add line break in text mail layout?
What about simply hitting the enter key? :) On Dec 5, 12:14 pm, Hipnotik [EMAIL PROTECTED] wrote: How to add line break in text mail layout? It's in elements/email/text/default.ctp file. I tried to use: \n \r\n \r and still it doesn't work correct. It breaks the lines but new line character (i.e. \n) appears in the received message too. How to do that? Thanks for 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: checkbox issue
Something like this should do it: echo $form-input('Model.Field', array('type' = 'select', 'multiple' = 'checkbox', 'options' = $anArrayOfOptions)); Hope that helps! On Dec 4, 7:40 pm, gayatri [EMAIL PROTECTED] wrote: i not able to get the value of multiple checkboxes can any help me in this issue. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: What is wrong with this line of code?
Hi adam, your $question array does not contain anything called Answer. If you print out the array (as Anja suggested), you will see that for yourself. Quite possibly, if your $question array is a result of a query in CakePHP, your results will be ordered as $question[0]['Answer'], $question[1]['Answer'], etc.. Assuming that your array contains only answers, you should get a proper count by calling count($question); Hope that helps! On Dec 4, 10:40 pm, adam [EMAIL PROTECTED] wrote: $answer_count = count($question['Answer']); I am trying to start learning cakePHP using the book CakePHP Application Development. I keep getting this error though that points to this line: Undefined index: Answer [APP\views\questions\home.ctp, line 10] In home.ctp, I need to display the number of Answer posts. Similar to Comments for blog posts, but this is Answers for question posts. Example in the book...but anyways. What is wrong? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How to add line break in text mail layout?
Well...that's not supposed to happen. Can you check the mail source and mime headers? Maybe you're not sending your email in plain text..? On Dec 5, 1:11 pm, Hipnotik [EMAIL PROTECTED] wrote: On 5 Gru, 12:35, dr. Hannibal Lecter [EMAIL PROTECTED] wrote: What about simply hitting the enter key? :) Doesn't work... displays all lines in one :( On Dec 5, 12:14 pm, Hipnotik [EMAIL PROTECTED] wrote: How to add line break in text mail layout? It's in elements/email/text/default.ctp file. I tried to use: \n \r\n \r and still it doesn't work correct. It breaks the lines but new line character (i.e. \n) appears in the received message too. How to do that? Thanks for 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: API documentation tool
I'm not sure on this, but I believe it could be phpDocumentor (http:// phpdoc.org/)? On Dec 5, 1:03 pm, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: Hi What is used to generate the API doc of cakephp ? thanks Olivier --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: API documentation tool
Good point... probably Doxygen then..seems like it (look at the examples on Doxygen site, especially the tabs).. On Dec 5, 2:14 pm, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: But it looks visually so different to what I know from phpDocumentor. No left column, etc... On Fri, Dec 5, 2008 at 1:47 PM, dr. Hannibal Lecter [EMAIL PROTECTED]wrote: I'm not sure on this, but I believe it could be phpDocumentor (http:// phpdoc.org/)? On Dec 5, 1:03 pm, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: Hi What is used to generate the API doc of cakephp ? thanks Olivier --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---