Re: Simple assoication not working

2010-05-04 Thread Don Drake
I'm glad you gave the 'hint' because I was looking at that linked page and
the problem code and had no idea what was wrong (being new enough to still
have to look this stuff up).

Here's the page that deals with the file naming problem:
http://book.cakephp.org/view/23/File-and-Classname-Conventions

Don

On Tue, May 4, 2010 at 12:45 AM, WebbedIT  wrote:

>
> > Have another look at your naming conventions, most notably those for your
> > models.
> >
> > http://book.cakephp.org/view/24/Model-and-Database-Conventions
>
> Hint: Your model filenames should be singular.
>
> When first learning CakePHP and any problems arise it's often down to
> a deviation from the conventions so learn them inside out and stick to
> them whenever possible.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: 404 error when I call controller

2010-05-03 Thread Don Drake
A 404 error? I'm gonna guess that your .htaccess file is missing.

Don

On Mon, May 3, 2010 at 7:49 AM, gannher  wrote:

> Hello
>
> I am trying to build a controller but when i call it, i have a 404
> code error.
>
> Here the controller "logins":
>
>  class LoginsController extends AppController {
>var $name = 'Logins';
>var $uses = '';
>public function display() {
>
>}
> }
>
> ?>
>
> Here routes.php:
>
> Router::connect('/', array('controller' => 'homes', 'action' =>
> 'index'));
> Router::connect('/login', array('controller' => 'logins', 'action' =>
> 'display'));
>
>
>
> I try to call my controller with this url:
>
> http://www.my_url/login
>
>
> Log of apache (error.log):
> [Mon May 03 18:38:50 2010] [error] [client ] File does not
> exist: /home/cake/app/webroot/login, referer: 
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 problem with 15 minute blog in Cake 1.3

2010-05-02 Thread Don Drake
The controller has the 'params' property. If you output this:
debug($this->params); //from your view
I believe you should see your id showing in the 'pass' array if everything
is working. If it's there, this will confirm the value is getting all the
way in to your controller or not. If it's there, then to problem isn't in
the mod-rewrite or anything early in the process.

Don

On Sat, May 1, 2010 at 5:40 PM, Matt  wrote:

> Well, the release said "stable' but I am trying to figure out if it is
> me, my configuration or what.
>
> I am using Apache2 on Windows Vista and PHP 5.2.10.  I seem to have a
> possible mod_rewrite problem but I am not sure.   It is obvious that
> the ID portion of the URL is not being handled correctly for some
> reason (id:N).  When I go to view or delete, nothing happens because
> the ID is not passed.  I have checked and double checked.  I have
> followed the tutorial to the letter.
>
> Where do I look? Any suggestions?
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Problem direct linking files located in webroot

2010-04-28 Thread Don Drake
This looks like it might be a problem with your routes. The error suggests
cake is looking for the Files controller as you would expect given your url.
I had some routes that worked in 1.2.6 that stopped working in 1.3. A little
messing around and their back on line.

Don

On Wed, Apr 28, 2010 at 12:49 PM, jgonca wrote:

> Hi,
>
> I'm trying to direct link files located in a folder inside my cake app
> webroot but each time I try to access a file I get a blank page and I
> receive an e-mail from my cake app with the following message:
>
> "Missing Controller
>
> Error: FilesController could not be found.(...)"
>
> The files are located, more precisely, in: cake/app/webroot/files/
> mecanica/pendulum/file.jnlp.
> I don't know the possible origin of this error since this was working
> fine in cake 1.2.7.
>
> Can you help me?
>
> Thanks for your help.
>
> Cheers,
>
> João
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: hI friends

2010-04-26 Thread Don Drake
I didn't go through ALL that code, but it seems that if you pulled
collections of child nodes  (http://www.w3schools.com/jsref/dom_obj_all.asp)
rather than getting
>   var child=listElement.firstChild;
and trying to iterate over siblings, you might be able to simplify your code
a great deal and make it easier to get it operating.

The logic of starting with firstChild as the beginning of your iteration
seems very dodgy.

Don

On Mon, Apr 26, 2010 at 9:15 AM, cricket  wrote:

> You probably won't get much response here if all you have to say is
> that something is "not working properly" and then post a lot of
> javascript code. Are you sure this is even a CakePHP issue?
>
> On Apr 26, 2:53 am, rakeshyadav rakeshyadav
>  wrote:
> > Hi all,
> >
> >  I am using javascript in my cake view page and trying to call
> that
> > functions they are not working properly please help me.
> >
> >  my code is
> > 
> > 
> >
> > 
> > window.onload = makeCollapsible;
> >
> > /* CLOSED_IMAGE - the image to be displayed when the sublists are
> closed
> >  * OPEN_IMAGE   - the image to be displayed when the sublists are
> opened
> >  */
> > CLOSED_IMAGE='img/plus.jpg';
> > image('plus.jpg');
> >  ?>
> > OPEN_IMAGE='img/minus.jpg';
> >
> > /* makeCollapsible - makes a list have collapsible sublists
> >  *
> >  * listElement - the element representing the list to make
> collapsible
> >  */
> > function makeCollapsible(){
> >
> >   listElement = document.getElementById('computers');
> >
> >   // removed list item bullets and the sapce they occupy
> >   listElement.style.listStyle='none';
> >   listElement.style.marginLeft='0';
> >   listElement.style.paddingLeft='0';
> >
> >   // loop over all child elements of the list
> >   var child=listElement.firstChild;
> >   while (child!=null){
> >
> > // only process li elements (and not text elements)
> > if (child.nodeType==1){
> >
> >   // build a list of child ol and ul elements and hide them
> >   var list=new Array();
> >   var grandchild=child.firstChild;
> >   while (grandchild!=null){
> > if (grandchild.tagName=='OL' || grandchild.tagName=='UL'){
> >   grandchild.style.display='none';
> >   list.push(grandchild);
> > }
> > grandchild=grandchild.nextSibling;
> >   }
> >
> >   // add toggle buttons
> >   var node=document.createElement('img');
> >   node.setAttribute('src',CLOSED_IMAGE);
> >   node.setAttribute('class','collapsibleClosed');
> >   node.onclick=createToggleFunction(node,list);
> >   child.insertBefore(node,child.firstChild);
> >
> > }
> >
> > child=child.nextSibling;
> >   }
> >
> > }
> >
> > /* createToggleFunction - returns a function that toggles the sublist
> > display
> >  *
> >  * toggleElement  - the element representing the toggle gadget
> >  * sublistElement - an array of elements representing the sublists
> that
> > should
> >  *  be opened or closed when the toggle gadget is
> > clicked
> >  */
> > function createToggleFunction(toggleElement,sublistElements){
> >
> >   return function(){
> >
> > // toggle status of toggle gadget
> > if (toggleElement.getAttribute('class')=='collapsibleClosed'){
> >   toggleElement.setAttribute('class','collapsibleOpen');
> >   toggleElement.setAttribute('src',OPEN_IMAGE);
> > }else{
> >   toggleElement.setAttribute('class','collapsibleClosed');
> >   toggleElement.setAttribute('src',CLOSED_IMAGE);
> > }
> >
> > // toggle display of sublists
> > for (var i=0;i >   sublistElements[i].style.display=
> >   (sublistElements[i].style.display=='block')?'none':'block';
> > }
> >
> >   }
> >
> > }
> >
> > function edit_store(sel_stores, grp_name, grp_id)
> > {
> > document.getElementById('selected_stores').value = sel_stores;
> > document.getElementById('group_name').value = grp_name;
> > document.getElementById('sgid').value = grp_id;
> >
> > document.getElementById('idd').value = '153';
> > document.getElementById('store_grid').submit();
> > }
> > 
> >
> > 
> > function create_new_group()
> > {
> > document.getElementById('idd').value = '153';
> > document.getElementById('store_grid').submit();}
> >
> > 
> >
> >  
> > link('Gauteng
> > Division', '#',
> >
> array(
> >
> > 'class'=>'url2_font',
> >
> > 'font-fomily'=>'Verdena',
> >
> > 'onclick'=>'edit_store('3_4_',
> >
> > 'Gauteng Division', '3'));
> >?>
> >
> > 
> >
> > Check out the new CakePHP Questions sitehttp://cakeqs.org

Re: Undefined Property error in ACL tutorial (1.3.0-RC4)

2010-04-25 Thread Don Drake
cricket,

Though that didn't directly solve the problem, it put me onto the solution.
Reading the section again I realized it said:
"flash() was the only helper method that auto outputted"
Um, Helper method. I had the Session component working but not the session
helper.

Don

On Sun, Apr 25, 2010 at 1:12 PM, cricket  wrote:

> On Apr 25, 3:40 pm, dreamingmind  wrote:
> > I haven't been able to figure out why I'm getting
> > Undefined property: View::$Session [APP/views/layouts/default.ctp,
> > line 43]
> >
> > I've got the the line
> >   var $components = array('Acl', 'Auth', 'Session');
> > in app_controller.php which is stored in app/ not app/controllers/.
> >
> > The line causing the error is
> > Session->flash(); ?>
> > in default.ctp
>
> echo $session->flash();
>
> http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Null value for tinyint field

2009-05-12 Thread Drake

I'm developing my first CakePHP and this is my first post here, so
bare with me. Thanks in advance for any help.

I have a form with several yes/no questions. I chose to store these in
the database as tinyint(1) (using mysql), since they are fundamentally
boolean values. By default, CakePHP renders these fields as
checkboxes. I chose to override this functionality and display these
questions with two yes/no radio buttons, so "no" and "nothing
selected" can be distinguished. This setup is working great if one of
the two options is selected.

I'm having problems getting Cake to do the right thing, however, when
neither radio button is selected. In this case, I would like to store
NULL in the database, to represent the fact that neither option was
selected. After posting, $this->data correctly shows empty values for
the fields with neither option selected. But Cake is automatically
writing "0" to all the tinyint fields that aren't explicitly set to
"1". This includes all the fields with no option selected.

OK, so my question is, is there any way to stop cake from writing "0"
to a tinyint field by default, if no value is set in $this->data?

If this isn't possible, I think I can probably change all these
tinyint fields into enums with "yes" and "no" as options, or something
along those lines. If possible, though, I'd like to stick to tinyints
since they're more appropriate for the data.

Thanks for the 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
-~--~~~~--~~--~--~---