why this find association model dont work?

2012-01-11 Thread ahmed fakher
gallery model and image model has blinded..but when i retrive images from galleries_controller i cant see any result..and see this error Warning (2): Invalid argument supplied for foreach() [APP\views \galleries\view.ctp, line 35] function view($id = null) { if (!$id) {

Re: CounterCache on HABTM tables?

2012-01-11 Thread rchavik
On Wednesday, January 11, 2012 1:29:39 PM UTC+7, OJ Tibi - @ojtibi wrote: Thiago, a HABTM join table by nature has disposable records as used by CakePHP. For example, every time you rebuild how the Tags are linked to Articles or vice-versa, the records from the `articles_tags` table that

Re: saveAll() + blank records = headache

2012-01-11 Thread Ernesto
This isn't working :\ Here's my Behavior ?php class CleanableBehavior extends ModelBehavior { function beforeValidate ($model) { foreach ($model-data as $modelAlias = $modelData) { if (isset($model-hasMany[$modelAlias])) { foreach ($modelData

Re: Problem with Security

2012-01-11 Thread euromark
as miles said best at the very top of your file ?php HERE On 11 Jan., 03:32, jmail ad...@jmail.pl wrote: H. That is strange. Why is that working on other controller for admin? Where should I put this App::uses? Can I put this somwhere in AppController? I have added that into the

Re: Error: OrdersController could not be found.

2012-01-11 Thread schulte.christ...@googlemail.com
Dear all, thank you for your help... I found out that i simply just mess up the folder structure. The hint with baking the code is just the best. I'll will start with baking and refining afterwards. This Thread is solved now, thanks to all Christian On 7 Jan., 12:33,

Re: Duplicate html output in views

2012-01-11 Thread majna
This line duplicates layout: echo $this-requestAction($url, array('bare'=false , 'layout'= '/templates/business/default.ctp', 'return')); Anyway, you should wrap views with layouts, this view/layout/requestAction logic looks messy. Can you write what are you trying to accomplish and paste

Re: CakePHP should support better validation rules definition

2012-01-11 Thread jeremyharris
It would be cool to see a plugin that did this. Or, feel free to post an RFC ticket on lighthouse. Like Thiago said, it would be great if you also backed it up with code :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions

Re: How can I run some code only once per day?

2012-01-11 Thread jeremyharris
Try something like this: https://github.com/jeremyharris/cacher It's a plugin I wrote that caches query results, exactly as you want. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help

Re: saveAll() + blank records = headache

2012-01-11 Thread jeremyharris
Oops, I meant to have you set it in the controller, like this: // in the controller $this-Model-set($this-data); $this-Model-saveAll(); This puts the $data into Model-data (which honestly, saveAll should do). If this doesn't work then maybe something else is going on, because I've modified the

How to EDIT default layout in CakePHP 2.0.5?

2012-01-11 Thread burntcake
Hi all, I want to change the default layout in 2.0.5 but the only instruction I can find is to create: APP/View/Layouts/default.ctp. But I want to edit the existing one, so that I can see clearly how it's already structured, not to define my own brand new one from scratch. It seems this was

Re: How to EDIT default layout in CakePHP 2.0.5?

2012-01-11 Thread Jeremy Burns | Class Outfit
It's the same as it always was; grab the one from the main Cake library and paste into the location you mention below, then edit away. Jeremy Burns Class Outfit http://www.classoutfit.com On 11 Jan 2012, at 15:26:04, burntcake wrote: Hi all, I want to change the default layout in 2.0.5

Re: saveAll() + blank records = headache

2012-01-11 Thread Ernesto
at this point it's simpler to override the saveAll() function in my AppModel function saveAll ($data = null, $options = array()) { //some loops to clear the unused records return parent::saveAll($data, $options); } but that's what i'm trying to avoid :) -- Our newest site for the

Re: saveAll() + blank records = headache

2012-01-11 Thread jeremyharris
Sadly, yeah. It's truly odd that modifying $this-data didn't stick. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from

Re: How to EDIT default layout in CakePHP 2.0.5?

2012-01-11 Thread jeremyharris
FYI it's here (the same as your app structure): / lib / Cake / View / Layouts / default.ctp -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related

Re: How to EDIT default layout in CakePHP 2.0.5?

2012-01-11 Thread burntcake
Thanks for your replies, I was looking in the app dir as specified (I don't have an APP) dir, not in lib/Cake/View/Layouts... I'm not sure why the default page specifies a (seemingly) different dir. Thanks, Glen. -- Our newest site for the community: CakePHP Video Tutorials

Re: How to EDIT default layout in CakePHP 2.0.5?

2012-01-11 Thread AD7six
On Jan 11, 5:22 pm, burntcake glen_corco...@yahoo.com wrote: Thanks for your replies, I was looking in the app dir as specified (I don't have an APP) dir, not in lib/Cake/View/Layouts...  I'm not sure why the default page specifies a (seemingly) different dir. out of curiosity - did the idea

Is it possible to turn off transactions in saveAll() ?

2012-01-11 Thread Patrick
Hi, I'm new to cakephp and I want to know more about transactions in saveAll(). This is my script: ?php ... $this-BranchRequest-query('SET AUTOCOMMIT = OFF'); $this-BranchRequest-begin(); if(!$this-Count-save($this-count_header)) { $this-BranchRequest-rollback();

Re: Is it possible to turn off transactions in saveAll() ?

2012-01-11 Thread 清水紘己
see atomic option for saveAll() 2012/1/11 Patrick emailnya.patr...@gmail.com: Hi, I'm new to cakephp and I want to know more about transactions in saveAll(). This is my script: ?php ... $this-BranchRequest-query('SET AUTOCOMMIT = OFF'); $this-BranchRequest-begin();

Re: Problem with Security

2012-01-11 Thread Miles J
Just place it in bootstrap so all pages inherit it. On Jan 11, 2:54 am, euromark dereurom...@googlemail.com wrote: as miles said best at the very top of your file ?php HERE On 11 Jan., 03:32, jmail ad...@jmail.pl wrote: H. That is strange. Why is that working on other

Re: Is it possible to turn off transactions in saveAll() ?

2012-01-11 Thread Patrick
I've tried changing the 'atomic' option to 'false', but apparently there is no difference. Still can't rollback() when saveAll() fails or when the save($this- count_code) fails. When I replace saveAll() with save(), it can rollback as I want, from begin(). But with save() function, I could't save

Re: How to import another class into a component

2012-01-11 Thread Daniel
lol, yeah I wrote it myself, hence MyClass. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to

Re: Is it possible to turn off transactions in saveAll() ?

2012-01-11 Thread 0x20h
probably the problem ist that 'atomic' should be boolean false, not the string 'false' which will be evaluated to (bool) true... Am 11.01.2012 19:01, schrieb Patrick: I've tried changing the 'atomic' option to 'false', but apparently there is no difference. Still can't rollback() when

Re: Multidimensional array as named argument

2012-01-11 Thread Peter Brown
Hi I have exactly the same problem, did you figure out something ? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from

Multidimensional array args through Paginator

2012-01-11 Thread Peter Brown
Hi All, I'm looking for a way to pass a multidimensional array through named arguments. Array ( [state] = NY [city] = Array ( [0] = New York [1] = Brooklyn ) ) When i do

Re: Multidimensional array as named argument

2012-01-11 Thread jeremyharris
It is possible in 2.0 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to

Auth Component problem

2012-01-11 Thread Glauco Custódio
Hi there, I am migrating my base app from 1.3x to 2.0.5. I have copied a lot of my code and I am changing where is necessary... Auth component is configured, but it is allowing any username/password to log in and message of invalid username is not appearing. Link to my code:

Re: Multidimensional array args through Paginator

2012-01-11 Thread jeremyharris
This is built into 2.0, but not 1.3. So... no. You might be able to use Set::flatten() and pass those instead, then unflatten them in the controller. Here's some code for unflattening that I wrote a while back: public function unflatten($data, $separator = '.') { $result = array(); foreach

Re: Multidimensional array as named argument

2012-01-11 Thread jeremyharris
You can try something like I suggested here: https://groups.google.com/forum/?hl=en#!topic/cake-php/DtQaksHP1ic -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their

Re: Multidimensional array as named argument

2012-01-11 Thread Peter Brown
Thank you very much for your response Jeremy, could you where should I put this function and when should i call it ? On Wed, Jan 11, 2012 at 1:47 PM, jeremyharris funeralm...@gmail.com wrote: You can try something like I suggested here:

Re: Auth Component problem

2012-01-11 Thread Tilen Majerle
http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html check this it was some changes created :) -- Lep pozdrav, Tilen Majerle http://majerle.eu 2012/1/11 Glauco Custódio glauco.custo...@gmail.com Hi there, I am migrating my base app from 1.3x to 2.0.5. I have

Re: Multidimensional array as named argument

2012-01-11 Thread jeremyharris
It should probably go in the controller, since it's dealing with the params. Maybe call it in beforeFilter to massage the params? Personally, I would avoid magically converting them because you may come up with unwanted results. Instead, I would call it when I know I flattened the parameters

Re: Multidimensional array as named argument

2012-01-11 Thread Peter Brown
Thanks Jeremy I will try On Wed, Jan 11, 2012 at 2:15 PM, jeremyharris funeralm...@gmail.com wrote: It should probably go in the controller, since it's dealing with the params. Maybe call it in beforeFilter to massage the params? Personally, I would avoid magically converting them because

Re: How can I run some code only once per day?

2012-01-11 Thread andrewperk
This looks perfect Jeremy. Thanks! On Jan 11, 6:54 am, jeremyharris funeralm...@gmail.com wrote: Try something like this:  https://github.com/jeremyharris/cacher It's a plugin I wrote that caches query results, exactly as you want. -- Our newest site for the community: CakePHP Video

Re: How can I run some code only once per day?

2012-01-11 Thread jeremyharris
Cool, hope it works out for you! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to

Re: How can I run some code only once per day?

2012-01-11 Thread Miles J
@jeremy - Now that is sick. Was trying for so long to cache SQL data via a behavior but never thought to use a datasource as well. Will give this a try. On Jan 11, 1:23 pm, jeremyharris funeralm...@gmail.com wrote: Cool, hope it works out for you! -- Our newest site for the community: CakePHP

Re: Multidimensional array as named argument

2012-01-11 Thread Peter Brown
Works perfectly, thanks again! On Wed, Jan 11, 2012 at 2:50 PM, Peter Brown pe...@sponsorhub.com wrote: Thanks Jeremy I will try On Wed, Jan 11, 2012 at 2:15 PM, jeremyharris funeralm...@gmail.comwrote: It should probably go in the controller, since it's dealing with the params. Maybe

Re: How can I run some code only once per day?

2012-01-11 Thread jeremyharris
Cool! Make sure to read the notes about the cache not being accurate when joined data is deleted. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related

Re: Multidimensional array as named argument

2012-01-11 Thread jeremyharris
Glad I could help! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to

cakeDC utils csvImport - extra record

2012-01-11 Thread elogic
I am using the plugin cakeDC Utils (CSVImport - Link Below) with cakephp 2.0.4 and everything works however when the csv is imported it is adding in an additional blank record at the end, does anyone else have this issue and know how I can fix it? Thanks LINK: https://github.com/CakeDC/utils