Re: Recursive removed?

2012-11-20 Thread jsundquist
Hello Jeremy,

Here is my example. Note that this is all within my model.

public function getOrder($id = null){
if($id === null){
return array();
}

$fields = array(
'Order.id',
'OrderStatus.name',
'Location.name',
'Location.line1',
'Location.line2',
'Location.city',
'Location.postal_code',
'Location.contact',
'Location.phone',
'Order.customer_notes',
'Order.internal_notes',
'Order.external_notes',
'OrderType.name',
'State.abbr'
);

$conditions = array(
'Order.id' => $id
);
return $this->find('first', array('fields' => $fields, 'conditions' => 
$conditions, 'recursive' => 2));
}

The following is output to the view.

*Error: *SQLSTATE[42S22]: Column not found: 1054 Unknown column 'State.abbr' in 
'field list'

*SQL Query: *SELECT `Order`.`id`, `OrderStatus`.`name`, `Location`.`name`, 
`Location`.`line1`, `Location`.`line2`, `Location`.`city`, 
`Location`.`postal_code`, `Location`.`contact`, `Location`.`phone`, 
`Order`.`customer_notes`, `Order`.`internal_notes`, `Order`.`external_notes`, 
`OrderType`.`name`, `State`.`abbr` FROM `intranet`.`orders` AS `Order` LEFT 
JOIN `intranet`.`locations` AS `Location` ON (`Order`.`location_id` = 
`Location`.`id`) LEFT JOIN `intranet`.`order_statuses` AS `OrderStatus` ON 
(`Order`.`order_status_id` = `OrderStatus`.`id`) LEFT JOIN 
`intranet`.`order_types` AS `OrderType` ON (`Order`.`order_type_id` = 
`OrderType`.`id`) LEFT JOIN `intranet`.`shipping_methods` AS `ShippingMethod` 
ON (`Order`.`shipping_method_id` = `ShippingMethod`.`id`) WHERE `Order`.`id` = 
1 LIMIT 1

*Notice: *If you want to customize this error message, create 
app/View/Errors/pdo_error.ctp


I would expect that it would go down one more level to do a join on 
State.id = Location.state_id however that does not appear to be the case. 
 I do have the models set up correctly.  

On Tuesday, November 20, 2012 1:20:38 AM UTC-6, Jeremy Burns wrote:
>
> Got an example?
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com 
>
> On 20 Nov 2012, at 00:44:41, jsundquist > 
> wrote:
>
> I should also state that by default my application is set to recursive = 1 
> but this query I am looking to pass in recursive=2.
>
> On Monday, November 19, 2012 6:42:22 PM UTC-6, jsundquist wrote:
>>
>> Looking through both the book.cakephp.org and also api.cakephp.org for 
>> 2.x they both still mention the ability to pass in recursive as a parameter 
>> however when you do this for the find method it appears it is completely 
>> ignored. Is this functionality missing or deprecated?  I'm doing a find 
>> that needs to go one extra level deeper than normal. I was hoping to just 
>> pass in recursive=>1 for this single query, but so far it looks like it 
>> still only returns direct ascendants.
>
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> cake-php+u...@googlegroups.com .
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>  
>  
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Recursive removed?

2012-11-19 Thread jsundquist
I should also state that by default my application is set to recursive = 1 
but this query I am looking to pass in recursive=2.

On Monday, November 19, 2012 6:42:22 PM UTC-6, jsundquist wrote:
>
> Looking through both the book.cakephp.org and also api.cakephp.org for 
> 2.x they both still mention the ability to pass in recursive as a parameter 
> however when you do this for the find method it appears it is completely 
> ignored. Is this functionality missing or deprecated?  I'm doing a find 
> that needs to go one extra level deeper than normal. I was hoping to just 
> pass in recursive=>1 for this single query, but so far it looks like it 
> still only returns direct ascendants.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Recursive removed?

2012-11-19 Thread jsundquist
Looking through both the book.cakephp.org and also api.cakephp.org for 2.x 
they both still mention the ability to pass in recursive as a parameter 
however when you do this for the find method it appears it is completely 
ignored. Is this functionality missing or deprecated?  I'm doing a find 
that needs to go one extra level deeper than normal. I was hoping to just 
pass in recursive=>1 for this single query, but so far it looks like it 
still only returns direct ascendants.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




How and when to use the root vendor folder

2009-11-09 Thread jsundquist

I'm seeking some advice. I have three sites that are with in one root
folder that share some css, javascript, and images. I would like to be
able to maintain all three items with in the root vendor folder but I
am not exactly sure on how to go about doing it. Do I just drop each
item into their respected folder instead of in the webroot folder and
they will be found? There isn't much documentation on how this works
with in the cakephp documents so I am hoping someone here might have a
good idea.
--~--~-~--~~~---~--~~
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

2009-04-16 Thread jsundquist

Brian is correct. You should use $this->element() to format how you
want each column on your page to be displayed. So you could have a
right, left, and center view in your elements folder then have a
variable set in your function for the view for each column.  Each
column then would could use the respected variable to display the data
where you want it and how you want it formatted.

On Apr 15, 6:58 pm, brian  wrote:
> $content_for_layout is essentially everything in your view, after PHP
> has parsed it. I think what you probably want is to use
> $this->element().
>
> On Wed, Apr 15, 2009 at 7:24 PM, Dave Maharaj :: WidePixels.com
>
>  wrote:
>
> > So if I had  in default.ctp and then in
> > the actual ctp for action say posts/view I could inside the view.ctp have 2
> > variables
> >  and  > $rightContent_for_layout; ?> for each side of the columns and define what
> > would show up there by defining it in the controller view () action?
>
> > Thanks,
>
> > Dave
>
> > -Original Message-
> > From: dr. Hannibal Lecter [mailto:lecter...@gmail.com]
> > Sent: April-15-09 7:28 PM
> > To: CakePHP
> > Subject: 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"
> >  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  >> ?>
>
> >> 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: Run an action with out a view? Is it possible?

2009-04-16 Thread jsundquist

And since I am not technically returning anything for these functions
it shouldn't matter where the sit. But I guess for best practices I
will just place them at the top of each function.  Thank you all for
your help.

On Apr 15, 9:51 pm, "Dr. Loboto"  wrote:
> $this->autoRender = false should be set before return statement,
> that's all.
>
> On Apr 15, 10:09 pm, jsundquist  wrote:
>
> > Thank you all. $this->autoRender = false; is exactly what I was
> > looking for. Does it have to be at the top of the function or can it
> > just be anywhere in the function. I currently have it at the bottom
> > and I haven't noticed any problems as of yet. So does this mean I can
> > possible expect some in the future?
>
> > On Apr 15, 8:26 am, "oliver.pra...@googlemail.com"
>
> >  wrote:
> > > Well what also works is just calling another action in the controller
> > > at the last line ... e.g. $this->index(); etc. ... just make sure that
> > > action is defined with a view.
> > > Its not listed, but it works (it might also not be the cake way of
> > > doing things)
>
> > > On Apr 15, 12:45 am, "Mark (Germany)" 
> > > wrote:
>
> > > > oh, i just relized that this was your first point here^^ my mistake,
> > > > overread that one
>
> > > > On 15 Apr., 00:44, "Mark (Germany)" 
> > > > wrote:
>
> > > > > you forgot one:
>
> > > > > $this->redirect()
>
> > > > > as it always ends with exit() anyway
>
> > > > > but the proper way without redirect would be:
>
> > > > > $this->autoRender = false (anywhere inside that method in the
> > > > > controller)
>
> > > > > On 15 Apr., 00:08, Miles J  wrote:
>
> > > > > > You can either do the following:
>
> > > > > > - Have the delete action redirect once the logic is finished
> > > > > > - Put $this->autoRender = false; at the top of the action
> > > > > > - Put an exit() at the end of the action
>
> > > > > > I personally would do the 1st or 2nd.
>
>
--~--~-~--~~~---~--~~
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: Access to sql queries?

2009-04-16 Thread jsundquist

Best thing to do would be to read through the blog tutorial to give
yourself a better understanding of how that all works.  My guess is
you did something along the lines of
$this->Picture->id = $id;
$this->Picture->read();

If you did something like the above two lines then change it to be
$myPicture = $this->Picture->read();

Then you can use $myPicture to read out all the information stored
with in the $myPicture which is going to be an array.

On Apr 16, 9:01 am, Clemens  wrote:
>  Hi.
>
> I'm new to cakephp. In debug-mode i see a running queries:
>
> SELECT `Picture`.`id`, `Picture`.`project_id`, `Picture`.`name`,
> `Picture`.`description`, `Picture`.`type`, `Picture`.`size`,
> `Picture`.`data`, `Picture`.`created`, `Picture`.`modified` FROM
> `pictures` AS `Picture` WHERE `Picture`.`project_id` = (8)
>
> How can I access this query? I want to display all db entries I can
> find with this query!
>
> Thanks in advance.
>
> Best.
--~--~-~--~~~---~--~~
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: Run an action with out a view? Is it possible?

2009-04-15 Thread jsundquist

Thank you all. $this->autoRender = false; is exactly what I was
looking for. Does it have to be at the top of the function or can it
just be anywhere in the function. I currently have it at the bottom
and I haven't noticed any problems as of yet. So does this mean I can
possible expect some in the future?

On Apr 15, 8:26 am, "oliver.pra...@googlemail.com"
 wrote:
> Well what also works is just calling another action in the controller
> at the last line ... e.g. $this->index(); etc. ... just make sure that
> action is defined with a view.
> Its not listed, but it works (it might also not be the cake way of
> doing things)
>
> On Apr 15, 12:45 am, "Mark (Germany)" 
> wrote:
>
> > oh, i just relized that this was your first point here^^ my mistake,
> > overread that one
>
> > On 15 Apr., 00:44, "Mark (Germany)" 
> > wrote:
>
> > > you forgot one:
>
> > > $this->redirect()
>
> > > as it always ends with exit() anyway
>
> > > but the proper way without redirect would be:
>
> > > $this->autoRender = false (anywhere inside that method in the
> > > controller)
>
> > > On 15 Apr., 00:08, Miles J  wrote:
>
> > > > You can either do the following:
>
> > > > - Have the delete action redirect once the logic is finished
> > > > - Put $this->autoRender = false; at the top of the action
> > > > - Put an exit() at the end of the action
>
> > > > I personally would do the 1st or 2nd.
>
>
--~--~-~--~~~---~--~~
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 -> ExtJS or YUI!

2009-04-15 Thread jsundquist

What kind of advanced js grid are you looking to be able to do?
Currently I am working on a project where we are using cakePHP 1.2 and
ExtJS. We are using the ExtJS datagrids with simple(single query
field) and advanced search(query field for each column). We are also
using Excel exports with the datagrid and paging functions.

So what exactly do you consider advanced js grid?

On Apr 15, 8:30 am, baur79  wrote:
> we want to implement advanced js grid,
> so before use of Ext JS or YUI!
>
> we ask for advice which is better to use with Cakephp
>
> On Apr 5, 11:54 pm, jmcneese  wrote:
>
> > i have done a couple projects that are extjs front-ends backed by
> > cake.  what exactly are you trying to do?
>
> > On Apr 3, 10:35 pm, baur79  wrote:
>
> > > Hi everyone,
>
> > > is there any of you have experience to implement this libraries into
> > > your Cakephp projects.
> > > we want to implement advanced feather of girds of those libraries.
> > > please light on us.
>
> > > Best regards
> > > Baurzhan
>
> > > Kazakhstan / megahosting.kz
>
>
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Run an action with out a view? Is it possible?

2009-04-14 Thread jsundquist

Has anyone come up with a solution where I don't need to have an empty
view for some actions?  For example I have a delete function that I
call. Which its stupid that I need to have an empty view with nothing
in it when calling this function. Is there anyway around this?  This
goes the same for when making ajax post calls using an ext datagrid.
There is nothing that the view actually does but it still requires me
to have a view inorder to reach the controller to get the correct
action to happen.
--~--~-~--~~~---~--~~
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: Newbie requires help! :)

2009-04-13 Thread jsundquist

Although I have not made use of scaffolding you are still required to
use a controller

http://book.cakephp.org/view/105/Scaffolding

On Apr 13, 1:21 pm, Beedge  wrote:
> Hi all.
> I recently decided that I got to get trained up in using a php
> framework as up till now Ive been handcoding everything, and Ive been
> told that its very inefficient! smile.gif
>
> So I installed the latest version of cake on my windows vista machine
> running WAMP.
>
> I got the welcome page showing up ok saying that everything is working
> fine etc. but when I went to do my first tutorial I got the follwing
> error:
>
> Error: Controller could not be found.
>
> The tutorial I was doing 
> ishttp://www.sitepoint.com/article/applicati...opment-cakephp/
>
> Ive got as far as defining the data base and
>
> note.php into apps/models
>
>  class Note extends AppModel
> {
> var $name = 'Note';}
>
> ?>
>
> notes_controller.php into apps/controllers
>
>  class NotesController extends AppController
> {
> var $name = 'Notes';
> var $scaffold;}
>
> ?>
>
> as far as I can make out if I call note I should get the scaffolding
> page, but instead I get the error saying:
> Error: Controller could not be found.
>
> Any ideas on what might be wrong? or on what to try to resolve it?
>
> Thanks
>
> Beedge
--~--~-~--~~~---~--~~
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: Updating different model from controller

2009-04-13 Thread jsundquist

Why not use an auto incremented primary key in the invoice table?

On Apr 13, 12:38 pm, Matt  wrote:
> So I have an invoice model and a setting model. When the user creates
> a new invoice, I need to automatically change the invoice_number to
> one more than the current in the Settings model.
>
> I figured out that the code below will create a new row in my
> database, but I need to figure out how to simply modify the existing
> row. Please help!
>
> $this->Company->Setting->save(array('invoice_number'=>'999'));
> $this->Company->Setting->save();
>
> 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
-~--~~~~--~~--~--~---



Looking for a HABTM solution

2009-04-10 Thread jsundquist

What I am looking to do is kind of complex and I'm not sure the best
way to go about doing it. I have two tables that get joined twice two
each other. Going the same way each time.

table_1 --> table_1_table_2 --> table_2

and

table_1 --> table_1_table_3 --> table 2

They both techically have the same information however the second join
table actually has a few extra columns in it that are needed but use
the primary keys from table 1 and table 2. Is this possible using the
cake framework? If I was to just write the statement myself I know I
could do it but don't know how CakePHP handles things like 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: Putting a label on same line as an input field

2009-04-08 Thread jsundquist

Wouldn't you want all labels in side a form to appear on the left? If
so then why not do something along the lines of
label {
float: left;
width: 75px;
display: block;
clear: left;
text-align: left;
cursor: hand;
}

On Apr 8, 6:31 am, Dardo Sordi Bogado  wrote:
> Assign some specific css selector (setting an id or class in the
> wrapping div should work), then set label { display: inline } or float
> the things left...
>
> $form->input('lefty-input', array('div' =>array('id' => 'make-me-left')));
>
> HTH,
> - Dardo
>
> On Wed, Apr 8, 2009 at 8:26 AM, Danny Lieberman  wrote:
>
> > This is sort of a classic css question but I have not been able to
> > position an label on the left side of an input field - it always
> > slides to the top.  When I did get the label on the left-it impacted
> > the layout of the entire form.
>
> > br
> > Danny
--~--~-~--~~~---~--~~
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 right way to pass vars from a view to the layout?

2009-04-08 Thread jsundquist

Why not pass something from the controller to the layout and use a
beforeRender?

On Apr 8, 8:12 am, the_woodsman  wrote:
> Exactly - the layout renders an analytics element, but it can pass it
> a variable that was set in the actual view.
>
> On Apr 8, 1:40 pm, John Andersen  wrote:
>
> > Thanks for trying :)
>
> > Do I understand correctly, that you are invoking/calling/whatever an
> > element (Google Analytics) from the layout?
> >    John
>
> > On Apr 8, 2:27 pm, the_woodsman  wrote:
>
> > > John, let me give it another go!
>
> > > Googl analytics is still my best example.
>
> > > I want every single page to have the basic analytics snippet.
> > > I really don't want to have this in every single view- it'd be a big
> > > job to go through all the existing views and add the call to render
> > > the element (not very DRY), it makes my views more cluttered, and it
> > > introduces the risk that pages are deployed without the snippet,
> > > placing the burden on the developers to know about these snippets that
> > > have to be placed in every view they create!
>
> > > However, some pages need to completely override the default version in
> > > the layout.
> > > For example, analytics doesn't auto track 40x/50x HTTP responses, so I
> > > want to change the analytics code for specific views.
>
> > > So right now, my layout renders the analytics element, passing it a
> > > variable form viewVars if necessary.
>
> > > Then, my error page for 404s etc sets this variable to a custom value
> > > ("error-404") so we can track how often our users hit error pages.
>
> > > This technique is DRY (no unnecessary repetition of the same snippet),
> > > employs convention over config (the convention is analytics is handled
> > > in the layout, unless you're dealing with a special case), and there's
> > > no risk of analytics not being included on a page.
>
> > > None of the suggestions so far seem as elegant as this...?
>
> > [snip]
--~--~-~--~~~---~--~~
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: simple grid paginate and search, sort

2009-04-06 Thread jsundquist

Here is a good place to start.

http://www.ntatd.org/mark/?p=29

Then read this tutorial as well

http://www.ntatd.org/mark/?p=32

On Apr 6, 11:28 am, loguKK  wrote:
> Is there simple grid paginate with search and sort examples using
> CakePHP 1.2
--~--~-~--~~~---~--~~
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 elements anywhere.

2009-04-06 Thread jsundquist

What are you using to call the elements? I you can all any element
from any page just by doing

element('(folder)/(file)');?>

On Apr 6, 9:59 am, "gaurav.v.sharma" 
wrote:
> I created a simple element for displaying the topics list. This
> element is working fine under the urlhttp://localhost/webapp/topics
> but it is not working in the home page.http://localhost/webapp
>
> I mean the element contents are not displayed on the home page as they
> are displayed on the topics page.
>
> Please 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: insert multiple chekbox values

2009-04-06 Thread jsundquist

You should be able just do a $this->Moviegenre->save($this->data)

The save function will loop through your array and save all the data
into the correct fields along with the value set by your check box.

On Apr 6, 4:10 am, Ranju  wrote:
> hello i want to  insert  multiple chekbox values...
>
> View File
>
> input('Moviegenre.genreid[]',array('label'=>false,
> 'type'=>'checkbox','multiple'=>true,'value'=>$genre['Genre']['id'])); ?
>
>
>
> Controllercode
>
> $genreid=       $this->data['Moviegenre']['genreid'];
>
>                 foreach($genreid as $key => $value)
>                 {
>                 $query = "insert into moviegenres(genreid)values($value)";
>                 $update = $this->Moviegenre->query($query);
>
>                 }
>
> Its not work
--~--~-~--~~~---~--~~
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: Load a Behavior on every model

2009-04-05 Thread jsundquist

So add the var $actsAs = array(); to the AppModel is your suggestion?

On Apr 5, 4:46 pm, Marcelo Andrade  wrote:
> On Sun, Apr 5, 2009 at 6:01 PM, jsundquist  wrote:
>
> > What is the best way apply a behavior to all models?  I have two
> > custom behaviors that I would like to apply to all models.  Whats teh
> > best way of getting that done?  I know i can apply them to each
> > individual model using $actsAs. Can I apply the same method to the
> > AppModel instead of the individual models?
>
> Yes.  Apply the behavior to AppModel.
>
> Best regards.
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105
>
> http://mfandrade.wordpress.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
-~--~~~~--~~--~--~---



Load a Behavior on every model

2009-04-05 Thread jsundquist

What is the best way apply a behavior to all models?  I have two
custom behaviors that I would like to apply to all models.  Whats teh
best way of getting that done?  I know i can apply them to each
individual model using $actsAs. Can I apply the same method to the
AppModel instead of the individual models?
--~--~-~--~~~---~--~~
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: Time Ranges

2009-03-24 Thread jsundquist

I'm not sure that work work within cake though. Unless it was added as
a helper to extend the form helper. Im not sure though. I will keep
that in mind.

On Mar 24, 1:16 pm, mscdex  wrote:
> On Mar 24, 12:28 pm, jsundquist  wrote:
>
> > I have a form that has two time fields.  I am looking to find out if
> > it is possible to specify that the field only contains time from say
> > 9am until 9pm instead of a full 24 hour period? Is this even possible.
> > Looking in Trac there is a ticket in there for minimum and maximum
> > dates but nothing as far as time is concerned.
>
> There isn't anything in core that allows this, but googling found a
> custom function that does what you 
> want:http://codingforums.com/showthread.php?t=87787
--~--~-~--~~~---~--~~
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: label into form->input

2009-03-24 Thread jsundquist

You could also just do a
text('MyModel.field'); ?>
if you just need a text field. Otherwise the above example of doing
'label'=> false will work as well.

On Mar 24, 8:45 am, Marcelo Andrade  wrote:
> On Tue, Mar 24, 2009 at 7:23 AM, kicaj  wrote:
>
> > How create input like this:
> > 
> >    something
> >    
> > 
>
> > It's possible?
>
> I had this same doubt sometime ago[1].  As Matt's said in that
> topic, you could do this:
>
> My label: input('MyModel.field'
> , array ('label'=> false)); ?>
>
> But you should consider extend your form helper and redefine
> your definition[2].
>
> Best regards.
>
> [1]http://tinyurl.com/d2bs4s
> [2]http://bakery.cakephp.org/articles/view/overriding-specific-html-tags...
>
> --
> MARCELO DE F. ANDRADE
> Belem, PA, Amazonia, Brazil
> Linux User #221105
>
> http://mfandrade.wordpress.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
-~--~~~~--~~--~--~---



Time Ranges

2009-03-24 Thread jsundquist

I have a form that has two time fields.  I am looking to find out if
it is possible to specify that the field only contains time from say
9am until 9pm instead of a full 24 hour period? Is this even possible.
Looking in Trac there is a ticket in there for minimum and maximum
dates but nothing as far as time is concerned.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



copying data to hidden fields

2009-03-13 Thread jsundquist

I am currently working on an application that I am in need of
populating fields with data that users are entering data into.
However I would like to just copy that text from the field they are
entering text into into the database field that I have instead of
making them type the data in twice. Is this possible? Or am I going to
have to require them to enter the data in twice?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---