Re: Best way to accomplish acl for database records owned by a user

2009-09-24 Thread rOger
Thanks for your answers!! @brian: It looks rather complex to accomplish such a "easy" task so I think there must be an easier way to get the same result... @Rick: Your solution is the one I used before but I thought that there must be a solution that is integrated into the ACO/ACL concept... It

Re: Trouble with installation

2009-09-24 Thread Cristian Cassina
Nigel, could it be a permission related issue? Did you check file and folders permissions of this new Cake installation? Regards Cristian Nigel ha scritto: > I use Ubuntu 9.04 and I installed apache, mysql, and php5. I did the > blog tutorial successfully with everything working. After that

Re: Doubt in cake php

2009-09-24 Thread John Andersen
Look into the controllers method "requestAction", which allows you to retrieve the list of clubs in a view! Enjoy, John On Sep 24, 11:59 am, hunny wrote: > Hi Guys, > > I am new to cakephp. I am having the following issue: > > I am displaying list of checkbox containing clubs to a login user.

Re: How can I build a navigation menu in cakephp?

2009-09-24 Thread Barney
thanks, what's caching result? can you give me more tips please On Sep 24, 8:33 pm, brian wrote: > Remove the single quotes. $category['Category']['name'] is already a > string so you don't need them. What you'd done is passed the literal > string, '$category['Category']['name']'. > > As for c

Re: How can I build a navigation menu in cakephp?

2009-09-24 Thread brian
Remove the single quotes. $category['Category']['name'] is already a string so you don't need them. What you'd done is passed the literal string, '$category['Category']['name']'. As for creating a menu, once you have something working, you might want to look at caching the result so you're not hi

Re: changing $session->flash('auth'); layout

2009-09-24 Thread brian
Gotcha. Auth uses 'default' layout when calling $this->Session->setFlash(). Have a look at SessionHelper::flash() to see how it handles that. http://api.cakephp.org/view_source/session-helper/#line-129 In any case, if you want to style/move it/whatever, create a CSS rule for the #authMessage sel

Re: Private Messaging mysql

2009-09-24 Thread brian
Ah, I thought the "(inbox, sent, trash)" referred to an enum. On Thu, Sep 24, 2009 at 8:31 PM, Miles J wrote: > > Nah it wouldn't require enum fields, you just give a static int value > to all the folder/status types. > > But yes, would be better to maybe do a "messages_body" table if you > want

How can I build a navigation menu in cakephp?

2009-09-24 Thread Barney
first, I am very new to cakephp. I have 2 tables "categories" and "products" I want to make a menu like category->product tree in the view, i use those code to display the categories: But if I want to add links to these categories how can I use $html->link to achieve it? $html->li

Re: changing $session->flash('auth'); layout

2009-09-24 Thread adam
Sorry. When calling $session->flash('auth'); in my layout, it outputs the message like this: MESSAGE HERE I would like it to be whatever I want it to be. When calling $this- >setFlash(), the second or third parameter allows you to set the flash layout. And then $session->flash(); will output

Re: Private Messaging mysql

2009-09-24 Thread Miles J
Nah it wouldn't require enum fields, you just give a static int value to all the folder/status types. But yes, would be better to maybe do a "messages_body" table if you want to send to multiple users. On Sep 24, 5:24 pm, brian wrote: > Ugh! That relies upon enum columns, for one thing. But it

Re: Redirect After Using render('action')

2009-09-24 Thread brian
Whether Cake spits out a CSV file or redirects to another controller/action, headers need to be sent to the client, but you can't send headers for both simultaneously. If you really want the form to disappear, use JS to submit the form using AJAX and hide/change certain elements of the page. On

Re: Private Messaging mysql

2009-09-24 Thread brian
Ugh! That relies upon enum columns, for one thing. But it also makes it more than a bit awkward to send a msg to more than one user. DB tables are cheap. Plan for the future. On Thu, Sep 24, 2009 at 3:20 PM, Miles J wrote: > > You dont need that many tables like brian suggested. All you need is

Re: Trouble with installation

2009-09-24 Thread brian
We could guess what "not displaying properly" means but that could go on for a while. On Thu, Sep 24, 2009 at 12:45 PM, Nigel wrote: > > I use Ubuntu 9.04 and I installed apache, mysql, and php5.  I did the > blog tutorial successfully with everything working.  After that I > deleted the folder

Re: Translate field names

2009-09-24 Thread brian
__('field_name') http://book.cakephp.org/view/161/Internationalization-Localization On Thu, Sep 24, 2009 at 4:05 PM, emmexx wrote: > > I searched the bakery and here but couldn't find an answer. > > I'd like to translate all field names in a simple way. > The Translate behaviour is useful to tr

Re: changing $session->flash('auth'); layout

2009-09-24 Thread brian
I read that 3 times and still have no idea what you want to do. On Thu, Sep 24, 2009 at 2:37 PM, adam wrote: > > i am implementing a layout and am sad that i can not change the auth > flash layout, instead i am having to use session->check(), then > session->read(), and then to remove the messag

Including non-plugin element from within plugin

2009-09-24 Thread michaelc
I'm experiencing an interesting problem wherein I include from within a view in a plugin an element which contains a form (the users login form, that is). However, I can't seem to see a way free to not having it prepend the plugin name onto the action. The offending code is line 156 of form.php,

MAMP + CakePHP issues

2009-09-24 Thread fahd
Hey fellow Cakers, I've been developing on CakePHP for a bit and decided to have a localhost version on MAMP so that I could demo my app to people without being dependent on an Internet connection. Ran into a few issues ofcourse and hoping someone can give some insight: 1) I have several sites

Enumerating ACL settings

2009-09-24 Thread Stuart
What's the easiest way to enumerate the who has what ACL settings for a specific ACO entry? I have the appropriate aco_id but there doesn't appear to be an easy way to link this though the aros_acos table back to the aros? BTW: I'm reasonably new to Cake. --~--~-~--~~~---

Getting started with Ajax

2009-09-24 Thread Jürgen
Hi, I've just been getting started with Ajax and I've been able to set up a simple website using the pagesController that comes with cake. As for now I'm not yet using any databases. Today I started to try integrating some Ajax in my site. It's quite simple: I want to load the pages into the 'co

Re: No Listbox for HABTM Relationship using Scaffold

2009-09-24 Thread Choopong Choosamer
I have the same problem. I must downgrade it to 1.2.3. 1.2.5, 1.2.4, and 1.2.x.x nightly build also have the same problem. Cheers. On Sep 21, 7:59 am, josephusbrown wrote: > The issue appears to be with the current version of cakephp 1.2.5. I > went back to previous version and HABTM list box

Trouble with installation

2009-09-24 Thread Nigel
I use Ubuntu 9.04 and I installed apache, mysql, and php5. I did the blog tutorial successfully with everything working. After that I deleted the folder cake and installed it again for the next tutorial. I cleared the database. Now, the Cake page is not displaying properly as though there is so

Re: executing queries from a .sql file in the console

2009-09-24 Thread Jorge Horacio Cué Cantú
Hello, I had a similar problem. I have an Install controller that executes a SQL script in ordert to create the database. What I have done is somethjing similar to: uses('model'.DS.'connection_manager'); $db = ConnectionManager::getInstance(); $dataSource = $db->getDataSource('default'); // The

Re: Enterprise Level App using cakephp

2009-09-24 Thread gabrielr
Thanks for answer (Y) On 24 sep, 16:20, "Larry E. Masters aka PhpNut" wrote: > Serious though,http://book.cakephp.org/view/510/Sites-in-the-wild > -- > /** > * @author Larry E. Masters > * @var string $userName > * @param string $realName > * @returns string aka PhpNut > * @access  public > */ >

Re: How to send data from controller to controller?

2009-09-24 Thread LPaulino
I've found another way $this->setAction('action_name', array('key1' => 'value1', 'key2' => 'value2')) and... function action_name($info = null) { $info1 = $info['key1']; $info2 = $info['key2']; } Cya guys On Sep 24, 6:08 pm, LPaulino wrote: > I've just found it... func_get_args() > thx

Re: Enterprise Level App using cakephp

2009-09-24 Thread Larry E. Masters aka PhpNut
Serious though, http://book.cakephp.org/view/510/Sites-in-the-wild -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ On Thu, Sep 24, 2009 at 4:17 PM, Larry E. Masters aka PhpNut < php...@gmail.com> wrote: > Is an

Re: Enterprise Level App using cakephp

2009-09-24 Thread Larry E. Masters aka PhpNut
> > Is anybody use cakephp for developing an Enterprise Level > Application? Yes. > and What Kind of App was developed? > A big one. -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --~--~-~--~~

Re: Enterprise Level App using cakephp

2009-09-24 Thread gabrielr
someone for answer thoose questions On 24 sep, 10:03, gabrielr wrote: > Hi everybody, > First of all, congratulations for this Framework, it mak programmer's > life easier. > Well, I have 2 Questions to this group. > > Is anybody use cakephp for developing an Enterprise Level > Application?

Re: How to send data from controller to controller?

2009-09-24 Thread LPaulino
I've just found it... func_get_args() thx On Sep 24, 3:33 pm, LPaulino wrote: > Thx man. I found the method (setAction (action, [param, param, > param])) here:http://cakephp.org/files/Resources/CakePHP-1.2-Cheatsheet.pdf > > 1 last question: How can I can get those params in the other action? >

Translate field names

2009-09-24 Thread emmexx
I searched the bakery and here but couldn't find an answer. I'd like to translate all field names in a simple way. The Translate behaviour is useful to translate field values but I want to translate the field name, that is use another label for the name of one or more fields in a table. I can't

Re: Doubt in cake php

2009-09-24 Thread Martin Westin
Ever heard of a can of worms :) (The whole "-This is MVC. -No, this is MVC" thing can turn nasty at times.) Cake allows no direct access to Models from Views. That is how the MVC pattern has been implemented in Cake even though there are other interpretations in other Frameworks. If everyone had

Re: Doubt in cake php

2009-09-24 Thread Jon Bennett
Hi, > Basically i am looking for something similar like View Helpers in > Zend. We can access the model data in views using view Helpers. Is > there something similar in cakephp. Short answer: you can't. Longer answer: as the current version of cake is both php4 and 5 compatible, it uses arrays

Re: Redirect After Using render('action')

2009-09-24 Thread Miles J
I dont believe you have any control at all regarding "downloads". On Sep 24, 12:17 pm, Tony Thomas wrote: > I have a controller function that's using $this->render('action') to > render a view that creates a CSV file after submitting some info in a > form. > > What I want to do is redirect the u

Re: No Listbox for HABTM Relationship using Scaffold

2009-09-24 Thread mark_story
I don't have any issues with the habtm generation on either the git head of 1.2 or the 1.2.5 package. In fact there was an issue with habtm selectbox generation with 1.2.4 and earlier. See http://code.cakephp.org/cakephp/commits/view/2c9fd2a4 http://code.cakephp.org/tickets/view/48 -Mark On S

Re: Private Messaging mysql

2009-09-24 Thread Miles J
You dont need that many tables like brian suggested. All you need is two, users and messages. messages: - id - user_id (sender) - recipient_id (receiver) - subject - content - status (read, unread, etc) - userFolder (inbox, sent, trash) - recipientFolder (inbox, sent, trash) - created - modified

Redirect After Using render('action')

2009-09-24 Thread Tony Thomas
I have a controller function that's using $this->render('action') to render a view that creates a CSV file after submitting some info in a form. What I want to do is redirect the user after the CSV file is downloaded. So the steps would be: 1. User submits data. 2. Queries are run and a CSV file

Re: Private Messaging mysql

2009-09-24 Thread John Andersen
It is late (here in Latvia) and I am not sure that I remember correctly what I saw while playing around with saving HABTM associated data. If correctly, then providing the associated model as: $data[associatedModel][associatedModel] = array(); deletes all the associations between the main model

changing $session->flash('auth'); layout

2009-09-24 Thread adam
i am implementing a layout and am sad that i can not change the auth flash layout, instead i am having to use session->check(), then session->read(), and then to remove the message, session->flash() into an area of the layout where it will not be displayed. is there a way to chagne the flash layo

Re: How to send data from controller to controller?

2009-09-24 Thread LPaulino
Thx man. I found the method (setAction (action, [param, param, param])) here: http://cakephp.org/files/Resources/CakePHP-1.2-Cheatsheet.pdf 1 last question: How can I can get those params in the other action? Thx On Sep 24, 2:51 pm, brian wrote: > Use $this->setAction('action_name'), then. > >

Re: Problem viewing data...

2009-09-24 Thread brian
Put debug("id: ${id}") in your controller. Maybe it's not what you think it is. Do you have a route for this action? On Thu, Sep 24, 2009 at 1:38 PM, mig_akira wrote: > > > Ops, sorry, here's the code for views/users/view.ctp > [code] > > > >         >                > ?> >                > >

Re: How to send data from controller to controller?

2009-09-24 Thread brian
Use $this->setAction('action_name'), then. http://api.cakephp.org/class/controller#method-ControllersetAction On Thu, Sep 24, 2009 at 1:20 PM, LPaulino wrote: > > ups I said it wrong, I mean from action to action > > On 24 set, 13:56, brian wrote: >> Those redirects are pointing to the sam

Re: Problem viewing data...

2009-09-24 Thread mig_akira
Ops, sorry, here's the code for views/users/view.ctp [code] > >   > >   (and son on).. [/code] the conten

Re: How to send data from controller to controller?

2009-09-24 Thread LPaulino
ups I said it wrong, I mean from action to action On 24 set, 13:56, brian wrote: > Those redirects are pointing to the same controller. > > Why not simply point the form at the 2nd controller? > > > > On Thu, Sep 24, 2009 at 9:16 AM, LPaulino wrote: > > > Hi guys, > > > I would like to know

Re: How to send data from controller to controller?

2009-09-24 Thread brian
Those redirects are pointing to the same controller. Why not simply point the form at the 2nd controller? On Thu, Sep 24, 2009 at 9:16 AM, LPaulino wrote: > > Hi guys, > > I would like to know how can I send data from 1 controller to another > one. Let me explain better why I need that. > > I h

Re: Choose which database to usa, on the fly

2009-09-24 Thread Cristian Cassina
Thank you and thank to WebbedIT fro your kid replies and suggestions. I'm going to read the article you posted and I'll decide which path to follow. Cristian Jorge Horacio Cué Cantú ha scritto: > Hello, > > One approach I take with an application is: Each different "customer" > (I am developp

Re: Making Databases Optional in CakePHP

2009-09-24 Thread mark_story
Databases are optional. Set $uses = array() in your controller, to prevent it from loading any of the model classes. -Mark On Sep 24, 7:31 am, Erik Kristensen wrote: > Good Morning Everyone! > > I am a long time user and I absolutely love CakePHP, however there is > one problem that I have run

Re: Using same Auth component in admin and client

2009-09-24 Thread brian
$admin = Configure::read('Routing.admin'); if (isset($this->params[$admin]) && $this->params[$admin]) But I've no idea if Auth can handle having 2 models like this. On Thu, Sep 24, 2009 at 7:06 AM, vinodkalpaka wrote: > > How can I use same Auth component in admin and client properly? What > i

Re: Private Messaging mysql

2009-09-24 Thread schneimi
Hi, I use some similar setup as you thought about: messages table user_id sender_id receiver_id ... MessageModel var $belongsTo = array('User' => array('className' => 'User', 'foreignKey' => 'user_id' ),

Re: Private Messaging mysql

2009-09-24 Thread brian
On Thu, Sep 24, 2009 at 7:56 AM, invisibleman wrote: > > Ah Thank you that makes alot of sense, for some reason i couldn't wrap > my head around the best way to do this. > I guess my next questions is how do i only delete from the join table > in cakephp? > > Usually to delete from a table like t

Re: Best way to accomplish acl for database records owned by a user

2009-09-24 Thread brian
You could also just use $this->Auth->user('id') which gets the info from the session. On Thu, Sep 24, 2009 at 10:09 AM, Rick wrote: > > I know that globals are bad but... > > I just set a global $gblCurrentUser when the user logs in.  Then > accessing that in models, I can add a select condition

Re: jQuery support in cake

2009-09-24 Thread brian
The 1.3 release will include libs to allow or using jQuery instead of Prototype. For now, though, just don't use the helper. On Thu, Sep 24, 2009 at 4:37 AM, Intunet wrote: > > I'm just looking at CakePHP as a viable solution to building > applications and am a big fan of jQuery. For me and a lo

Doubt in cake php

2009-09-24 Thread hunny
Hi Guys, I am new to cakephp. I am having the following issue: I am displaying list of checkbox containing clubs to a login user. The list of clubs I am passing through the models via controllers in the traditional way. Now the logged in user should see his list of clubs automatically ticked. T

Enterprise Level App using cakephp

2009-09-24 Thread gabrielr
Hi everybody, First of all, congratulations for this Framework, it mak programmer's life easier. Well, I have 2 Questions to this group. Is anybody use cakephp for developing an Enterprise Level Application?, and What Kind of App was developed? I have Developed an aplication for Human Resource

i can't get data from table in Autocompletion

2009-09-24 Thread Jiru
In my autocomplete_controller() i use the function function getData(){ $this->layout = 'ajax'; $this->set("typed",$this->data['Autocomplete']['AutocompleteName']); for($i=0;$i<10;$i++){ $items[] = rand(1,100); }

how to migrate old system to cakephp?

2009-09-24 Thread gchen89
We have a website which is running on LAMP. The initial version was developed in early this century. Till today, lots of programmers have worked on it and lots of changes have been made. Lots of patches can be found here and there in the program. Recently, we need to add some new stuff. This will

Re: eCommerce question

2009-09-24 Thread Serverdog
I usually use 2 methods depending on the requirements: 1. Stock = actual stock - cart contents for all users (cart expires after 30 min activity) 2. Stock availability is checked on produc search/display and double checked when the user clicks Confirm Checkout. (Obivously this one has usability i

Registration with Country---State/Region---City

2009-09-24 Thread nameless
When a users wants to register on my site, he must select Country, State/Region and City. How could I do that ? I have bought Ip2location but it's incomplete for some cities. Ip2Location is like this ( latitude and longitude is unnecessary ): "UNITED STATES","MASSACHUSETTS","BEVERLY","42.5685"

Using same Auth component in admin and client

2009-09-24 Thread vinodkalpaka
How can I use same Auth component in admin and client properly? What is the use of $this->Auth->userModel ="modelname" . I am using users table in admin side and customers table in client side I have used the following code in beforeFilter() function of AppController here is the code $this->pos

jQuery support in cake

2009-09-24 Thread Intunet
I'm just looking at CakePHP as a viable solution to building applications and am a big fan of jQuery. For me and a lot of my collegues, jQuery is a cut above the likes of Prototype which it looks like CakePHP supports more strictly. Do you think that CakePHP is likely to ever switch its attention

Re: Private Messaging mysql

2009-09-24 Thread invisibleman
Ah Thank you that makes alot of sense, for some reason i couldn't wrap my head around the best way to do this. I guess my next questions is how do i only delete from the join table in cakephp? Usually to delete from a table like the inbox or message i would use $this->NameofModel->delete(), do i

Validation for client and admin panel

2009-09-24 Thread vinodkalpaka
How can I use same Auth component in admin and client properly? What is the use of $this->Auth->userModel ="modelname" . I am using users table in admin side and customers table in client side I have used the following code in beforeFilter() function of AppController here is the code $this->pos

Re: Choose which database to usa, on the fly

2009-09-24 Thread Jorge Horacio Cué Cantú
Hello, One approach I take with an application is: Each different "customer" (I am developping a SaaS site) o "company" in Your case, can have an specific domain ( www.company1.com, www.company2.com, ...) then based on domain the application can select an specific database. Check following art

RE: Search and Find all

2009-09-24 Thread Dave Maharaj :: WidePixels.com
No problem. If you have more questions you know what to do. Dave -Original Message- From: Simon [mailto:simon_d...@hotmail.com] Sent: September-24-09 12:21 PM To: CakePHP Subject: Re: Search and Find all thank you Dave And Brian i got it i'm knida blonde haha here is what i did f

Re: Search and Find all

2009-09-24 Thread Simon
thank you Dave And Brian i got it i'm knida blonde haha here is what i did function search($item = null) { $item = $this->params['url']['q']; $params = array('conditions' => array( 'AND' => array( 'OR' =>array( 'Post.name LIKE' => '%

Re: executing queries from a .sql file in the console

2009-09-24 Thread Stinkbug
I'm somewhat familiar with the schema stuff. However, the .sql file is a file that's going to be provided to us and not a file that will be generated by cake. Our .sql file isn't just about the schema, it could be large amounts of data manipulation using sql. So unless the schema stuff will exe

Re: Search and Find all

2009-09-24 Thread Simon
you ment like this correct me if i worng function search($item = null) { $item = $this->params['url']['q']; $post = $this->Post->find('all', $params => array('conditions' => array( 'AND' => array( 'OR' =>array( 'Post.name LIKE'

Re: Best way to accomplish acl for database records owned by a user

2009-09-24 Thread Rick
I know that globals are bad but... I just set a global $gblCurrentUser when the user logs in. Then accessing that in models, I can add a select condition for that user in the beforeFind etc.. You get the idea? Rick On Sep 24, 12:20 am, brian wrote: > I did something similar to this. Howev

RE: Search and Find all

2009-09-24 Thread Dave Maharaj :: WidePixels.com
Your telling it to find nothing. You need to tell it what to find. Like you had before $params => array('conditions' => array(            'AND' => array(                'OR' =>array(                    'Post.name LIKE'      => '%' . $item . '%',                    'Post.date LIKE'  => '%' .

Re: Search and Find all

2009-09-24 Thread Simon
hi thanks for you time i get parse erorr when i do this $this->set('results', $this->find(...)); i tried it without the dots $this->set('results', $this->find()); then i get Call to undefined method PostsController::find() thank you On Sep 23, 5:45 pm, brian wrote: > You're testing for $i

Re: Number of Affected Rows

2009-09-24 Thread blake
Works perfect. Thanks for the quick help. -Blake On Sep 24, 9:07 am, Bert Van den Brande wrote: > You can call getAffectedRows() on any model class. > > From class Model : > > /** >  * Returns the number of rows affected by the last query >  * >  * @return int Number of rows >  * @access publ

How to send data from controller to controller?

2009-09-24 Thread LPaulino
Hi guys, I would like to know how can I send data from 1 controller to another one. Let me explain better why I need that. I have in my view 1 form with a select: Test1 Test2 Test3 When it is send to controller "test", the action index will check which test was select and will

Question about a Relationship

2009-09-24 Thread Luke
Hi, I am sitting on a Relationship issue where I would like to hear your opinion about. It is a recipe page. A user can write Recipes and save other Recipes as Favourites. A User hasMany Recipe(Recipe belong to User) A User hasMany Favourite (Favourite belong to User) My Favourite Table: id use

Re: Number of Affected Rows

2009-09-24 Thread Bert Van den Brande
You can call getAffectedRows() on any model class. >From class Model : /** * Returns the number of rows affected by the last query * * @return int Number of rows * @access public */ function getAffectedRows() { $db =& ConnectionManager::getDataSource($this->useDbConfig);

Number of Affected Rows

2009-09-24 Thread blake
I'm running an updateAll and would like to know the number of rows that actually got updated. Is there an easy way to do this? The debug query results at the bottom show me the number of rows affected, so hopefully theres a way for me to access that? Thanks, -Blake --~--~-~--~~---

Re: eCommerce question

2009-09-24 Thread danfreak
Thanks for your answer Bert! Any other opinion/solution? --~--~-~--~~~---~--~~ 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

Re: recursive find: related models order

2009-09-24 Thread lorenx
ok, thank you very much! On Sep 24, 1:58 pm, Bert Van den Brande wrote: > If I understand you question correctly I think you're right :) > > > > On Thu, Sep 24, 2009 at 1:27 PM, lorenx wrote: > > > perfect, thanks! > > > just one little question: > > if i have a deep and complex recursion and i

Re: recursive find: related models order

2009-09-24 Thread Bert Van den Brande
If I understand you question correctly I think you're right :) On Thu, Sep 24, 2009 at 1:27 PM, lorenx wrote: > > perfect, thanks! > > just one little question: > if i have a deep and complex recursion and i just want a condition on > a single model in the middle of the tree... it seems that i a

Re: eCommerce question

2009-09-24 Thread Bert Van den Brande
I would only decrease stock value when the shopping cart gets converted to a purchase. Chances are rather slim that many people will buy the book at the same time, and if it does you should try to anticipate this and create a larger stock for popular books :) Also, every formula you invent to cal

Re: update multiple divs with ajax

2009-09-24 Thread senser
Hi Werschinger, First of all - thank you for the help. Schnemi - thank you too. I've read topic you posted link, but method mentioned there works only with divs, but not other html elements. It's my fault that in question I asked for div elements but not for *any* - I just wanted to make things

Making Databases Optional in CakePHP

2009-09-24 Thread Erik Kristensen
Good Morning Everyone! I am a long time user and I absolutely love CakePHP, however there is one problem that I have run into lately that I think deserves some attention, though I am sure there are those that will disagree with me. For the most part most of the applications I have written have a

Re: recursive find: related models order

2009-09-24 Thread lorenx
perfect, thanks! just one little question: if i have a deep and complex recursion and i just want a condition on a single model in the middle of the tree... it seems that i also have to specify all the other models not to have them filtered out, am i right? On Sep 24, 11:09 am, Bert Van den Bra

eCommerce question

2009-09-24 Thread cakeFreak
Hey guys, my question is about developing an eCommerce solution in PHP, and it about dealing with stock quantities. When you have real products (not services or e-books, for example, but real books instead) how do you deal with the following situation: 1) you have 10 copies of Book "Learning Ca

Re: Get keyword from Search Engine

2009-09-24 Thread Bert Van den Brande
Nice tip ... I'm gonna remember that one :) On Thu, Sep 24, 2009 at 12:22 PM, Dr. Loboto wrote: > > Check $this->params['requested'] in beforeFilter. If it is set and > true, you are processing requestAction this time. > > On Sep 24, 2:01 pm, igorfelluga wrote: > > Hi > > I did a component to g

Re: Get keyword from Search Engine

2009-09-24 Thread igorfelluga
Thanks ! I put a if with $this->params['requested'], now is working On 24 Set, 12:22, "Dr. Loboto" wrote: > Check $this->params['requested'] in beforeFilter. If it is set and > true, you are processing requestAction this time. > > On Sep 24, 2:01 pm, igorfelluga wrote: > > > Hi > > I did a com

Re: Get keyword from Search Engine

2009-09-24 Thread Dr. Loboto
Check $this->params['requested'] in beforeFilter. If it is set and true, you are processing requestAction this time. On Sep 24, 2:01 pm, igorfelluga wrote: > Hi > I did a component to get/save the search engine keyword if same one > arrive from google,msn,yahoo. > I call it in app_model with bef

Re: URL Routing

2009-09-24 Thread Dr. Loboto
Form itself cannot do it. Only JavaScript. On Sep 23, 10:12 pm, persianshadow wrote: > hi > > i have  form with one field that get number from user , i want send > this number to my controller from > > url . i change my form type to "get" but i need to nice url > routing .for example > > with "g

Re: recursive find: related models order

2009-09-24 Thread Bert Van den Brande
Search the Cake book for 'Containable' behavior , I think you will find your answer there On Thu, Sep 24, 2009 at 10:53 AM, lorenx wrote: > > hi all. > > i'm trying to order a deeply related model but the following code > gives me an error. > > $params = array( >'order' => 'RelatedModel.

Re: Get keyword from Search Engine

2009-09-24 Thread Bert Van den Brande
If you have XDebug or Zend Debugger, just put a breakpoint at the beforeFilter code and then look at the stacktrace each time you are halted. As said, unless you use 'requestAction' calls inside your view I can't think of any reason why the beforeFilter is called multiple times ... On Thu, Sep 24

recursive find: related models order

2009-09-24 Thread lorenx
hi all. i'm trying to order a deeply related model but the following code gives me an error. $params = array( 'order' => 'RelatedModel.relatedmodel_field DESC', 'recursive' => 3 ); $models_array = $this->Model->find('all', $params); i saw that cakephp do several queries to build

Re: Get keyword from Search Engine

2009-09-24 Thread igorfelluga
Sorry you are right, I call in app_controller :) in the only homepage it save the keywords group 5 times On 24 Set, 10:32, Bert Van den Brande wrote: > Any way, unless you use 'requestAction' calls inside your view I don't think > a controller's beforeFilter method is called multiple times for

Re: Missing Controller

2009-09-24 Thread Selva manickaraja
Thanks alot guys. I was just about to edit the php.ini. Since I got advice to stick to long tags, I wil continue using long tags not to suffer from deprecations. On Thu, Sep 24, 2009 at 12:08 PM, dhiraj ray wrote: > hi >create controler name just pulural of modle > > check naming in data bas

Re: Get keyword from Search Engine

2009-09-24 Thread Bert Van den Brande
Any way, unless you use 'requestAction' calls inside your view I don't think a controller's beforeFilter method is called multiple times for one http request ... On Thu, Sep 24, 2009 at 9:56 AM, Bert Van den Brande wrote: > Don't you mean "beforeFilter" from "app_controller" ? > "app_model" has n

Re: update multiple divs with ajax

2009-09-24 Thread Werschinger
In cases like this (and also other cases), I typically do not rely on Cake's built-in ajax functions. What I'd do if I were in your position: * Create my own JS-functions that handle the deletion of an email. * Have the delete action do the deletion and return whatever data you need in JSON forma

Re: Get keyword from Search Engine

2009-09-24 Thread Bert Van den Brande
Don't you mean "beforeFilter" from "app_controller" ? "app_model" has no "beforeFilter". On Thu, Sep 24, 2009 at 9:01 AM, igorfelluga wrote: > > Hi > I did a component to get/save the search engine keyword if same one > arrive from google,msn,yahoo. > I call it in app_model with beforeFilter. >

Re: Sorting pagination with HasMany and SQL Aggregation

2009-09-24 Thread WebbedIT
Make life easier by adding an afterSave() callback to Rating to populate a field in Article with the average value (and possibly one for rating_count, but that can easily be done using counterCache). It's the more efficient way to do it and sorting would then be on the Article model. --~--~---

Re: URL Routing

2009-09-24 Thread WebbedIT
Not sure why you've gone off on a tangent of URL Routing for this. Read more in the book about form helper, which automagically packages all submitted form data into $this->data, and you should get there. http://book.cakephp.org/view/182/Form --~--~-~--~~~---~--~~

Re: Problem setting up a relation

2009-09-24 Thread WebbedIT
First thing, using conventions (which is always the best way as much easier to debug issues) your foreignKey should be user_id unless you already have that foreignKey in the table. If you do already have an existing foreignKey of user_id in the super_users table or really really want to associate

Get keyword from Search Engine

2009-09-24 Thread igorfelluga
Hi I did a component to get/save the search engine keyword if same one arrive from google,msn,yahoo. I call it in app_model with beforeFilter. The problem is that in home page or wherever it save the same keywords group more than one time. I think that happen because the page call 2/3/4 controller