checking if Save() method was successful...

2011-10-08 Thread Tomfox Wiranata
hi, i have a simple save() $updates['Report']['status']= $new_status; $updated = $this-Report-save($updates); now i want to check, if the saving was successful and echo the result: if ($updated) { $this-set('success', ok);

Re: Associated models using wrong primary key

2011-10-08 Thread ShadowCross
Try adjusting your AccountUser model to explicitly specify the AccountModule plugin relations: class AccountUser extends AccountModuleAppModel { ... var $hasMany = array(     'AccountLicense' = array(         'className' = 'AccountModule.AccountLicense',         'foreignKey' = 'user_id'     ) );

$this-Model-save($this-data)

2011-10-08 Thread aortizhi
hi, i have a problem when i'm trying to save data. I am creating new fields to my database table as the user want to, but when trying to save it does not include the values for the new fields in the insert query, here's my code my view: div class=proveedores form ?php echo

Re: checking if Save() method was successful...

2011-10-08 Thread andrewperk
Your model's save method doesn't actually return a boolean, you can just use the method call itself in a conditional, but it actually returns an array. You could check if $updated is not empty I believe: if (!empty($updated)) { } Or use the method call itself in a condition to see if the save

Re: checking if Save() method was successful...

2011-10-08 Thread andrewperk
I may have said that wrong, I think it returns two different things, if successful it will return an array if not I believe it just returns false. On Oct 8, 4:58 pm, andrewperk andrewp...@gmail.com wrote: Your model's save method doesn't actually return a boolean, you can just use the method

Controllers Controller?

2011-10-08 Thread SyNeto
Hi, im pretty new in cakephp, so feel free to correct me, I have read the phpcake blog tutorial, and i have some noobs questions about controllers. if i need a view to display information from more than one model, how can i achive this task? I have already read some information about elements

Retain custom parameter or query string in pagination

2011-10-08 Thread archer
Pagination in CakePHP 1.3 doesn't seems to provide a way to retain custom query string passed with the url which is an essential part for any application. Say if url is something like www.example.com/post/search?section=acticlekeyword=cakephp, the pagination links doesn't contain the query

Re: How REST works in Cake (how to have REST with CAKE :-) )

2011-10-08 Thread nowotny
On 5 Paź, 16:11, basav raj...@gmail.com wrote: I am trying to understand the some depth knowledge of working of REST in cake php Check out this book: http://tinyurl.com/3c7kxdx the free sample chapter deals with REST in Cake... It's not exactly what you asked for but hopefully it'll be

Paginar 2 Consultas de la misma tabla con la funcion paginate()

2011-10-08 Thread Bruno Binci
Hola, Estoy intentando hacer una paginacion de 2 tablas, el tema es el siguiente: tengo que mostrar el contenido de la tabla ordenado de esta manera: today-present/future-past obviamente ordenándolo por fechas. Tuve una idea de recuperar en un arreglo Present el contenido ordenado de manera

hasAndBelongsToMany does not work

2011-10-08 Thread khalili merouane
Hello, I have two tables categories and products when I try to view a category, I just have the information in the category without products. When I check the applications running I see that selects the products but does not display I have the join table categories_products and that the table

Re: use alternative view folder?

2011-10-08 Thread sarahk
FWIW I, too, have a huge application driving 20 subdomains. The owners of some of the subdomains need their own skins so I've been looking through this. My possible solution is to use bootstrap. 1. Add code to bootstrap to extend add 2 paths to $viewPaths[]. (1) The relevant subdomains path and

Problem with Controllers (Missing Controller)

2011-10-08 Thread Victor Forato
I took a look in others posts, but I couldn't resolve my problem. I'm trying acess the action register(http://localhost/cake/users/ register),but the cake show me this message: Error: UsersController could not be found. Error: Create the class UsersController below in file: app\controllers

Re: Cakephp 1.3 not logging when debug set to 1 or 2

2011-10-08 Thread skyhigh
Did anyone find a solution to this issue? I am having exactly the same problem. Calls to: $this-log('test message', 'mylogfile'); will not log the message unless in the config/core.php file I set it to Configure:write('debug', 0); If the debug level is set to some other value such as 2

Re: Controllers Controller?

2011-10-08 Thread andrewperk
If your model has an association with the other model that you want to retrieve from, each time you do a find it will also retrieve any associated data as well. You can read about it here: http://book.cakephp.org/view/1039/Associations-Linking-Models-Together You can also use App::import. For

Re: assertTags method interprets line breaks in my views and breaks test

2011-10-08 Thread andrewperk
I figured it out. It was because I had it indented inside of a php block foreach loop. If I keep it on the same level as the php loop code thats around it, the tests work fine. Here's what I originally had that was causing the error: ?php foreach(): ? p a href=indexUser 1/a /p

Re: Problem with Controllers (Missing Controller)

2011-10-08 Thread Ryan Schmidt
On Oct 8, 2011, at 16:32, Victor Forato wrote: I took a look in others posts, but I couldn't resolve my problem. I'm trying acess the action register(http://localhost/cake/users/ register),but the cake show me this message: Error: UsersController could not be found. Error: Create the

Re: Problem with Controllers (Missing Controller)

2011-10-08 Thread Victor Forato
Thanks very much! My problem was completely resolved! Now I can continue with my project! I was expecting problem with configuration, apache or framework, but it was if the first line in the code. Thanks again, Victor. 2011/10/9 Ryan Schmidt google-2...@ryandesign.com On Oct 8, 2011, at

Re: Controllers Controller?

2011-10-08 Thread SyNeto
I decided to make a model named site and link users to thar model, users have some links to other models like news and post, it's this a betther aproach? On 8 oct, 19:48, andrewperk andrewp...@gmail.com wrote: If your model has an association with the other model that you want to retrieve from,