Re: Javascript Helper modification. Opinions, please.

2011-12-08 Thread Benjam Welker
It also seems that scripts added in the default layout or through elements that are included in the default layout don't have their scripts added to the queue at all. I was going to try adding all the default scripts in via an element, but they just get ignored. -- Our newest site for the com

Re: Javascript Helper modification. Opinions, please.

2011-12-08 Thread Benjam Welker
One issue that I'm having, is that if a script is included in the default layout in the HEAD tag above the $scripts_for_layout, with the default 'inline' => true, and then again in a view (or element, or whatever) with 'inline' => false, The HtmlHelper does not recognize that the script in quest

Re: Best practice output a Dynamic menu

2011-12-08 Thread Perry
why consider components and helpers? do you store your menu structures in database? why not just treat it as a data and output it directly in layout? On Fri, Dec 9, 2011 at 9:31 AM, MetZ wrote: > Hi all! > > I am looking for a couple of suggestions. > > I am currently working on a tree menu par

Best practice output a Dynamic menu

2011-12-08 Thread MetZ
Hi all! I am looking for a couple of suggestions. I am currently working on a tree menu part of my app, where administrators can create menues, add links to the menues and move the links up and down in the tree. Now, I am looking how to output this menu with links on the frontend. Any suggestio

Can a plugin component auto-load a helper

2011-12-08 Thread Toby G
Hi there, I've been attempting to get a plugin component auto-load the plugin's helper file. I have added it to the controller's helper array, but it's not loading the helper into view (under $this->Helper), so I think that the helpers have already been loaded prior to me adding the plugin helper

Re: How to add a "read" button to a view.ctp?

2011-12-08 Thread Daniel
I used an action: Html->link(__('Mark as read', true), array('action' => 'read', $email['Email']['id'])); ?> -- 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

Re: How to add a "read" button to a view.ctp?

2011-12-08 Thread Yves S. Garret
Here: http://book.cakephp.org/view/1431/submit On Thu, Dec 8, 2011 at 4:55 PM, Daniel wrote: > On Dec 8, 9:31 pm, "Yves S. Garret" > wrote: > > http://book.cakephp.org/view/1367/submit > > > > Just great, this says it is deprecated: > http://book.cakephp.org/view/1367/submit#!/view/1358/AJAX >

Re: How to add a "read" button to a view.ctp?

2011-12-08 Thread Yves S. Garret
lol, I completely overlooked the AJAX, was thinking of something I did. This is a portion of my code from a recent project. echo $this->Form->create("AdmitLookupProviders", array('action' => 'view_admit_lookup')); echo ""; echo "Last Name"; echo $this->Form->input("last_name"

Re: request says put instead of post

2011-12-08 Thread euromark
scratch that - recordExists is true, therefore created is true and the action is not submitted in the options array (which is optional after all!). but that should not result in a put afaik. at least not if the documentation states that we should check with the above if statement I would expect PO

Re: request says put instead of post

2011-12-08 Thread euromark
I think its the FormHelper a simple: Form->create('User', array('id'=>'userData'));?> results in: ... so obviously it thinks this is a non-existing record //FormHelper.php 'type' => ($created && empty($options['action'])) ? 'put' : 'post', $created is true and $options['action'] is undefined =>

Re: How to add a "read" button to a view.ctp?

2011-12-08 Thread Daniel
On Dec 8, 9:31 pm, "Yves S. Garret" wrote: > http://book.cakephp.org/view/1367/submit > Just great, this says it is deprecated: http://book.cakephp.org/view/1367/submit#!/view/1358/AJAX -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakeP

Re: request says put instead of post

2011-12-08 Thread Miles J
What are your HTTP headers? On Dec 8, 1:44 pm, euromark wrote: > thats really weird. > happening on windows/wamp - php5.3.8 > maybe some bug? > > the firefox firebug debug data for POST reads: > > Parameter application/x-www-form-urlencoded > _method PUT > data[UserInfo][country_id...    1 > data

Re: Problems with ajax and security component.

2011-12-08 Thread Miles J
Yeah I ran into this as well, Jose has the correct answer. https://github.com/milesj/cake-ajax_handler/blob/master/Controller/Component/AjaxHandlerComponent.php#L84 On Dec 8, 12:54 pm, José Lorenzo wrote: > set 'validatePost' => false for the security component in that action -- Our newest sit

Re: request says put instead of post

2011-12-08 Thread euromark
thats really weird. happening on windows/wamp - php5.3.8 maybe some bug? the firefox firebug debug data for POST reads: Parameter application/x-www-form-urlencoded _method PUT data[UserInfo][country_id...1 data[UserInfo][gender] 1 data[User][id] 4ed23d7c-dcc8-4d3b-8e7b-0fe01810f9bf data[Use

Re: How to add a "read" button to a view.ctp?

2011-12-08 Thread Yves S. Garret
http://book.cakephp.org/view/1367/submit On Thu, Dec 8, 2011 at 4:26 PM, Daniel wrote: > I want to add a "read" button to a view.ctp and set a boolean field > called "email_read" to true when the user clicks on it. My question > is how do I set up the button in the view.ctp file and how do I co

How to add a "read" button to a view.ctp?

2011-12-08 Thread Daniel
I want to add a "read" button to a view.ctp and set a boolean field called "email_read" to true when the user clicks on it. My question is how do I set up the button in the view.ctp file and how do I code the save in the controller? This is what I have so far at the bottom of view.ctp: Form->cr

Re: Cake 2.0 documentation

2011-12-08 Thread aries
Got it. What I'm hungering for is an easier way to submit changes and/ or supplementation. A sticky guide as you suggest would help. I hasten to add that I think the documentation is very well written. I usually find what I'm looking for, even if it takes some time to find it. Best, -Brian On De

Re: Problems with ajax and security component.

2011-12-08 Thread José Lorenzo
set 'validatePost' => false for the security component in that action -- 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

Problems with ajax and security component.

2011-12-08 Thread porangi.chris
Hi, I'm having issues with running Ajax and the security component alongside each other. Security works fine on the other forms. Ajax works fine if Security is commented out. Security is included in the App Controller alongside other components 'Security' => array( 'csrfExp

Re: Model Test Case SQL Error

2011-12-08 Thread José Lorenzo
Well, the 'bit' column is not officially supported, so it interpreted it as binary. The best of doing booleans is with tinyint(1) -- 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

Re: request says put instead of post

2011-12-08 Thread Tilen Majerle
i was checking this what you said that didn't work and results checking: $this->request->is('post') in Google Chrome (latest): true Firefox (latest): true IE 8: true i'm on xampp 1.7.3 with php 5.3.5 and Cake version: 2.0.4 so problem is somewhere in your project or maybe server configuration --

request says put instead of post

2011-12-08 Thread euromark
For 2.0 I just changed all if (!empty($this->data)) to if ($this->request->is('post')) But now it haunts be. In FF8 Cakephp $this->request does say "false" after a normal post (whereas firebug itself says it is a post) but is('put') returns true Same with every other browser it seems. so it never

Re: How can I link these models together? Product and multiple users

2011-12-08 Thread denisr
Exactly that! Now the two models are linked! Thank you! On 8 Dic, 12:04, Renato de Freitas Freire wrote: > Try to set classname to User intead of Buyer. > > Cake will look after the model named there. > Probably, cake is trying to find Model Buyer, that doesnt exists. > > > > > > > > > > On Thur

Re: Trying to reduce arrays

2011-12-08 Thread McScreech
Here's what I came up with. function flattenArray($a) { // reduce raw matrix to single level matrix of matrices // that will be the rows in results table. $r1 = array(); $r2 = array(); foreach ($a as $k1 => $v1) { foreach ($v1 as $k2 => $v2)

Re: How Can I do custom pagination in Cake PHP ?

2011-12-08 Thread McScreech
Here are a few more good discussions: http://bakery.cakephp.org/articles/AD7six/2006/10/09/pagination http://www.cakephpforum.net/index.php?showtopic=186 http://www.sakic.net/blog/changing-cakephp-pagination-urls McS . -- Our newest site for the community: CakePHP Video Tutorials http://tv.cak

Re: How Can I do custom pagination in Cake PHP ?

2011-12-08 Thread McScreech
Here are a few more good discussions: http://bakery.cakephp.org/articles/AD7six/2006/10/09/ pagination"> http://www.cakephpforum.net/index.php?showtopic=186";> http://www.sakic.net/blog/changing-cakephp-pagination-urls/";> McS -- Our newest site for the community: CakePHP Video Tutorials http://

Re: v2.0.4 Console error message on mkdir?

2011-12-08 Thread AD7six
On Dec 8, 5:05 pm, heohni wrote: > Hi, > > Welcome to CakePHP v2.0.4 Console > --- > App : MyName > Path: C:\Users\MyName\ > --- > What is the path to the project you want to b

v2.0.4 Console error message on mkdir?

2011-12-08 Thread heohni
Hi, Welcome to CakePHP v2.0.4 Console --- App : MyName Path: C:\Users\MyName\ --- What is the path to the project you want to bake? [C:\Users\MyName\myapp] > cd /D d:\SVN-Homes\P

Re: Shared code for Models but not in AppModel

2011-12-08 Thread RhythmicDevil
Thats great Geoff thank you. On Dec 7, 5:08 pm, Geoff Douglas wrote: > I think you have most elements i place... I think the thing that is getting > confusing is how cake is suppose to load the classes. > > So here's the kicker. Cake only "loads" models if they are related to > something that you

XML->serialize() with CDATA?

2011-12-08 Thread Eric Blanpied
Hello, I've been exporting Cake data arrays as XML using the XML helper's serialize(), and then using that to import into other Cake apps, and it makes a nice way to exchange data between our set of app servers. Now, however, I'm dealing with data that would be best wrapped in CDATA tags, and w

Re: oauth_signature does not match expected value

2011-12-08 Thread AD7six
On Dec 8, 8:10 am, Narola wrote: > While Authenticating tumblr using application made on tumblr i m > getting the following error: > oauth_signature does not match expected value > by executing this url > > http://www.tumblr.com/oauth/request_token?oauth_consumer_key=Vv3XfKpk... Are you using C

oauth_signature does not match expected value

2011-12-08 Thread Narola
While Authenticating tumblr using application made on tumblr i m getting the following error: oauth_signature does not match expected value by executing this url http://www.tumblr.com/oauth/request_token?oauth_consumer_key=Vv3XfKpkZAXAehLxk9h76cjPkUyq7iDnqMjmEKwqKrOriGSVoG&oauth_nonce=fd47a26a06ce

Re: Cake 2.0 documentation

2011-12-08 Thread phpMagpie
The argument is simple, it is wrong to add a comment if it is to supplement missing or correct existing documentation. You should edit the documentation then the problem is resolved for all others who read it thereafter. I think this is a brilliant advancement for the new book, but maybe we c

Re: Edit an object without creating it

2011-12-08 Thread phpMagpie
I agree that checking and double-checking is a good thing, was just trying to explain that in MOST circumstances there the ID passed to the edit action should be checked before you get to saving the new data. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org

Re: How can I link these models together? Product and multiple users

2011-12-08 Thread Renato de Freitas Freire
Try to set classname to User intead of Buyer. Cake will look after the model named there. Probably, cake is trying to find Model Buyer, that doesnt exists. On Thursday, December 8, 2011, denisr wrote: > I forgot to mention. In the bake process I made an alias for the > buyer, classname buyer,

Re: How can I link these models together? Product and multiple users

2011-12-08 Thread denisr
I forgot to mention. In the bake process I made an alias for the buyer, classname buyer, foreign id as the table field 'buyer id'. But, when testing, I get the "Database table buyers for model Buyer was not found." This is how the model is defined (it's just a cut and paste of some parts) public

How can I link these models together? Product and multiple users

2011-12-08 Thread denisr
Hi, I am a bit confused on how can I link together two models, where the first model has 2 fields linked with the same model. Basically, the first model is about a product on a consumer swapping site, so it will have these fields: **model product user_id (the id of the user that submitted the it

Re: Model Test Case SQL Error

2011-12-08 Thread flosky
After some further testing and commenting things out in my code, I found out that there is something wring in the $fields array (that was automatically populated by cake from the DB schema). To be precise: I have a field 'blocked', which has the datatype bit(1) and the default value: 0. What Cake w

Re: Edit an object without creating it

2011-12-08 Thread Matteo Landi
Thank you guys for the precious information you shared with me. Reading the link euromark posted, I found a lot of similarities with our controller implementation: first of all we call a function validateInput (we are better off changing its name to something more compatible with cakephp use of va

Model Test Case SQL Error

2011-12-08 Thread flosky
Hi everyone, I'm using Cake 2.0.2 and just started a new app where I want to do some Tests on the Models. So far I have created a User and Setting model, both with the Cake Console. For both I added two records to the Fixture and tried to run simple test for find('all'); For the Setting test case