Re: Localizing autherror and loginerror

2008-09-12 Thread Braindead

Hi guys,

after spending some more time I solved my problem with authError and
loginError messages of the Auth component only displaying in the
default language.
Just in case somebody has the same problem I post the solution. :-)

This is my app_controller.php file where only the L10n part and the
messages are of interest:


uses('L10n');

class AppController extends Controller {
var $components = array('Auth');

function beforeFilter() {
$this-L10n = new L10n();
$this-L10n-get($this-Session-read('Config.language'));


if (isset($this-Auth)) {
$this-Auth-fields = array('username' = 'email', 
'password' =
'password');
$this-Auth-userScope = array('activated' = 1);
$this-Auth-loginAction = array('controller' = 
'users', 'action'
= 'login');
$this-Auth-loginRedirect = array('controller' = 
'pages',
'action' = 'display', 'home');
$this-Auth-logoutRedirect = array('controller' = 
'users',
'action' = 'login', 'admin' = false);
$this-Auth-loginError = __('auth_loginerror', true);
$this-Auth-authError = __('auth_autherror', true);
$this-Auth-autoRedirect = true;
$this-Auth-authorize = 'controller';
}

}

function isAuthorized() {
return true;
}
}
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: ajax jquery quicksave?

2008-09-12 Thread David C. Zentgraf

Executing a controller action is just doing a page request.
If you type /myapp/controller/hide into the browser,  
Controller::hide() will be executed.
If you do an AJAX request to /myapp/controller/hide,  
Controller::hide() will be executed just the same.

Where's the problem? :-3

On 12 Sep 2008, at 14:56, rocket wrote:


 ok i've been looking online for several hours now and can't find
 anything, so here i am!

 basically I have an announcment div (#announcement) that I show on my
 page. The user can click a text link, don't show and I want it to
 slideUp, then save their setting (in a DB).

 My problem is accessing the controller to get into the db. I can't
 figure out how to send a request to the controller to save the item.

 In the best world, when they click Don't Show the textbox will
 slideUp, it will execute my hide() controller action, and still be on
 the same page.

 Can anyone give me some guidance at all?
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Localizing autherror and loginerror

2008-09-12 Thread David C. Zentgraf

I had the same problem a while back, search the group for it.
The problem is that the first time a translation is done, i.e. the  
__() function is used, the language is locked and cannot be changed  
anymore for the rest of the page execution. (Actually, rightly so,  
otherwise you might get half your page in English and the other half  
in German.)

Point being, if you want to change the language, make that the very  
first thing you do in your app.

Fröhliches Backen!

On 12 Sep 2008, at 15:01, Braindead wrote:


 Hi guys,

 after spending some more time I solved my problem with authError and
 loginError messages of the Auth component only displaying in the
 default language.
 Just in case somebody has the same problem I post the solution. :-)

 This is my app_controller.php file where only the L10n part and the
 messages are of interest:


 uses('L10n');

 class AppController extends Controller {
   var $components = array('Auth');

   function beforeFilter() {
   $this-L10n = new L10n();
   $this-L10n-get($this-Session-read('Config.language'));


   if (isset($this-Auth)) {
   $this-Auth-fields = array('username' = 'email', 
 'password' =
 'password');
   $this-Auth-userScope = array('activated' = 1);
   $this-Auth-loginAction = array('controller' = 
 'users', 'action'
 = 'login');
   $this-Auth-loginRedirect = array('controller' = 
 'pages',
 'action' = 'display', 'home');
   $this-Auth-logoutRedirect = array('controller' = 
 'users',
 'action' = 'login', 'admin' = false);
   $this-Auth-loginError = __('auth_loginerror', true);
   $this-Auth-authError = __('auth_autherror', true);
   $this-Auth-autoRedirect = true;
   $this-Auth-authorize = 'controller';
   }

   }

   function isAuthorized() {
   return true;
   }
 }
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: ajax jquery quicksave?

2008-09-12 Thread rocket

Well I have

---
controller
--
function hide() {
echo hello;
}

---
jquery
---
$(a.hide).click(function() {
$.post('hide', {}, function() {
alert('saved.');
});
return false;
}


but when I click the link it doesn't output hello. the alert shows
but nothing outputs.

any thoughts =/?

ALSO does anyone know if the post URL parameter can be a full http://
link?


On Sep 12, 2:23 am, David C. Zentgraf [EMAIL PROTECTED] wrote:
 Executing a controller action is just doing a page request.
 If you type /myapp/controller/hide into the browser,
 Controller::hide() will be executed.
 If you do an AJAX request to /myapp/controller/hide,
 Controller::hide() will be executed just the same.

 Where's the problem? :-3

 On 12 Sep 2008, at 14:56, rocket wrote:



  ok i've been looking online for several hours now and can't find
  anything, so here i am!

  basically I have an announcment div (#announcement) that I show on my
  page. The user can click a text link, don't show and I want it to
  slideUp, then save their setting (in a DB).

  My problem is accessing the controller to get into the db. I can't
  figure out how to send a request to the controller to save the item.

  In the best world, when they click Don't Show the textbox will
  slideUp, it will execute my hide() controller action, and still be on
  the same page.

  Can anyone give me some guidance at all?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: ajax jquery quicksave?

2008-09-12 Thread David C. Zentgraf

First, whatever comes back from the server in an AJAX request will  
only be available in request.responseText, so you'll have to alert()  
that instead of 'saved'.

Second, the URL is exactly the same as for any other URL and any link  
on the page, it's relative to the current page, absolute from the  
server root (/controller/action) or absolute absolute (http://).  
I generally use the $html-url() function to get the URL for the right  
controller/action and echo that into the JS.

Chrs,
Dav

On 12 Sep 2008, at 15:43, rocket wrote:


 Well I have

 ---
 controller
 --
 function hide() {
echo hello;
 }

 ---
 jquery
 ---
 $(a.hide).click(function() {
   $.post('hide', {}, function() {
   alert('saved.');
   });
   return false;
 }


 but when I click the link it doesn't output hello. the alert shows
 but nothing outputs.

 any thoughts =/?

 ALSO does anyone know if the post URL parameter can be a full http://
 link?


 On Sep 12, 2:23 am, David C. Zentgraf [EMAIL PROTECTED] wrote:
 Executing a controller action is just doing a page request.
 If you type /myapp/controller/hide into the browser,
 Controller::hide() will be executed.
 If you do an AJAX request to /myapp/controller/hide,
 Controller::hide() will be executed just the same.

 Where's the problem? :-3

 On 12 Sep 2008, at 14:56, rocket wrote:



 ok i've been looking online for several hours now and can't find
 anything, so here i am!

 basically I have an announcment div (#announcement) that I show on  
 my
 page. The user can click a text link, don't show and I want it to
 slideUp, then save their setting (in a DB).

 My problem is accessing the controller to get into the db. I can't
 figure out how to send a request to the controller to save the item.

 In the best world, when they click Don't Show the textbox will
 slideUp, it will execute my hide() controller action, and still be  
 on
 the same page.

 Can anyone give me some guidance at all?
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: ajax jquery quicksave?

2008-09-12 Thread rocket

Gotcha.
Didn't realize the response was only available in the
request.responseText. New to ajax and didn't quite fully understand
the protocol. -_-


On Sep 12, 3:09 am, David C. Zentgraf [EMAIL PROTECTED] wrote:
 First, whatever comes back from the server in an AJAX request will
 only be available in request.responseText, so you'll have to alert()
 that instead of 'saved'.

 Second, the URL is exactly the same as for any other URL and any link
 on the page, it's relative to the current page, absolute from the
 server root (/controller/action) or absolute absolute (http://).
 I generally use the $html-url() function to get the URL for the right
 controller/action and echo that into the JS.

 Chrs,
 Dav

 On 12 Sep 2008, at 15:43, rocket wrote:



  Well I have

  ---
  controller
  --
  function hide() {
 echo hello;
  }

  ---
  jquery
  ---
  $(a.hide).click(function() {
 $.post('hide', {}, function() {
 alert('saved.');
 });
 return false;
  }

  but when I click the link it doesn't output hello. the alert shows
  but nothing outputs.

  any thoughts =/?

  ALSO does anyone know if the post URL parameter can be a full http://
  link?

  On Sep 12, 2:23 am, David C. Zentgraf [EMAIL PROTECTED] wrote:
  Executing a controller action is just doing a page request.
  If you type /myapp/controller/hide into the browser,
  Controller::hide() will be executed.
  If you do an AJAX request to /myapp/controller/hide,
  Controller::hide() will be executed just the same.

  Where's the problem? :-3

  On 12 Sep 2008, at 14:56, rocket wrote:

  ok i've been looking online for several hours now and can't find
  anything, so here i am!

  basically I have an announcment div (#announcement) that I show on
  my
  page. The user can click a text link, don't show and I want it to
  slideUp, then save their setting (in a DB).

  My problem is accessing the controller to get into the db. I can't
  figure out how to send a request to the controller to save the item.

  In the best world, when they click Don't Show the textbox will
  slideUp, it will execute my hide() controller action, and still be
  on
  the same page.

  Can anyone give me some guidance at all?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



CakePHP causes 500 error b/c of syntax error - help?

2008-09-12 Thread Mike

Hello!

My problem is that when I put a syntax error into my .php file {say,
instead of writing Configure::write('debug', 2); , I write
Configure::write('debug', }, with CakePHP, I'm getting an HTTP
response code of 500 (internal server error).  When I use a raw .php
file  do something comparable, I get that page telling me what the
syntax errors are.

FWIW, CakePHP used to give me syntax errors in the returned page, too,
but it's not doing so now.  It's been about a month since I've done
anything with PHP, so it's possible that I changed something, but I
don't remember seeing this the last time I did something in (Cake)PHP.

I'm running XAMPP on WindowsXP, if that helps.  Cake 1.2 Beta, if that
makes a difference.

My php.ini has the error_reporting=E_ALL, and display_errors = On, and
is also logging the errors to a file, for good measure.  My httpd.conf
appears to be set up ok (I think) - it's got the error file set up,
and a LogLevel of debug.  However, I'm not seeing the syntax errors in
the output (i.e., in the browser), nor am I seeing the errors listed
in any log files.  apache/logs/access.log tells me that the request
ended with 500, but nothing else.  apache/logs/error.log appears to
just tell me that the server has started up.  CakePHP/ST/app/tmp/logs/
error.log appears to have no new entries, either.

The problem appears to be Cake-specific (the raw PHP file displays
errors ok), and I *think* that everything's configured correctly, but
pages with syntax errors come back as blank 500's.  The same file,
without the syntax error, renders completely correctly.  At this
point, I'm kind of at a loss for what to try next, and was hoping that
someone here might have an idea

So, having said all that - does anyone have an idea for what I might?
Any links, or ideas, would be greatly appreciated!
(And of course, if you happen to know exactly how to fix this, that
would be appreciated, too :)  )

Thanks!
--Mike
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



newbie syntax question

2008-09-12 Thread .
Hi

I am trying to convert the Remote Service (helloworld-server.php) in the
following tutorial (in the URL below) to cakephp Component-compatible. I am
struggling with the correct syntax, however. In the server-register(..)
method, the first parameter should be the name of the service function. In
this case, the function is hello. How would I call this hello function?

Thanks for any help!



*This is the tutorial:
**http://www.oclipa.com/university/nusoap/3.php*http://www.oclipa.com/university/nusoap/3.php



*This is what I have in my Cake NusoapComponent:*

function serverMain()
 {
  $this-server= new nusoap_server();
  *$this-server-register('hello',*// method name
   array('name' = 'xsd:string'),// input parameters
   array('return' = 'xsd:string'),  // output parameters
   'urn:hellowsdl',  // namespace
   'urn:hellowsdl#hello',// soapaction
   'rpc',// style
   'encoded',// use
   'Says hello to the caller'// documentation
  );
  $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA :
'';
  $this-server-service($HTTP_RAW_POST_DATA);

 }

 // This is the method
 *function hello*($input) {
  $output_string = 'Hello ' . $input['firstname'] .
 '. You are ' . $input['age'] . ' years old.';

  if ( $input['age'] = 18 ) { $allow = 1; }

  $output = array(
 'output_string' = $output_string,
 'allow' = $allow
 );

  return new soapval('return', 'HelloInfo', $output, false, 'urn:AnyURN');
 }

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: newbie syntax question

2008-09-12 Thread .
This is the error i get:

SOAP-ENV:Clientmethod apos;apos; not defined in service]

On Fri, Sep 12, 2008 at 1:27 AM, . [EMAIL PROTECTED] wrote:

  Hi

 I am trying to convert the Remote Service (helloworld-server.php) in the
 following tutorial (in the URL below) to cakephp Component-compatible. I am
 struggling with the correct syntax, however. In the server-register(..)
 method, the first parameter should be the name of the service function. In
 this case, the function is hello. How would I call this hello function?

 Thanks for any help!



 *This is the tutorial: 
 **http://www.oclipa.com/university/nusoap/3.php*http://www.oclipa.com/university/nusoap/3.php



 *This is what I have in my Cake NusoapComponent:*

 function serverMain()
  {
   $this-server= new nusoap_server();
   *$this-server-register('hello',*// method name
array('name' = 'xsd:string'),// input parameters
array('return' = 'xsd:string'),  // output parameters
'urn:hellowsdl',  // namespace
'urn:hellowsdl#hello',// soapaction
'rpc',// style
'encoded',// use
'Says hello to the caller'// documentation
   );
   $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA :
 '';
   $this-server-service($HTTP_RAW_POST_DATA);

  }

  // This is the method
  *function hello*($input) {
   $output_string = 'Hello ' . $input['firstname'] .
  '. You are ' . $input['age'] . ' years old.';

   if ( $input['age'] = 18 ) { $allow = 1; }

   $output = array(
  'output_string' = $output_string,
  'allow' = $allow
  );

   return new soapval('return', 'HelloInfo', $output, false, 'urn:AnyURN');
  }


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: newbie syntax question

2008-09-12 Thread .
basically the problem is in the examples I've seen on nusoap server, they
are not in a Class. I'd like to put it into a class. How would I do this?

On Fri, Sep 12, 2008 at 1:44 AM, . [EMAIL PROTECTED] wrote:

  This is the error i get:

 SOAP-ENV:Clientmethod apos;apos; not defined in service]

   On Fri, Sep 12, 2008 at 1:27 AM, . [EMAIL PROTECTED] wrote:

  Hi

 I am trying to convert the Remote Service (helloworld-server.php) in the
 following tutorial (in the URL below) to cakephp Component-compatible. I am
 struggling with the correct syntax, however. In the server-register(..)
 method, the first parameter should be the name of the service function. In
 this case, the function is hello. How would I call this hello function?

 Thanks for any help!



 *This is the tutorial: 
 **http://www.oclipa.com/university/nusoap/3.php*http://www.oclipa.com/university/nusoap/3.php



 *This is what I have in my Cake NusoapComponent:*

 function serverMain()
  {
   $this-server= new nusoap_server();
   *$this-server-register('hello',*// method name
array('name' = 'xsd:string'),// input parameters
array('return' = 'xsd:string'),  // output parameters
'urn:hellowsdl',  // namespace
'urn:hellowsdl#hello',// soapaction
'rpc',// style
'encoded',// use
'Says hello to the caller'// documentation
   );
   $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA :
 '';
   $this-server-service($HTTP_RAW_POST_DATA);

  }

  // This is the method
  *function hello*($input) {
   $output_string = 'Hello ' . $input['firstname'] .
  '. You are ' . $input['age'] . ' years old.';

   if ( $input['age'] = 18 ) { $allow = 1; }

   $output = array(
  'output_string' = $output_string,
  'allow' = $allow
  );

   return new soapval('return', 'HelloInfo', $output, false, 'urn:AnyURN');
  }




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



frontend texts spread around the application layers

2008-09-12 Thread stefanski

Fellows of the cake ring,

I come to the point where I thought about having common notification
texts in a more central position in my application. Right now its
pretty mixed like:
- validation messages in the models
- notifications in the session-flash, which are set in the controller
- and a whole lot of other common texts in my textHelper in several
arrays

I thought, having them all in the View layer makes more sense, how do
you guys do that?

Use text keys for validation texts and write my own helper to display
them? But how to solve the session flash issue?

Thanks and keep up the good cake spirit :-)

Stefanski
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Localizing autherror and loginerror

2008-09-12 Thread Marcin Domanski
why not translate these in beforeRender ? :)
HTH,
--
Marcin Domanski
http://kabturek.info



On Fri, Sep 12, 2008 at 8:28 AM, David C. Zentgraf [EMAIL PROTECTED] wrote:

 I had the same problem a while back, search the group for it.
 The problem is that the first time a translation is done, i.e. the
 __() function is used, the language is locked and cannot be changed
 anymore for the rest of the page execution. (Actually, rightly so,
 otherwise you might get half your page in English and the other half
 in German.)

 Point being, if you want to change the language, make that the very
 first thing you do in your app.

 Fröhliches Backen!

 On 12 Sep 2008, at 15:01, Braindead wrote:


 Hi guys,

 after spending some more time I solved my problem with authError and
 loginError messages of the Auth component only displaying in the
 default language.
 Just in case somebody has the same problem I post the solution. :-)

 This is my app_controller.php file where only the L10n part and the
 messages are of interest:


 uses('L10n');

 class AppController extends Controller {
   var $components = array('Auth');

   function beforeFilter() {
   $this-L10n = new L10n();
   $this-L10n-get($this-Session-read('Config.language'));


   if (isset($this-Auth)) {
   $this-Auth-fields = array('username' = 'email', 
 'password' =
 'password');
   $this-Auth-userScope = array('activated' = 1);
   $this-Auth-loginAction = array('controller' = 
 'users', 'action'
 = 'login');
   $this-Auth-loginRedirect = array('controller' = 
 'pages',
 'action' = 'display', 'home');
   $this-Auth-logoutRedirect = array('controller' = 
 'users',
 'action' = 'login', 'admin' = false);
   $this-Auth-loginError = __('auth_loginerror', true);
   $this-Auth-authError = __('auth_autherror', true);
   $this-Auth-autoRedirect = true;
   $this-Auth-authorize = 'controller';
   }

   }

   function isAuthorized() {
   return true;
   }
 }
 


 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $html-link default titles

2008-09-12 Thread RichardAtHome

Which accessibilty checkpoint requires you to have a title attribute
on every hyperlink?

The nearest I can find is checkpoint 13.1:
http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-meaningful-links

13.1 Clearly identify the target of each link. [Priority 2]
Link text should be meaningful enough to make sense when read out of
context -- either on its own or as part of a sequence of links. Link
text should also be terse.
For example, in HTML, write Information about version 4.3 instead of
click here. In addition to clear link text, content developers may
further clarify the target of a link with an informative link title
(e.g., in HTML, the title attribute).

'may' does not mean 'must' ;-)

On Sep 12, 3:10 am, AussieFreelancer [EMAIL PROTECTED]
wrote:
 I can see your point about repeating it twice, I don't understand how
 different accessibility applications work, but I know that it is part
 of the WAI and Section 508 accessibility standards that all href
 elements should have the title attribute, and all images should have
 an alt tag, even if it is empty. This is what has made me think of
 this, as I am a website developer, and to pass these accessibility
 tests, I need to include the title in every link - which is not too
 much of a problem, just that I figure having it as a default would
 reduce the amount of code I need to write :D

 Also, most links will have the same title text as the link text
 anyway, wouldn't they? Certainly with navigation, Home is Home, About
 Us is About us... As I say, I don't understand how the applications
 work exactly, I just want to be able to do what I can to ensure that
 my websites are accessible to as many people as possible.

 Thanks

 Patrick

 On Sep 12, 9:52 am, Adam Royle [EMAIL PROTECTED] wrote:

  You can override cakephp's defualt functionality in your AppHelper if
  you want to do this.

  I don't think it should be the standard, as there are situations where
  you might not want this. Additionally, why do you need to repeat the
  link text in the link title? Won't this effectively cause the
  screenreader to speak the link text twice?

  Cheers,
  Adam

  On Sep 12, 11:38 am, AussieFreelancer

  [EMAIL PROTECTED] wrote:
   I have just done a quick google search, and can't seem to see anything
   about this, but I have been thinking for some time now, that for
   accessibility reasons, wouldn't it make sense for the links to have a
   default title, and even images have an empty alt tag by default? The
   link title could default to the link text, unless a title was
   specified in the options.

   Any thoughts on this, or reasons as to why cakephp doesn't currently
   work like this?

   Thanks

   Patrick
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Small CMS from cakephp

2008-09-12 Thread villas

http://ovencms.tarkvaratehas.ee/
 I registered with them but I'm not able to get a single link to
 download it.

I note that it's also available on CakeForge without registration :-)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: frontend texts spread around the application layers

2008-09-12 Thread Daniel Hofstetter

Hi Stefanski,

 I come to the point where I thought about having common notification
 texts in a more central position in my application. Right now its
 pretty mixed like:
 - validation messages in the models
 - notifications in the session-flash, which are set in the controller
 - and a whole lot of other common texts in my textHelper in several
 arrays

 I thought, having them all in the View layer makes more sense, how do
 you guys do that?

 Use text keys for validation texts and write my own helper to display
 them? But how to solve the session flash issue?

For validation messages you can use something like:

echo $form-input('username',
  array('error' = array(
'required' = 'Username is
required',
'unique'   = 'The username is
already taken')));

Hope that helps!

--
Daniel Hofstetter
http://cakebaker.42dh.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP causes 500 error b/c of syntax error - help?

2008-09-12 Thread [EMAIL PROTECTED]

Hi,
You already covered most suggestion I might have had, but I thought I
would post what I get when I write the same syntax.
My installation of php and CakePHP 1.2 rc2 produces this type of
output for any syntax error:
Parse error: syntax error, unexpected '}' in /Users/martin/Sites/cake/
great/config/core.php on line 43

I am running Apples Apache on a Mac. If I remember correctly the *AMP
setups often offer accelerators for php. Is one of them active in your
setup?

Try to output phpinfo() from inside Cake and compare to a raw
phpinfo without the framework loaded. That could yield some small
configuration change.


Mike wrote:
 Hello!

 My problem is that when I put a syntax error into my .php file {say,
 instead of writing Configure::write('debug', 2); , I write
 Configure::write('debug', }, with CakePHP, I'm getting an HTTP
 response code of 500 (internal server error).  When I use a raw .php
 file  do something comparable, I get that page telling me what the
 syntax errors are.

 FWIW, CakePHP used to give me syntax errors in the returned page, too,
 but it's not doing so now.  It's been about a month since I've done
 anything with PHP, so it's possible that I changed something, but I
 don't remember seeing this the last time I did something in (Cake)PHP.

 I'm running XAMPP on WindowsXP, if that helps.  Cake 1.2 Beta, if that
 makes a difference.

 My php.ini has the error_reporting=E_ALL, and display_errors = On, and
 is also logging the errors to a file, for good measure.  My httpd.conf
 appears to be set up ok (I think) - it's got the error file set up,
 and a LogLevel of debug.  However, I'm not seeing the syntax errors in
 the output (i.e., in the browser), nor am I seeing the errors listed
 in any log files.  apache/logs/access.log tells me that the request
 ended with 500, but nothing else.  apache/logs/error.log appears to
 just tell me that the server has started up.  CakePHP/ST/app/tmp/logs/
 error.log appears to have no new entries, either.

 The problem appears to be Cake-specific (the raw PHP file displays
 errors ok), and I *think* that everything's configured correctly, but
 pages with syntax errors come back as blank 500's.  The same file,
 without the syntax error, renders completely correctly.  At this
 point, I'm kind of at a loss for what to try next, and was hoping that
 someone here might have an idea

 So, having said all that - does anyone have an idea for what I might?
 Any links, or ideas, would be greatly appreciated!
 (And of course, if you happen to know exactly how to fix this, that
 would be appreciated, too :)  )

 Thanks!
 --Mike
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



BeforeFilter

2008-09-12 Thread nayan

I am using one controller for  both admin and front user. i have use
beforeFilter funtion to check admin session .so it will always run
before execution of any action.so i am not able to run fornt user's
action bcoz it always check for admin session that is not set.also
check admin session is necessary.So plz any one can suggest what
shloud i do.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Solved - Re: Create links to navigate back to last visited page

2008-09-12 Thread StanMoong

Solution can be found here: 
http://fat-tier.blogspot.com/2008/09/cancel-button-for-form.html

On Sep 12, 6:08 am, integrator [EMAIL PROTECTED] wrote:
 I am not satisfied with this solution. For instance when I edit an
 item in the list and save the changes I want to go back to the list I
 had before and not to e new list with a different ordering. Alse when
 I edit an item ,and I get an input error i can't go back to list with
 the javascript function.

 I looking for a more sofisticated solution.

 On 28 aug, 12:13, draikin [EMAIL PROTECTED] wrote:

  Thank you all for posting solutions. I solved the problem with the JS
  solution from clemos. It works like I want and I will dare that some
  users of my applikation don't like JS.

  draikin

  On 25 Aug., 14:54, Marcin Domanski [EMAIL PROTECTED] wrote:

   The Formhelper does NOT need JS :)

   As fot the OP problem - you can save the actual page to the the session.
   If there is a page in session - get the url, if its different then the
   actual - save the actual (you have the one for  backin the var).
   It has drawbacks but its closest you can get.

   --
   Marcin Domanskihttp://kabturek.info

   On Mon, Aug 25, 2008 at 12:07 PM, clemos [EMAIL PROTECTED] wrote:
Hidraikin

I think we can consider CakePHP actually needs Javascript.
Of course you can use Cake to develop javascript-free apps, but lots
of Cake features, for example some of the FormHelper functionnalities,
actually require javascript...

You could use a code that use both, like:
controller: $this-set(referer,$this-referer());
view: $html-link(go
   back,$referer,array('onclick'='window.history.back(); return
false'));
Like so, Javascript enabled browser will use the Javascript function,
while Javascript disabled browser will use the $referer href.
Of course, if the browser supports neither js nor referer, the link
will likely fail; but it's still the most widely compatible way I can
imagine...
Note that the JS function and the referer link may not lead to the
exact same page; this needs to be well tested to see if there are
differences...
Well, you may also force the referer to be passed through named
variables (something like : $html-link(go
there,/controller/action/whatever/referer:.urlencode($this-here));
), but you'll need to do it for each link, and it'll mess up your
nice urls a little bit...

++
Clément

On Fri, Aug 22, 2008 at 4:02 PM,draikin[EMAIL PROTECTED] wrote:

Hi clemos,

thank you for your solution that I read also. But just like $this-
   referer() doesn't work for all browsers javascript doesn't work for
all users, as there are some users who don't like javascript. But if
there is a need for javascript in cakephp apps anyway (i don't know if
this is so), your solution is the easiest.

   draikin

clemos schrieb:
Maybe I didn't understand your problem, but ...
Why don't you give a try to my good old plain javascript solution ?

a href=javascript:window.history.back()goback/a

The link above will get youbackjust like your back 
browserbuttonwould...
You can evengobackfurther with window.history.go(-10) (ten 
pagesback)
No Cake, No PHP, just simple javascript...

$this-referer() doesn't work for all browsers, cause the referer must
actually be sent by the client (IE doesn't seem to send it all the
time).
+++
Clément

On Thu, Aug 21, 2008 at 7:35 PM,draikin[EMAIL PROTECTED] wrote:

 Thank you for your response. Yes, thats what I'm looking for. But 
 the
 problem is that $this-referer() seems not to work. So I will test 
 the
 bread crumb feature from the HTML helper.

draikin

 teknoid schrieb:
 You are probably looking for something like $this-referer()

 Also there is a bread crumbs feature in the HTML helper, for 
 something
 more robust.

 On Aug 21, 10:35 am,draikin[EMAIL PROTECTED] wrote:
  Hi,

  i'am searching for a solution for the following problem. I want 
  to
  have a link on the pages of my little cakePHP app to allow 
  togoback
  to the page where i come from. So as theback-buttonof the 
  browser.
  For example: I search for a subset of my database entries and 
  get a
  page with a table containing the results. Now i want to edit one 
  entry
  and so i klick on the 'edit' link in the first column of the 
  table. I
  edit the entry, save it and want togobackto the result page. If i
  dont want to edit, i will have a link on the edit page togobackto
  the result page.
  Did i describe the problem properly?
  Can anyone give me a hint? I tried to find a solution, but i 
  can't
  find what i need.

  Many thanks,
 draikin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the 

Re: Solved - Re: Create links to navigate back to last visited page

2008-09-12 Thread StanMoong

Hi, I had the same problem as you. I was not able to use javascript to
redirect (using location.href), got error message about no access to
the directory. The history.back() doesn't work too well for me because
user could be trying to save but encounter validation error and after
several times, decided to cancel the operation, but the history.back()
will return to just one step behind, and not to the main list.

Here is how I solve it, basically make use of the 'name' tag and check
for the button pressed in controller function to redirect accordingly.
This should also solve the cross-browser issue.

In the view, I added the following buttons.

=

. Start of form and elements code .

div class=button
  ?php echo $form-submit('Save Job Type', array('div'=false,
'name'='submit')); ?
  ?php echo $form-submit('Cancel', array('div'=false,
'name'='cancel')); ?
/div

. End of form code .

=

At the beginning of my controller add function (for example), I do
this first.

if (array_key_exists('cancel', $this-params['form'])) {
  $this-flash('Cancelled adding new job type.','/job_types');
}

... Rest of the data validation and saving logic ...

===

On Sep 12, 6:08 am, integrator [EMAIL PROTECTED] wrote:
 I am not satisfied with this solution. For instance when I edit an
 item in the list and save the changes I want to go back to the list I
 had before and not to e new list with a different ordering. Alse when
 I edit an item ,and I get an input error i can't go back to list with
 the javascript function.

 I looking for a more sofisticated solution.

 On 28 aug, 12:13, draikin [EMAIL PROTECTED] wrote:

  Thank you all for posting solutions. I solved the problem with the JS
  solution from clemos. It works like I want and I will dare that some
  users of my applikation don't like JS.

  draikin

  On 25 Aug., 14:54, Marcin Domanski [EMAIL PROTECTED] wrote:

   The Formhelper does NOT need JS :)

   As fot the OP problem - you can save the actual page to the the session.
   If there is a page in session - get the url, if its different then the
   actual - save the actual (you have the one for  backin the var).
   It has drawbacks but its closest you can get.

   --
   Marcin Domanskihttp://kabturek.info

   On Mon, Aug 25, 2008 at 12:07 PM, clemos [EMAIL PROTECTED] wrote:
Hidraikin

I think we can consider CakePHP actually needs Javascript.
Of course you can use Cake to develop javascript-free apps, but lots
of Cake features, for example some of the FormHelper functionnalities,
actually require javascript...

You could use a code that use both, like:
controller: $this-set(referer,$this-referer());
view: $html-link(go
   back,$referer,array('onclick'='window.history.back(); return
false'));
Like so, Javascript enabled browser will use the Javascript function,
while Javascript disabled browser will use the $referer href.
Of course, if the browser supports neither js nor referer, the link
will likely fail; but it's still the most widely compatible way I can
imagine...
Note that the JS function and the referer link may not lead to the
exact same page; this needs to be well tested to see if there are
differences...
Well, you may also force the referer to be passed through named
variables (something like : $html-link(go
there,/controller/action/whatever/referer:.urlencode($this-here));
), but you'll need to do it for each link, and it'll mess up your
nice urls a little bit...

++
Clément

On Fri, Aug 22, 2008 at 4:02 PM,draikin[EMAIL PROTECTED] wrote:

Hi clemos,

thank you for your solution that I read also. But just like $this-
   referer() doesn't work for all browsers javascript doesn't work for
all users, as there are some users who don't like javascript. But if
there is a need for javascript in cakephp apps anyway (i don't know if
this is so), your solution is the easiest.

   draikin

clemos schrieb:
Maybe I didn't understand your problem, but ...
Why don't you give a try to my good old plain javascript solution ?

a href=javascript:window.history.back()goback/a

The link above will get youbackjust like your back 
browserbuttonwould...
You can evengobackfurther with window.history.go(-10) (ten 
pagesback)
No Cake, No PHP, just simple javascript...

$this-referer() doesn't work for all browsers, cause the referer must
actually be sent by the client (IE doesn't seem to send it all the
time).
+++
Clément

On Thu, Aug 21, 2008 at 7:35 PM,draikin[EMAIL PROTECTED] wrote:

 Thank you for your response. Yes, thats what I'm looking for. But 
 the
 problem is that $this-referer() seems not to work. So I will test 
 the
 bread crumb feature from the HTML helper.

draikin

 teknoid schrieb:
 You are probably looking for something like $this-referer()

 Also there is a bread crumbs 

Re: Field Naming Convention

2008-09-12 Thread nayan

But Kien can we create a input box or check box or radio button or
select with out labe bcoz when i write ?php echo $form-
input('FanType/fantype_name'); ?
it display FanType Name before my text box and also there is no gap
between label an text box.i need to aply style sheet

On Aug 20, 1:01 am, kienpham2000 [EMAIL PROTECTED] wrote:
 I think I found my own answer, we can use something like this:

 ?= $form-input('MyModel.1.myField);?
 ?= $form-input('MyModel.2.myField);?

 I think with this convention, we can use the saveAll() but my table is
 MyISAM which does not support transaction :(.

 - Kien

 On Aug 18, 3:48 pm, kienpham2000 [EMAIL PROTECTED] wrote:

  Hi all cake bakers,

  I'm using the 1.2RC and I followed the field naming convention here to
  get array of data for a field 
  name:http://book.cakephp.org/view/547/field-naming-convention

  Here is my code to create input fields:
  ?= $form-input('MyModel.myField.1');?
  ?= $form-input('MyModel.myField.2');?

  But when it displays, my label is 1 and 2 but not My Field. I have to
  manually set the label like this:
  ?= $form-input('MyModel.myField.1', array('label' = 'My Field 1'));?

  ?= $form-input('MyModel.myField.2', array('label' = 'My Field 2);?

  Did I created the field wrong or do I just have to manually type in
  the label? Also, in plain php, we can just use the two bracket at the
  end [] and the posted data will automatically create the array for us,
  can we do something like that with cake using the form helper?

  Thanks all!
  - Kien



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



KTML Editor

2008-09-12 Thread mirfan

Hello,
Well, anybody help me how i will include KTML Editor in cake php
please reply me on [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Html Helper

2008-09-12 Thread nayan

Thank you for reply.i wana to ask you one thing that i didnt fine any
where,we create form like this ?php echo $form-create('Setting',
array('action' = 'admin_edit')); ? .Tell me first stands for what
(Here Seeting) means it is controller name or model name 

On Sep 10, 7:16 pm, Luiz Poleto [EMAIL PROTECTED] wrote:
 Also, forget about using 'FanType/fantype_name'. Although it's still
 supported, now the correct way to use it is 'FanType.fantype_name'.
 Regards,
 Luiz Poleto

 2008/9/10 nayan [EMAIL PROTECTED]



  I am using cake 1.2 .When i use echo $html-input('FanType/
  fantype_name') in my form.it give me the following error
  Method HtmlHelper::input does not exist [CORE\cake\libs\view
  \helper.php, line 148].can we use html helper in cake 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: URL not Found Error

2008-09-12 Thread nayan


Your mod_rewtrite should be ON and then restart you Apache...then set
default controller in routes.php
On Sep 9, 4:53 am, Sabrina Akter [EMAIL PROTECTED] wrote:
 i set up all the configuration newly.and also create all the files newly.
 Apache and mod_rewtrite are perfectly ok. and all the files are in right
 place
 still when i trying to accesshttp://localhost/project/caketoodoo/tasks/index
 it showing URL not found error!!

 please anyone can help me??



 On Tue, Sep 9, 2008 at 3:04 AM, teknoid [EMAIL PROTECTED] wrote:

  Make sure that AllowOverride is set to All in your apache conf.
  Also, double check that mod_rewrite is enabled.

  On Sep 8, 4:39 pm, Sabrina Akter [EMAIL PROTECTED] wrote:
   hi Femi,
   its by default set : *Configure::write('debug', 2);*
   i changed it to 1. for 1 or 2 its shows the same result URL not found.

   hi agelin,
   i dont understand what u wana know. in .htaccess it contains:

   IfModule mod_rewrite.c
       RewriteEngine on
       RewriteRule    ^$    webroot/    [L]
       RewriteRule    (.*) webroot/$1    [L]
    /IfModule

   why its happening. is it dependent of databases data? or should i modify
  any
   thing.

   in thehttp://localhost//cakePHP/still it showing some message:
   *Editing this Page* *To change the content of this page, edit:
   APP/views/pages/home.ctp.
   To change its layout, edit: APP/views/layouts/default.ctp.
   You can also add some CSS styles for your pages at: APP/webroot/css.
   *
   home.ctp and default.ctp dont existed.should i create those files?

   On Mon, Sep 8, 2008 at 10:16 AM, agelin [EMAIL PROTECTED] wrote:

looking for your .htaccess.

   --
   Thanks
   -
   Sabrina Akter | System Developer
   Email: [EMAIL PROTECTED]

 --
 Thanks
 -
 Sabrina Akter | System Developer
 Email: [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom validation doesn't work

2008-09-12 Thread David C. Zentgraf

On 12 Sep 2008, at 12:08, Sen wrote:

return $valid;

// just for debugging
$this-autoRender = false;
var_dump($data);

You'll never see your debugging calls when the function always bails  
out with the return just before.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Has ... relationships help please

2008-09-12 Thread soldier.coder

I am getting lost in semantics and need a guide.  I'm writing an app
that keeps track of grades for students in multiple courses.
Depending on the type of course, there will be different categories of
grades ('Lab Assignments','Oral Presentation', 'Programming
Assignments', ...) and there will be different weights for the grades
of different categories.  So let me lay out some tables:

Weights table
   course_id
   category_id
   number
   weight

Categories table
   category_id
   description

Courses
  course_id
  course_name


So it is obvious to me that the Weights table belongs to the Courses
and Categories tables.
When I set up the weights that is strait forward to me.  My problem
comes when I start thinking about how to write the model for the
Categories table. According to a book I am reading, each relationship
with association mapping must be specified in both directions and
when describing the other direction in the relationship between
Categories and Weights or between Categories and Courses I have
exactly 3 options: Has One, Has Many and Has and Belongs To
Many...

Which is right for the relationship between Categories and Weights?
and why?
Which is right for the relationship between Categories and Courses?
and why?

Thank you very much for your 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Html Helper

2008-09-12 Thread David C. Zentgraf

 $form-create(string $model = null, array $options = array());

from: http://book.cakephp.org/view/183/Creating-Forms

On 12 Sep 2008, at 13:16, nayan wrote:


 Thank you for reply.i wana to ask you one thing that i didnt fine any
 where,we create form like this ?php echo $form-create('Setting',
 array('action' = 'admin_edit')); ? .Tell me first stands for what
 (Here Seeting) means it is controller name or model name 

 On Sep 10, 7:16 pm, Luiz Poleto [EMAIL PROTECTED] wrote:
 Also, forget about using 'FanType/fantype_name'. Although it's still
 supported, now the correct way to use it is 'FanType.fantype_name'.
 Regards,
 Luiz Poleto

 2008/9/10 nayan [EMAIL PROTECTED]



 I am using cake 1.2 .When i use echo $html-input('FanType/
 fantype_name') in my form.it give me the following error
 Method HtmlHelper::input does not exist [CORE\cake\libs\view
 \helper.php, line 148].can we use html helper in cake 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Field Naming Convention

2008-09-12 Thread David C. Zentgraf

http://book.cakephp.org/view/196/options-label

Please nayan, read the Book, okay?

On 12 Sep 2008, at 13:53, nayan wrote:


 But Kien can we create a input box or check box or radio button or
 select with out labe bcoz when i write ?php echo $form-

 input('FanType/fantype_name'); ?
 it display FanType Name before my text box and also there is no gap
 between label an text box.i need to aply style sheet

 On Aug 20, 1:01 am, kienpham2000 [EMAIL PROTECTED] wrote:
 I think I found my own answer, we can use something like this:

 ?= $form-input('MyModel.1.myField);?
 ?= $form-input('MyModel.2.myField);?

 I think with this convention, we can use the saveAll() but my table  
 is
 MyISAM which does not support transaction :(.

 - Kien

 On Aug 18, 3:48 pm, kienpham2000 [EMAIL PROTECTED] wrote:

 Hi all cake bakers,

 I'm using the 1.2RC and I followed the field naming convention  
 here to
 get array of data for a field 
 name:http://book.cakephp.org/view/547/field-naming-convention

 Here is my code to create input fields:
 ?= $form-input('MyModel.myField.1');?
 ?= $form-input('MyModel.myField.2');?

 But when it displays, my label is 1 and 2 but not My Field. I have  
 to
 manually set the label like this:
 ?= $form-input('MyModel.myField.1', array('label' = 'My Field  
 1'));?

 ?= $form-input('MyModel.myField.2', array('label' = 'My Field  
 2);?

 Did I created the field wrong or do I just have to manually type in
 the label? Also, in plain php, we can just use the two bracket at  
 the
 end [] and the posted data will automatically create the array for  
 us,
 can we do something like that with cake using the form helper?

 Thanks all!
 - Kien



 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Has ... relationships help please

2008-09-12 Thread David C. Zentgraf

Weights belongsTo both Categories and Courses
Categories hasMany Weights
Courses hasMany Weigths

BelongsTo means the model that belongsTo something also has the  
foreign keys in itself (Weights.course_id).
For hasMany THE OTHER model is supposed to have the foreign key  
(Courses hasMany Weights, so Courses will look for a  
Weights.category_id that matches its own id).

Behold my ASCII art: ;-)

   / Weight.category_id
Category.id - Weight.category_id
   \ Weight.category_id

HasMany and belongsTo are the two sides you need for a single-many  
relationship.
hasAndBelongsToMany expresses a many-many relationship, with both  
models havingAndBelongingToMany.
A hasOne-belongsTo pair would be a one-one relationship.

Does that help?

On 12 Sep 2008, at 22:42, soldier.coder wrote:


 I am getting lost in semantics and need a guide.  I'm writing an app
 that keeps track of grades for students in multiple courses.
 Depending on the type of course, there will be different categories of
 grades ('Lab Assignments','Oral Presentation', 'Programming
 Assignments', ...) and there will be different weights for the grades
 of different categories.  So let me lay out some tables:

 Weights table
   course_id
   category_id
   number
   weight

 Categories table
   category_id
   description

 Courses
  course_id
  course_name


 So it is obvious to me that the Weights table belongs to the Courses
 and Categories tables.
 When I set up the weights that is strait forward to me.  My problem
 comes when I start thinking about how to write the model for the
 Categories table. According to a book I am reading, each relationship
 with association mapping must be specified in both directions and
 when describing the other direction in the relationship between
 Categories and Weights or between Categories and Courses I have
 exactly 3 options: Has One, Has Many and Has and Belongs To
 Many...

 Which is right for the relationship between Categories and Weights?
 and why?
 Which is right for the relationship between Categories and Courses?
 and why?

 Thank you very much for your 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



making a view without a controller or model

2008-09-12 Thread gabriel

Hi, I am new, as you might guess.., I have created an (HTML) view in
the pages folder in views, called account.ctp. It doesn't have a
controller or model. But is looking for a controller. How do I get
around this?

Thanks and blessings to the person who helps me.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: making a view without a controller or model

2008-09-12 Thread grigri

The url you want is : /pages/account - that will get it to display

If you want to access it via /account then add this line to app/config/
routes.php:

Router::connect('/account', array('controller' = 'pages', 'action' =
'view', 'account'));

hth
grigri

On Sep 12, 2:59 pm, gabriel [EMAIL PROTECTED] wrote:
 Hi, I am new, as you might guess.., I have created an (HTML) view in
 the pages folder in views, called account.ctp. It doesn't have a
 controller or model. But is looking for a controller. How do I get
 around this?

 Thanks and blessings to the person who helps me.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help with models?

2008-09-12 Thread nachopitt

Isn't just only a 'belongs to' association? 'Product' belongsTo
'Category'?

On Sep 11, 9:31 pm, David C. Zentgraf [EMAIL PROTECTED] wrote:
 You're doing it exactly the way you described 
 it:http://book.cakephp.org/view/81/belongsTohttp://book.cakephp.org/view/82/hasMany

 On 12 Sep 2008, at 07:41, VitillO wrote:



  This is the case, i have a tables products, categories. Normally i
  would link a category to a product using product.category_id, and
  since a category can be assigned to many products i dont have a
  product_id in the categories table. So, how can i make this
  relationship between the 2 without using a HABTM table, because lets
  say i want to link a product just to 1 category, not many categories.

  I will appreciate a lot any help with this! Thank you
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: KTML Editor

2008-09-12 Thread Nate

http://www.google.com/search?client=safarirls=en-usq=KHTML+editor+CakePHPie=UTF-8oe=UTF-8

On Sep 12, 12:59 am, mirfan [EMAIL PROTECTED] wrote:
 Hello,
 Well, anybody help me how i will include KTML Editor in cake php
 please reply me on [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help with models?

2008-09-12 Thread David C. Zentgraf

Product belongsTo Category
and
Category hasMany Products

You could just do Product belongsTo Category, but if you link it the  
other way as well you can get Products in a Category when searching  
from Category-find() easily.

On 12 Sep 2008, at 23:32, nachopitt wrote:


 Isn't just only a 'belongs to' association? 'Product' belongsTo
 'Category'?

 On Sep 11, 9:31 pm, David C. Zentgraf [EMAIL PROTECTED] wrote:
 You're doing it exactly the way you described 
 it:http://book.cakephp.org/view/81/belongsTohttp://book.cakephp.org/view/82/hasMany

 On 12 Sep 2008, at 07:41, VitillO wrote:



 This is the case, i have a tables products, categories.  
 Normally i
 would link a category to a product using product.category_id, and
 since a category can be assigned to many products i dont have a
 product_id in the categories table. So, how can i make this
 relationship between the 2 without using a HABTM table, because lets
 say i want to link a product just to 1 category, not many  
 categories.

 I will appreciate a lot any help with this! Thank you
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: making a view without a controller or model

2008-09-12 Thread gabriel

~Thanks !!

On 12 Sep, 15:28, grigri [EMAIL PROTECTED] wrote:
 The url you want is : /pages/account - that will get it to display

 If you want to access it via /account then add this line to app/config/
 routes.php:

 Router::connect('/account', array('controller' = 'pages', 'action' =
 'view', 'account'));

 hth
 grigri

 On Sep 12, 2:59 pm, gabriel [EMAIL PROTECTED] wrote:



  Hi, I am new, as you might guess.., I have created an (HTML) view in
  the pages folder in views, called account.ctp. It doesn't have a
  controller or model. But is looking for a controller. How do I get
  around this?

  Thanks and blessings to the person who helps me.- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: frontend texts spread around the application layers

2008-09-12 Thread David C. Zentgraf

Use the __() i18n method for everything and you can gather all  
messages in .po translation files.
For model validation messages you'd have to use Daniel's trick of  
using __() in the form-input options.

Whether that'll really make things easier for you I don't know... :-)

On 12 Sep 2008, at 17:51, stefanski wrote:


 Fellows of the cake ring,

 I come to the point where I thought about having common notification
 texts in a more central position in my application. Right now its
 pretty mixed like:
 - validation messages in the models
 - notifications in the session-flash, which are set in the controller
 - and a whole lot of other common texts in my textHelper in several
 arrays

 I thought, having them all in the View layer makes more sense, how do
 you guys do that?

 Use text keys for validation texts and write my own helper to display
 them? But how to solve the session flash issue?

 Thanks and keep up the good cake spirit :-)

 Stefanski
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: An problem about controller without a model

2008-09-12 Thread simonking

yes, I did.


On 9月12日, 上午1时33分, Okto Silaban [EMAIL PROTECTED] wrote:
 Have you named the controller books_controller.php?

 Okto.Silaban.Net




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Caching help

2008-09-12 Thread Kenchu

Thanks!

But what about caching for longer periods, w/o updating? Because as of
now, if you update a table, then the queries will be remade. I just
want 1 query to occur once each day for a specific thing..

On Sep 10, 10:53 am, Dave J [EMAIL PROTECTED] wrote:
 Hi Kenchu,

 I'm almost sure this is a hack, but it's been working fine for me so
 far.

 If you want your variables to persist in the cached views, set them
 like this:

 $this-data['variableName'] = 'variableValue';

 You can have a look at the created cached files in the tmp directory
 to see what Cake is doing. At the very top, there's a list of
 variables which are persistent for that cache.

 On Sep 9, 2:27 pm, Kenchu [EMAIL PROTECTED] wrote:

 http://book.cakephp.org/view/347/Marking-N...ontent-in-Views

  In the link above they've got a cached page, but still within the
  cake:nocache tags they access a variable called $newProducts. How is
  that possible? I've been trying to use the $this-set([...]) function
  in the action, beforeFilter and in the __construct, but none of them
  worked. Neither the action im caching or beforeFilter would run. Why
  putting it in the construct didnt work I dont know.

  So how do you send data to a nocache tag within a cached page?

  I also wonder if it's possible to keep acachefor a whole day without
  it being updated, even though new posts and updates occur in the
  database. According to:

 http://book.cakephp.org/view/348/Clearing-the-Cache

  thecacheis cleared for this. I don't want it to be.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: KTML Editor

2008-09-12 Thread Samuel DeVore

man that darn google always so fast with an answer...

I also find that http://plzsendmethecode.blogspot.com/ is a good spot
for answers to un-researched questions.


On Fri, Sep 12, 2008 at 7:34 AM, Nate [EMAIL PROTECTED] wrote:

 http://www.google.com/search?client=safarirls=en-usq=KHTML+editor+CakePHPie=UTF-8oe=UTF-8

 On Sep 12, 12:59 am, mirfan [EMAIL PROTECTED] wrote:
 Hello,
 Well, anybody help me how i will include KTML Editor in cake php
 please reply me on [EMAIL PROTECTED]
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Making a simple link to another page

2008-09-12 Thread gabriel

I would like to make a simple link to a view which does not have a
controller and model, can anyone help me.
REgards
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Making a simple link to another page

2008-09-12 Thread Siegfried Hirsch
Use something like this:

$this-element('your_element');


On Fri, Sep 12, 2008 at 5:45 PM, gabriel [EMAIL PROTECTED] wrote:

 I would like to make a simple link to a view which does not have a
 controller and model, can anyone help me.
 REgards
 




-- 
Siegfried Hirsch
hhS - Welserstr. 1 - 81373 München - (089) 5484 3564 - skype:shirsch
Fax +49 - (0)89 - 943 992 698 - http://www.rss-blogger.de
http://www.newsbee.de NewsBee 2 - customized RSS solutions
http://abo-stop.de jetzt mit kostenlosem Kündigungsgenerator

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Fuzzy Search

2008-09-12 Thread Kyle Decot

I am building a skatepark directory website and I would like my
visitors to be able to do fuzzy searches such as ohio outdoor or
california concrete. Any tips on how to go about making a fuzzy
search query like this? 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Making a simple link to another page

2008-09-12 Thread Donkeybob

is this a normal html link? then =  echo $html-link('My Link', '/
your/view');

On Sep 12, 11:57 am, Siegfried Hirsch [EMAIL PROTECTED]
wrote:
 Use something like this:

 $this-element('your_element');

 On Fri, Sep 12, 2008 at 5:45 PM, gabriel [EMAIL PROTECTED] wrote:

  I would like to make a simple link to a view which does not have a
  controller and model, can anyone help me.
  REgards

 --
 Siegfried Hirsch
 hhS - Welserstr. 1 - 81373 München - (089) 5484 3564 - skype:shirsch
 Fax +49 - (0)89 - 943 992 698 
 -http://www.rss-blogger.dehttp://www.newsbee.deNewsBee 2 - customized RSS 
 solutionshttp://abo-stop.dejetzt mit kostenlosem Kündigungsgenerator
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Installation: Ubuntu / Apache2.2 / mod_re_write

2008-09-12 Thread dan3501

I've searched the Internet to no end, and still haven't been able to
resolve this issue.
Issue: CakePHP welcome page appears without colors -- indicating a
configuration error.
Environment: Ubuntu 8.0.4, apache document-root : /var/www, cake
application directory (where I unzipped the cake zip files): /var/www/
dan
What I did:
(1) Installed apache2.2, php5;
(2) unzipped cake to /var/www/dan;
(3) modified sites-enabled to ensure directory set up and
AllowOverride All;
(4) reviewed .htaccess in /var/www/dan/app and /var/www/dan/app/
webroot -- looks file;
(5) set apache logging to debug;
(6) executed a2enmod rewrite and the force-reload command to ensure
mod_rewrite is working;
(7) reviewed phpinfo() to ensure mod_rewrite is loaded

I've installed apache, php5 under Ubuntu with apt-get install.  When I
hit the CakePHP welcome page by going to /localhost/dan, I do not get
the colors.  When I review the apache logs, I get file not found: /
var/www/dan/css and also file not found: /var/www/img.  Simply
stated, it made me think that there was an issue with the .htaccess
file, perhaps it should be pointing to webroot (where the css and img
directories are located), but when I tried to make changes to
the .htaccess files in /var/www/dan/app or /var/www/dan/app/webroot,
nothing worked.

More curiously, when I installed cakephp-instaweb and then ran cakephp-
instaweb in the /var/www/dan directory.  I then went to localhost:
3000, and the CakePHP welcome page appeared correctly -- which made me
think that the issue is with Apache and some of my configurations
(whether .htaccess or some other file) rather than in the cake
specific configuration.

I've been looking on the Internet and through all kinds of cake
documentation and have been unable to resolve this issue.  It works
fine on my Windows XP development environment, but I'm looking to
implement my production system on Linux.  Help me to resolve this and
you will have my heartfelt appreciation!!

Dan

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Validation not working on model

2008-09-12 Thread luigi7up

Hello everyone,

I have two models

MOTIVE  var $hasMany = array('Comment');
COMMENT var $belongsTp=array('Motive');

I want to make comments on motives so I added comment() function into
Motive controller and in views/motive/view.php I added following form:

echo $form-create('Motive',array('action' = 'comment'));
echo $form-hidden('Comment.motive_id',array('value'=
$motive['Motive']['id']));
echo $form-input('Comment.author');
echo $form-input('Comment.text',array('type'='textarea'));
echo $form-end('Send');


In comment() function of Motives controller i have:

if (!empty($this-data)) {
if($this-Motive-Comment-save($this-data))
{
$this-Session-setFlash(__('Posted!', true));
   $this-
redirect(array('controller'='motives','action'='view/'.$this-
data['Comment']['motive_id'].''));

}
else
{
$this-Session-setFlash(__('Error!', true));

}
}



I also added validation to my comment model:
*
var $validate = array(
'author' =
array('rule'=VALID_NOT_EMPTY,'message'='Blank
field!'),
'text' =
array('rule'=VALID_NOT_EMPTY,'message'='Blank field!')
);
*


I don't have comments_controller and I don't wanna use it. I want to
use comment() function in motives_controller so my form action sends
request to Motive/comment

Validation does work but it doesn't show messages text next to field
in form.
So, if I leave author field in comment blank I'll get error because it
couldn't be saved:
else
{
  $this-Session-setFlash(__('Error!', true));
}

thnx
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Models and Has... help please!

2008-09-12 Thread soldier.coder


But I guess such thinking on my part is futile. So let me lay it all
out for you.
My tables:

courses-- this is here to provide in ID and a course
name for display.
   course_id
   course_name

categories -- another look up table for category names
   category_id
   category_name

So right now I can look up course names and categories in, say
dropdowns, but I really have
no place to store *which* categories are for *which* courses.  So

weights
   course_id
   category_id
   number(number of grades in this category)
   weight (weight for entire category)

At this point I can pick and store the grading categories for a course
along with how many
grades will be stored for what category and the percentage of the
total grade for the course
that grades in this category represent.  But I still have no storage
for the actual grades.
But I can't have grades yet -- because I have no students...

students
   student_id
   first_name
   last_name
   email
   user_name
   password

now I can store grades

grades
   course_id
   student_id
   category_id
   date_assigned
   number_grade

at the some point you need to sum up all the grades in a particular
category, then multiply
the total of the category by the weight for the category:

category_totals
   course_id
   student_id
   category_id
   category_raw_total
   category_total_x_weight

then finally, by summing the category_total_x_weight for a particular
course, and student,
you get the final grade.

final_grades
   course_id
   student_id
   final_grade

*Soo!  That is my whole database setup.

I hate to ask, but could someone tell me how to set up my models?
I have these huge gaps in my understanding.

For instance, I can see that weights belongs to courses and
categories.

So I should have something like this for Weight model:
?
   class Weight extends AppModel {
  var $name = 'Weight';
  var $belongsTo = array (
 'Course'   = array('className' = 'Course',   'foreignKey'
= 'course_id',
'conditions' =null, 'fields'=null),
 'Category' = array('className' = 'Category', 'foreignKey'
= 'category_id',
'conditions' =null, 'fields' =null)
  )
   }
?

But then do I need to establish or describe some kind of relationship
going the other way for
Course and Category?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Problems generating ACL database

2008-09-12 Thread jeff aigner

I'm trying to generate the ACL database using the command below:

# bash cake schema run create DbAcl

And here is the errors I get:

PHP Notice:  Constant CURLOPT_TRANSFERTEXT already defined in Unknown
on line 0

Welcome to CakePHP v1.2.0.7296 RC2 Console
---
App : app
Path: /var/www/users/jeffdev/www.website.com/app
---
Cake Schema Shell
---
PHP Fatal error:  Class 'CakeSchema' not found in /var/www/users/
jeffdev/www.website.com/cake/console/libs/schema.php on line 78

Fatal error: Class 'CakeSchema' not found in /var/www/users/jeffdev/
www.website.com/cake/console/libs/schema.php on line 78


Has anyone else experienced this problem or know how to get passed it?

Thanks,
Jeff

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP causes 500 error: fixed!

2008-09-12 Thread Mike

On Sep 12, 4:16 am, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hi,
 You already covered most suggestion I might have had, but I thought I
 would post what I get when I write the same syntax.
 My installation of php and CakePHP 1.2 rc2 produces this type of
 output for any syntax error:
 Parse error: syntax error, unexpected '}' in /Users/martin/Sites/cake/
 great/config/core.php on line 43

 I am running Apples Apache on a Mac. If I remember correctly the *AMP
 setups often offer accelerators for php. Is one of them active in your
 setup?

 Try to output phpinfo() from inside Cake and compare to a raw
 phpinfo without the framework loaded. That could yield some small
 configuration change.


Thanks for the tip!  Before trying this out, I ran down another hint
that a friend had suggested, and turns out, that lead me to the
answer.

Which means I can now publically say that I goofed :)

What happened is this:  in my core.php file, I had turned off
debugging, using the Configure::write('debug', 0).  Turns out, this
turns off all debugging info, including PHP error reporting (it
executes error_reporting(0); ).  Thinking about it, this is convenient
and good, but not something I realized.

In my controller file, in the method that was going to be invoked, I
put in the Configure::write('debug', 2); to turn debugging back on.  A
little goofy, perhaps, but it seemed reasonable.  Since it had been a
month since I last looked at my code, I'd forgotten about turning off
the debugging at the global level, and since I was seeing the command
to turn the debugging on in that method, it didn't occur to me to
check for the global setting.

So what happened is this: the app starts up, core.php turns off
error_reporting, there's a syntax error in my controller, but never
gets reported because the syntax error causes the page to stop being
executed before it gets to the command to turn the debugging back on.

*sigh*

Anyways, it's fixed, and things are looking better.

Is there a way to request that the 'no error reporting when debugging
is off' this be added to the documentation?  This was definitely my
mistake, but it might help clarify things for others.  Plus, if we
have the error_reporting keyword in there, Google might index it for
future searches, so it might be easier to find later b/c of that.  If
not, that's fine, too.

Thanks!
--Mike
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Nusoap cakephp question

2008-09-12 Thread .
 Hi

I am trying to convert the Remote Service (helloworld-server.php) in the
following tutorial (in the URL below) to cakephp Component-compatible. I am
struggling with the correct syntax, however. In the server-register(..)
method, the first parameter should be the name of the service function. In
this case, the function is hello. How would I call this hello function?
Right now, i am getting a client method is not defined error message.

Thanks for any help!



*This is the tutorial:
**http://www.oclipa.com/university/nusoap/3.php*http://www.oclipa.com/university/nusoap/3.php



*This is what I have in my Cake NusoapComponent:*

function serverMain()
 {
  $this-server= new nusoap_server();
  *$this-server-register('hello',*// method name
   array('name' = 'xsd:string'),// input parameters
   array('return' = 'xsd:string'),  // output parameters
   'urn:hellowsdl',  // namespace
   'urn:hellowsdl#hello',// soapaction
   'rpc',// style
   'encoded',// use
   'Says hello to the caller'// documentation
  );
  $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA :
'';
  $this-server-service($HTTP_RAW_POST_DATA);

 }

 // This is the method
 *function hello*($input) {
  $output_string = 'Hello ' . $input['firstname'] .
 '. You are ' . $input['age'] . ' years old.';

  if ( $input['age'] = 18 ) { $allow = 1; }

  $output = array(
 'output_string' = $output_string,
 'allow' = $allow
 );

  return new soapval('return', 'HelloInfo', $output, false, 'urn:AnyURN');
 }

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP causes 500 error: fixed!

2008-09-12 Thread Jon Bennett

Hi Mike,

 Is there a way to request that the 'no error reporting when debugging
 is off' this be added to the documentation?

http://book.cakephp.org/view/42/The-Configuration-Class#CakePHP-Core-Configuration-Variables-44

I'm not sure it's clear enough though, perhaps placing it below the
methods of the Configure class, you miss them as being the 'core' set
up variables - could it have it's own page like
http://book.cakephp.org/view/41/Core-Configuration ?

jb

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Nusoap cakephp question

2008-09-12 Thread francky06l

I use cake with nusoap, I did a small tutorial and sample apps here:
http://www.cakephpforum.net/index.php?showtopic=559

hth

On Sep 12, 9:07 pm, . [EMAIL PROTECTED] wrote:
  Hi

 I am trying to convert the Remote Service (helloworld-server.php) in the
 following tutorial (in the URL below) to cakephp Component-compatible. I am
 struggling with the correct syntax, however. In the server-register(..)
 method, the first parameter should be the name of the service function. In
 this case, the function is hello. How would I call this hello function?
 Right now, i am getting a client method is not defined error message.

 Thanks for any help!

 *This is the tutorial:
 **http://www.oclipa.com/university/nusoap/3.php*http://www.oclipa.com/university/nusoap/3.php

 *This is what I have in my Cake NusoapComponent:*

 function serverMain()
  {
   $this-server= new nusoap_server();
   *$this-server-register('hello',*// method name
array('name' = 'xsd:string'),// input parameters
array('return' = 'xsd:string'),  // output parameters
'urn:hellowsdl',  // namespace
'urn:hellowsdl#hello',// soapaction
'rpc',// style
'encoded',// use
'Says hello to the caller'// documentation
   );
   $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA :
 '';
   $this-server-service($HTTP_RAW_POST_DATA);

  }

  // This is the method
  *function hello*($input) {
   $output_string = 'Hello ' . $input['firstname'] .
  '. You are ' . $input['age'] . ' years old.';

   if ( $input['age'] = 18 ) { $allow = 1; }

   $output = array(
  'output_string' = $output_string,
  'allow' = $allow
  );

   return new soapval('return', 'HelloInfo', $output, false, 'urn:AnyURN');
  }
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Purpose of vendors directory?

2008-09-12 Thread Jon Bennett

Hi Thomas,

 In my limited exposure to CakePHP, it always seemed that the vendors
 directory was intended for third-party resources. However, the
 tutorial below recommends placing TinyMCE in a jscripts directory
 rather than vendors, so I'm assuming that I have something wrong. What
 is 'vendors' for, exactly?

TinyMCE is a javascript library, so it makes sense to place the JS
files in the /webroot/js directory. The vendors directory is for
external php classes, such as Markdown etc and is not publicly
accessible via the web, which would be required to access the js
files.

hth

jon

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: KTML Editor

2008-09-12 Thread Jon Bennett

 man that darn google always so fast with an answer...

Nate missed a crucial part of the request, they asked for the reply to
be sent offlist to just them... :p

jb

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: KTML Editor

2008-09-12 Thread Marcin Domanski

On Fri, Sep 12, 2008 at 11:24 PM, Jon Bennett [EMAIL PROTECTED] wrote:

 man that darn google always so fast with an answer...

 Nate missed a crucial part of the request, they asked for the reply to
 be sent offlist to just them... :p

yeah you can't get any decent  support here ;)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: KTML Editor

2008-09-12 Thread Sam DeVore

At least the support is cheap

===
Sent from my ATT Rotary Phone
http://blog.samdevore.com


On Sep 12, 2008, at 3:31 PM, Marcin Domanski [EMAIL PROTECTED]  
wrote:


 On Fri, Sep 12, 2008 at 11:24 PM, Jon Bennett [EMAIL PROTECTED]  
 wrote:

 man that darn google always so fast with an answer...

 Nate missed a crucial part of the request, they asked for the reply  
 to
 be sent offlist to just them... :p

 yeah you can't get any decent  support here ;)

 

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Error handling

2008-09-12 Thread Donkeybob

check out the manual for debugging and logging

http://book.cakephp.org/view/155/Debugging
http://book.cakephp.org/view/157/Logging

also . . .firebug with firephp is a great tool!

On Sep 12, 6:06 pm, Luiz Poleto [EMAIL PROTECTED] wrote:
 Hello guys,
 I was wondering whether it's possible to catch error message and error code
 (if any), when trying to perform any action in cake.
 Let me explain better:
 Suppose i called a $this-save() method and it didn't save for any reason.
 Instead of display an error to the user, i would like to log the error
 message and display a user friendly message to the user. The second part,
 about the message, i already do, but i often have no clue what the error is.
 Any ideas?

 Best regards,
 Luiz Poleto
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Models and Has... help please!

2008-09-12 Thread David C. Zentgraf

What about replying to the answers you already received in the other  
threads about the very same topic instead of starting from scratch  
every time? Also, you'll have to find the final answer yourself, it's  
about the basic design of your app. You got a bunch of advise already  
which should help you to figure out the final solution.

On 13 Sep 2008, at 03:15, soldier.coder wrote:

 But I guess such thinking on my part is futile. So let me lay it all
 out for you.
 My tables:

 courses-- this is here to provide in ID and a course
 name for display.
   course_id
   course_name

 categories -- another look up table for category names
   category_id
   category_name

 So right now I can look up course names and categories in, say
 dropdowns, but I really have
 no place to store *which* categories are for *which* courses.  So

 weights
   course_id
   category_id
   number(number of grades in this category)
   weight (weight for entire category)

 At this point I can pick and store the grading categories for a course
 along with how many
 grades will be stored for what category and the percentage of the
 total grade for the course
 that grades in this category represent.  But I still have no storage
 for the actual grades.
 But I can't have grades yet -- because I have no students...

 students
   student_id
   first_name
   last_name
   email
   user_name
   password

 now I can store grades

 grades
   course_id
   student_id
   category_id
   date_assigned
   number_grade

 at the some point you need to sum up all the grades in a particular
 category, then multiply
 the total of the category by the weight for the category:

 category_totals
   course_id
   student_id
   category_id
   category_raw_total
   category_total_x_weight

 then finally, by summing the category_total_x_weight for a particular
 course, and student,
 you get the final grade.

 final_grades
   course_id
   student_id
   final_grade

 *Soo!  That is my whole database setup.

 I hate to ask, but could someone tell me how to set up my models?
 I have these huge gaps in my understanding.

 For instance, I can see that weights belongs to courses and
 categories.

 So I should have something like this for Weight model:
 ?
   class Weight extends AppModel {
  var $name = 'Weight';
  var $belongsTo = array (
 'Course'   = array('className' = 'Course',   'foreignKey'
 = 'course_id',
   'conditions' =null, 'fields'=null),
 'Category' = array('className' = 'Category', 'foreignKey'
 = 'category_id',
'conditions' =null, 'fields' =null)
  )
   }
 ?

 But then do I need to establish or describe some kind of relationship
 going the other way for
 Course and Category?

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Installation: Ubuntu / Apache2.2 / mod_re_write

2008-09-12 Thread Brett Wilton

Sound's like you don't have the .htaccess file in your /var/www/dan
directory.  If that is not there it will not load your img and css
directories correctly.

---
Brett Wilton
http://wiltonsoftware.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Installation: Ubuntu / Apache2.2 / mod_re_write

2008-09-12 Thread dan3501

Thanks to all the folks on this thread.  I was able to read a post by
Claudia, and that was able to guide me to fix my problem.  Thanks
again.

On Sep 12, 12:12 pm, dan3501 [EMAIL PROTECTED] wrote:
 I've searched the Internet to no end, and still haven't been able to
 resolve this issue.
 Issue: CakePHP welcome page appears without colors -- indicating a
 configuration error.
 Environment: Ubuntu 8.0.4, apache document-root : /var/www, cake
 application directory (where I unzipped the cake zip files): /var/www/
 dan
 What I did:
 (1) Installed apache2.2, php5;
 (2) unzipped cake to /var/www/dan;
 (3) modified sites-enabled to ensure directory set up and
 AllowOverride All;
 (4) reviewed .htaccess in /var/www/dan/app and /var/www/dan/app/
 webroot -- looks file;
 (5) set apache logging to debug;
 (6) executed a2enmod rewrite and the force-reload command to ensure
 mod_rewrite is working;
 (7) reviewed phpinfo() to ensure mod_rewrite is loaded

 I've installed apache, php5 under Ubuntu with apt-get install.  When I
 hit the CakePHP welcome page by going to /localhost/dan, I do not get
 the colors.  When I review the apache logs, I get file not found: /
 var/www/dan/css and also file not found: /var/www/img.  Simply
 stated, it made me think that there was an issue with the .htaccess
 file, perhaps it should be pointing to webroot (where the css and img
 directories are located), but when I tried to make changes to
 the .htaccess files in /var/www/dan/app or /var/www/dan/app/webroot,
 nothing worked.

 More curiously, when I installed cakephp-instaweb and then ran cakephp-
 instaweb in the /var/www/dan directory.  I then went to localhost:
 3000, and the CakePHP welcome page appeared correctly -- which made me
 think that the issue is with Apache and some of my configurations
 (whether .htaccess or some other file) rather than in the cake
 specific configuration.

 I've been looking on the Internet and through all kinds of cake
 documentation and have been unable to resolve this issue.  It works
 fine on my Windows XP development environment, but I'm looking to
 implement my production system on Linux.  Help me to resolve this and
 you will have my heartfelt appreciation!!

 Dan

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Edit forms in Internet Explorer

2008-09-12 Thread Niko

I was having the exact same problem until I disable the mod_auth_sspi
module. I then replaced it with mod_authnz_ldap and everything works
fine. Maybe you can check something at a module level. When I set a
proxy between the web server and IE I found out that when it got stuck
all the server got was GET request and no PUT. If you wait a couple of
seconds and hit the submit button you got a PUT request, as expected.
Hope that helps.
Nico.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Installation: Ubuntu / Apache2.2 / mod_re_write

2008-09-12 Thread Brett Wilton

Hi dan3501,
it would be worth giving your solution to the problem so others down
that track can google it.
---
Brett Wilton
http://wiltonsoftware.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Fuzzy Search

2008-09-12 Thread Dr. Tarique Sani

You probably mean fullText search - Lucene is an option another option
is Sphinx, There is a searchable behavior somewhere built around
Zend_Search_Lucene

HTH
Tarique



On Fri, Sep 12, 2008 at 9:44 PM, Kyle Decot [EMAIL PROTECTED] wrote:

 I am building a skatepark directory website and I would like my
 visitors to be able to do fuzzy searches such as ohio outdoor or
 california concrete. Any tips on how to go about making a fuzzy
 search query like this? Thanks.
 --~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.


-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---