Re: parseExtensions on Lighttpd

2008-07-11 Thread flashlight

this worked for me, now is solved.

 url.rewrite-once = (
/(css|files|img|js|stats)/(.*) = /$1/$2,
^/(.+)/?$  = /index.php?url=$1
  )


On Jul 10, 5:49 pm, Christian Winther [EMAIL PROTECTED] wrote:
 Do you use mod_magnet + cleanurl-v6.lua to rewrite on lighttpd?

 If not savehttp://bin.cakephp.org/view/181101in a file and add

 mod_magnet  to your server.modules list in lighttpd.conf

 And add

 magnet.attract-physical-path-to = ( %s )   to your vhost / lighttpd.conf  
 where %s is the full path to the lua script

 -Original Message-
 From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
 flashlight
 Sent: 11. juli 2008 00:18
 To: CakePHP
 Subject: parseExtensions on Lighttpd

 Somebody knows how to add support to extensions on lighttpd, maybe its
 the rewrite rule, but everytime i try to parse any extension like
 a .js or .rss i get a 404.

 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: Echo Fields of Article Ceator/Modifer in View

2008-07-11 Thread double07

So the News items should Belong To a user. The problem I see is that
you can't seem to define a local key?

My code in the News controller should look like this yeah?

var $belongsTo = array('Creator' = array(
'className' = 'User',
'foreignKey' = 'user_id',
'localKey' = 'creator_id', 
//can't seem to define this?
),
  'Modifier' = array(
'className' = 'User',
'foreignKey' = 'user_id',
'localKey' = 'modifer_id', 
//can't seem to define this?
),

);

How can I define the local key?

On Jul 9, 10:02 pm, James K [EMAIL PROTECTED] wrote:
 You would need to define a relationship in your news model to the
 user's model via the id set by the behaviour. This will tell cake how
 to pull the related models from a find call on the news model (http://
 book.cakephp.org/view/66/models#associations-linking-models-to-78).

 You'll also want to look in the manual for more information on the new
 containable behaviour built into the release candidates of CakePHP 1.2
 for how to narrow down what fields/models you want returned (http://
 book.cakephp.org/view/474/containable)

 Good luck,

 - James

 On Jul 9, 12:26 am, double07 [EMAIL PROTECTED] wrote:

  Hi All,

  This seems like a real n00b question, but here goes. I'm working on an
  app which has articles - in my case news - and users who create/modify
  the news articles. Now I found this nifty little behaviour 
  -http://blog.loadsys.com/2008/05/02/automagically-setting-user-id-of-r...
  - which automagically records the user id in the news record when
  somebody adds or edits a news item. So I've got the user id of the
  creator/modifier in the news article record... lovely.

  So, how then do I use that id in the creator/modifer to grab say the
  name/email/username of the user and echo it out in a view? At first I
  was thinking it would be a relationship, but now I'm thinking I need
  to do something in the news controller?

  If anyone could point me in the right direct that would be much
  appreciated. Any examples would be helpful.

  TIA.

--~--~-~--~~~---~--~~
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: Request for the Devs to take into consideration concerning print

2008-07-11 Thread Alain Veylit

I'd have to agree: CakePHP is php, not CSS -
Having said that, is anyone working on a PDF component ?
Alain

Lance Willett wrote:
 Jonathan: In that sense, print stylesheets aren't much of a priority for 
 most projects. This depends heavily on user
 expectations and type of project.
 

 In my experience using CakePHP I've always created my own stylesheets,
 and thus have never noticed the lack of default print styles. I'd
 imagine that most developers would use the cake.generic stylesheet
 when they are learning the system and prototyping sample apps–but
 would then create new, specific CSS files for their production
 website. So, in that sense, having a generic print stylesheet might
 not be that useful to the typical CakePHP developer; they'd end up
 with different HTML elements in their view files and would therefore
 need a specifically written print stylesheet.

 But, I do respect that fact that once in a while you do need a quick-
 and-dirty setup, and having basic screen and print styles already laid
 out can be a lifesaver. I know that I often use the default admin
 styles that come with CakePHP since the public views are the most
 important and get immediate attention (while the admin forms and
 tables can usually wait for custom CSS since they work as is).

   
 With regards to the default styles for CakePHP ... maybe we'll see an update 
 before 1.2 final.
 

 I'd love to help with this. I don't see an open ticket in Trac, so I
 assume I would just create one with a patch attached (the print CSS
 file), and go from there.
 

   


-- 
Alain Veylit
Application developer
Claremont Colleges Digital Library
The Libraries of the Claremont Colleges
Claremont University Consortium
909-621-8013


--~--~-~--~~~---~--~~
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: MSSQL ntext problem

2008-07-11 Thread bitkidoku

Thank you very much :-) I did a change in the source in a similar way.
It is dirty but it works.

On Jul 11, 12:32 am, James K [EMAIL PROTECTED] wrote:
 Oh, PS - I modified the hack so that it only runs when it recognizes
 an XML type from SQL 2005. If you change my
 $fieldDescription[$fields[$i]]['type'] == 'xml' to
 $fieldDescription[$fields[$i]]['type'] == 'text', it should work for
 ntext fields in general.

 - James

 On Jul 10, 12:34 pm, James K [EMAIL PROTECTED] wrote:

  The official word from the CakePHP team is that CakePHP does not
  support ntext fields. You're stuck using the text casting hack. I'm
  using MS SQL myself, and have had to use it, unfortunately.

  I'm using 1.2 RC2 and have successfully gotten that same hack to work
  - you have to change it a bit to work with the changes introduced in
  RC1. Here's my version of the fields function from RC2:

          function fields($model, $alias = null, $fields = array(), $quote =
  true) {
                  if (empty($alias)) {
                          $alias = $model-alias;
                  }
                  $fields = parent::fields($model, $alias, $fields, false);
                  $count = count($fields);

                  $fieldDescription = $this-describe($model);

                  if ($count = 1  $fields[0] != '*'  strpos($fields[0],
  'COUNT(*)') === false) {
                          for ($i = 0; $i  $count; $i++) {
                                  $prepend = '';

                                  if (strpos($fields[$i], 'DISTINCT') !== 
  false) {
                                          $prepend = 'DISTINCT ';
                                          $fields[$i] = 
  trim(str_replace('DISTINCT', '', $fields[$i]));
                                  }
                                  $fieldAlias = count($this-__fieldMappings);

                                  if (!preg_match('/\s+AS\s+/i', 
  $fields[$i])) {
                                          if (strpos($fields[$i], '.') === 
  false) {
                                                  
  $this-__fieldMappings[$alias . '__' . $fieldAlias] = $alias .
  '.' . $fields[$i];
                                                  if 
  ($fieldDescription[$fields[$i]]['type'] == 'xml') {
                                                          $fieldName = 
  CAST(CAST(.$this-name($alias . '.' .
  $fields[$i]). AS VARCHAR(8000)) AS TEXT);
                                                  } else {
                                                          $fieldName  = 
  $this-name($alias . '.' . $fields[$i]);
                                                  }
                                                  $fieldAlias = 
  $this-name($alias . '__' . $fieldAlias);
                                          } else {
                                                  $build = explode('.', 
  $fields[$i]);
                                                  
  $this-__fieldMappings[$build[0] . '__' . $fieldAlias] =
  $fields[$i];
                                                  $fieldName  = 
  $this-name($build[0] . '.' . $build[1]);
                                                  $fieldAlias = 
  $this-name(preg_replace(/^\[(.+)\]$/, $1,
  $build[0]) . '__' . $fieldAlias);
                                          }
                                          if 
  ($model-getColumnType($fields[$i]) == 'datetime') {
                                                  $fieldName = 
  CONVERT(VARCHAR(20), {$fieldName}, 20);
                                          }
                                          $fields[$i] =  {$fieldName} AS 
  {$fieldAlias};
                                  }
                                  $fields[$i] = $prepend . $fields[$i];
                          }
                  }
                  return $fields;
          }

  On Jul 10, 9:59 am, bitkidoku [EMAIL PROTECTED] wrote:

   Hi everyone,

   I have a problem using my existing MSSQL DB. I get the following
   error:
   SQL Error: Unicode data in a Unicode-only collation or ntext data
   cannot be sent to clients using DB-Library (such as ISQL) or ODBC
   version 3.7 or earlier. [CORE\cake\libs\model\datasources
   \dbo_source.php, line 512]

   I encountered this error before while writing my own PHP code. It can
   be 'solved' casting ntext field to text. The closest solution for
   CakePHP I found is this:https://trac.cakephp.org/ticket/4287

   But since that applies to 1.2.0.6311 I couldn't make it work at the
   moment.

   Does anyone have any idea resolving this issue?
   Thanks in advance :)

   PS: Why do I insist on using MSSQL? Well, that is another story... I
   am not very happy about that but I have to.

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

Re: $html-textarea displaying actual html codes

2008-07-11 Thread Vixy

Thanks, I'll go with the 3rd option. How can I disable it from
CakePHP? What files do I need to edit?
Thanks, Vix
On Jul 10, 3:58 pm, Lance Willett [EMAIL PROTECTED] wrote:
  Thanks, my question is, how can i stop the script from out putting the
  html code when its inserted through the comments box?

 It appears that you are using a JavaScript comment form preview
 script, which unfortunately I can't help you with—and if it *is* a
 JavaScript issue it's probably not a topic for the CakePHP group here,
 anyway.

 Some things to think about are:
 1) What's the purpose of the script? Does it preview the comment, or
 is it simply to post the comment without refreshing the page?
 2) Have you tried processing the comment without JavaScript? It's
 highly recommended to get the form working as you intend first, then
 add scripting later to improve the usability. There are lots of ways
 to clean and filter input in PHP, and CakePHP has some nice built-in
 tools like Sanitize (http://api.cakephp.org/1.2/class_sanitize.html
 andhttp://book.cakephp.org/view/153/data-sanitization).
 3) If you don't want HTML to be allowed in the comment form, you can
 filter the input and give an error to the view that says something
 like HTML not allowed. With CakePHP you can do this type of
 validation without any JavaScript involved.

 Hope that helps you.

  here what Iam using:
  form action=?php echo $html-url('/THEURL/'.$uid); ? method=post
  div class=optional
  ?php echo $form-labelTag( 'THEURL', 'Comment' );?
  div style=margin-left:174px
             ?php echo $html-textarea( 'THEURL', array('class'= 'editor') 
  );?
             script type=text/javascript
             $.editor.start({ path:'?php echo $html-url('/Theeditor'); 
  ?/', width: '600px',height: '400px' });
             $.editor.update();
             /script
  In Firefox 3 it doesn't display editor instead it shows a black box
  and in that black box, any one can add any type of code they want and
  it will output it. So my question is, how can i stop the black box
  from outputting the codes OR how can I make Firefox 3 display editor
  too?
  Thanks, Vix

--~--~-~--~~~---~--~~
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: parseExtensions on Lighttpd

2008-07-11 Thread flashlight

i found
url.rewrite-once = (
/(css|files|img|js|stats)/(.*) = /$1/$2,
^/(.+)/?$ = /index.php?url=$1
  )

fixes this


On Jul 10, 5:18 pm, flashlight [EMAIL PROTECTED] wrote:
 Somebody knows how to add support to extensions on lighttpd, maybe its
 the rewrite rule, but everytime i try to parse any extension like
 a .js or .rss i get a 404.

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



I encountered a problem

2008-07-11 Thread 软件梦工厂

I encountered a problem,if I add a plugin whose name is a substring of
the path string,the function strip_plugin will return a wrong $base
string.
strip_plugin(/cakemanager/index.php/manager,manager) should return
/cakemanager/index.php but it returns /cake/index.php

--~--~-~--~~~---~--~~
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: HABTM Relations and additional info in the rlation table

2008-07-11 Thread XuMiX

one more thing here, how can I save this additional data into the
relation table?

On 4 июл, 12:14, XuMiX [EMAIL PROTECTED] wrote:
 thx, i'll have a try

 On 2 июл, 23:23, James K [EMAIL PROTECTED] wrote:



  CakePHP has no problem reading extra fields in your join table. As
  long as you're naming your join table correctly and have a
  hasAndBelongsToMany relationship to the model on the other side of the
  join table, it'll pull the extra fields from a find automatically.

  On Jul 2, 5:35 am,XuMiX[EMAIL PROTECTED] wrote:

   i have a habtm relation, persons, groups, and a relation table
   groups_persons
   i need to add some more info into the relation table, for instance
   year of presence, role, etc.
   how do i get that info within cake ? Or how do i organize my tables
   and models?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM Relations and additional info in the rlation table

2008-07-11 Thread XuMiX

and one more thing according to this code in model.php
if (!empty($newValues)) {
$fields = join(',', array(

$db-name($this-hasAndBelongsToMany[$assoc]['foreignKey']),

$db-name($this-hasAndBelongsToMany[$assoc]
['associationForeignKey'])
));
$db-insertMulti($this-{$join}, 
$fields, $newValues);
}
there is no way to save additional data

On 2 июл, 23:23, James K [EMAIL PROTECTED] wrote:
 CakePHP has no problem reading extra fields in your join table. As
 long as you're naming your join table correctly and have a
 hasAndBelongsToMany relationship to the model on the other side of the
 join table, it'll pull the extra fields from a find automatically.

 On Jul 2, 5:35 am,XuMiX[EMAIL PROTECTED] wrote:



  i have a habtm relation, persons, groups, and a relation table
  groups_persons
  i need to add some more info into the relation table, for instance
  year of presence, role, etc.
  how do i get that info within cake ? Or how do i organize my tables
  and models?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



help with layout error message

2008-07-11 Thread .
I need help with this error message please. I do not have any Array.ctp
layout file. Why am I getting this all of a sudden?

 Missing Layout

*Error: *The layout file *C:\xampp\htdocs\app\views\layouts\Array.ctp* can
not be found or does not exist.

*Error: *Confirm you have created the file: *
C:\xampp\htdocs\app\views\layouts\Array.ctp*

*Notice: *If you want to customize this error message, create
app\views\errors\missing_layout.ctp

--~--~-~--~~~---~--~~
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 layout error message

2008-07-11 Thread .
I am not referring to any Array.ctp whatsoever. Why do I get this error?
Thanks

On Fri, Jul 11, 2008 at 12:42 AM, . [EMAIL PROTECTED] wrote:

 I need help with this error message please. I do not have any Array.ctp
 layout file. Why am I getting this all of a sudden?

  Missing Layout

 *Error: *The layout file *C:\xampp\htdocs\app\views\layouts\Array.ctp* can
 not be found or does not exist.

 *Error: *Confirm you have created the file: *
 C:\xampp\htdocs\app\views\layouts\Array.ctp*

 *Notice: *If you want to customize this error message, create
 app\views\errors\missing_layout.ctp


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



the questions rarely answered. why?

2008-07-11 Thread polutan

Hello :) i'am so sorry before if this post sounds insulting :)
i just want to know, why most of questions here is rarely answered? is
all happier using #cakephp instead of cake's google group? why cake's
mailing list was not as crowded as in #cakephp irc channel?

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: help with layout error message

2008-07-11 Thread Marc MENDEZ

Hi,

Look in the controller containing the action which raised this error, if 
you don't use a $layout variable or call setLayout() ?



. a écrit :
 I am not referring to any Array.ctp whatsoever. Why do I get this 
 error? Thanks

 On Fri, Jul 11, 2008 at 12:42 AM, . [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 I need help with this error message please. I do not have any
 Array.ctp layout file. Why am I getting this all of a sudden?
  


 Missing Layout

 *Error: *The layout file
 /C:\xampp\htdocs\app\views\layouts\Array.ctp/ can not be found or
 does not exist.

 *Error: *Confirm you have created the file:
 /C:\xampp\htdocs\app\views\layouts\Array.ctp/

 *Notice: *If you want to customize this error message, create
 app\views\errors\missing_layout.ctp



 




--~--~-~--~~~---~--~~
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: HABTM Relations and additional info in the rlation table

2008-07-11 Thread duRqoo

Hey XuMiX,

with cake u are able to save meta data within join table, but it's
somehow a tricky part. I suggest you to read (http://cricava.com/blogs/
index.php?
blog=6title=modelizing_habtm_join_tables_in_cakephp_more=1c=1tb=1pb=1)
to get the point.

First of all when saving habtm related data the join-table is auto-
modelized for you. If you aim to save meta data in the join table, you
will surely like to validate it as well, so good start is to create
model for your join table (in your case GroupsPerson, note: convention
is person = people), where you can define belongsTo associations to
habtm related models so as validation for the meta-data and one more
important thing which i will cover later.

Now when you have your join-table model i assume you are familiar with
saving habtm data without meta data in join table (reminder: $this-
data['RelatedModel'] = array of associated ids). In case of meta-data
thing you just have to format that passed array other way so for your
example if you are saving new Group and it's associated people it
would be like this:

array(
0 = array(
person_id = XYZ,
year = 123541,
amount = 123123
),

1 = array(
person_id = ABC,
year = 1212,
amount = 123
)

...
);

Last and most important thing is when workin with meta data in join
table. You have to change the database structure of it. Basicaly join-
table is a weak entity type consisting of foreign keys of related
tables which are together creating primary key of the join table.
Unfortunatelly cake don't know how to handle multicolumn primary keys
so you have to create a autoincrementing ID primary key for your join
table, and the associated foreign keys, well they just stay FKs. For
your case it will be

groups_people ( PK(id), FKs(group_id, person_id) )

This way everything will work ok and cakes sqls will be generated
properly.

Remember the one important thing i've noticed up there ? Ya you now
have to ensure that the changed join-table still works as it should,
that means it have correct data. The fact the primary key is now ID it
allows you to save multiple same associations which is not good. You
can avoid this by adding a beforeSave callback to the join-table model
and aborting the save process if you find already existing combination
of FKs in the join table.

Hope that helps.
d.

On 11. Júl, 09:19 h., XuMiX [EMAIL PROTECTED] wrote:
 and one more thing according to this code in model.php
 if (!empty($newValues)) {
 $fields = join(',', array(
 
 $db-name($this-hasAndBelongsToMany[$assoc]['foreignKey']),
 
 $db-name($this-hasAndBelongsToMany[$assoc]
 ['associationForeignKey'])
 ));
 $db-insertMulti($this-{$join}, 
 $fields, $newValues);
 }
 there is no way to save additional data

 On 2 июл, 23:23, James K [EMAIL PROTECTED] wrote:

  CakePHP has no problem reading extra fields in your join table. As
  long as you're naming your join table correctly and have a
  hasAndBelongsToMany relationship to the model on the other side of the
  join table, it'll pull the extra fields from a find automatically.

  On Jul 2, 5:35 am,XuMiX[EMAIL PROTECTED] wrote:

   i have a habtm relation, persons, groups, and a relation table
   groups_persons
   i need to add some more info into the relation table, for instance
   year of presence, role, etc.
   how do i get that info within cake ? Or how do i organize my tables
   and models?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: help with layout error message

2008-07-11 Thread .
Hi

I do not have a var $layout or any setLayout in the controller.

The wierd thing is this was working just yesterday...



On Fri, Jul 11, 2008 at 1:00 AM, Marc MENDEZ [EMAIL PROTECTED]
wrote:


 Hi,

 Look in the controller containing the action which raised this error, if
 you don't use a $layout variable or call setLayout() ?



 . a écrit :
  I am not referring to any Array.ctp whatsoever. Why do I get this
  error? Thanks
 
  On Fri, Jul 11, 2008 at 12:42 AM, . [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  I need help with this error message please. I do not have any
  Array.ctp layout file. Why am I getting this all of a sudden?
 
 
 
  Missing Layout
 
  *Error: *The layout file
  /C:\xampp\htdocs\app\views\layouts\Array.ctp/ can not be found or
  does not exist.
 
  *Error: *Confirm you have created the file:
  /C:\xampp\htdocs\app\views\layouts\Array.ctp/
 
  *Notice: *If you want to customize this error message, create
  app\views\errors\missing_layout.ctp
 
 
 
  




 


--~--~-~--~~~---~--~~
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 layout error message

2008-07-11 Thread .
This seems to happen in all of my controllers where the view has a form
submit. after I submit the form (any form) i get this error.

On Fri, Jul 11, 2008 at 1:07 AM, . [EMAIL PROTECTED] wrote:

 Hi

 I do not have a var $layout or any setLayout in the controller.

 The wierd thing is this was working just yesterday...



 On Fri, Jul 11, 2008 at 1:00 AM, Marc MENDEZ [EMAIL PROTECTED]
 wrote:


 Hi,

 Look in the controller containing the action which raised this error, if
 you don't use a $layout variable or call setLayout() ?



 . a écrit :
  I am not referring to any Array.ctp whatsoever. Why do I get this
  error? Thanks
 
  On Fri, Jul 11, 2008 at 12:42 AM, . [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  I need help with this error message please. I do not have any
  Array.ctp layout file. Why am I getting this all of a sudden?
 
 
 
  Missing Layout
 
  *Error: *The layout file
  /C:\xampp\htdocs\app\views\layouts\Array.ctp/ can not be found or
  does not exist.
 
  *Error: *Confirm you have created the file:
  /C:\xampp\htdocs\app\views\layouts\Array.ctp/
 
  *Notice: *If you want to customize this error message, create
  app\views\errors\missing_layout.ctp
 
 
 
  




 



--~--~-~--~~~---~--~~
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: HABTM Relations and additional info in the rlation table

2008-07-11 Thread XuMiX

thanks a lot! this was the most helpful and friendly post i've ever
recieved :)

BTW: the thing i needed is only:

array(
0 = array(
person_id = XYZ,
year = 123541,
amount = 123123
),
1 = array(
person_id = ABC,
year = 1212,
amount = 123
)
...
);




On 11 июл, 15:04, duRqoo [EMAIL PROTECTED] wrote:
 Hey XuMiX,

 with cake u are able to save meta data within join table, but it's
 somehow a tricky part. I suggest you to read (http://cricava.com/blogs/
 index.php?
 blog=6title=modelizing_habtm_join_tables_in_cakephp_more=1c=1tb=1pb=1)
 to get the point.

 First of all when saving habtm related data the join-table is auto-
 modelized for you. If you aim to save meta data in the join table, you
 will surely like to validate it as well, so good start is to create
 model for your join table (in your case GroupsPerson, note: convention
 is person = people), where you can define belongsTo associations to
 habtm related models so as validation for the meta-data and one more
 important thing which i will cover later.

 Now when you have your join-table model i assume you are familiar with
 saving habtm data without meta data in join table (reminder: 
 $this-data['RelatedModel'] = array of associated ids). In case of meta-data

 thing you just have to format that passed array other way so for your
 example if you are saving new Group and it's associated people it
 would be like this:

 array(
 0 = array(
 person_id = XYZ,
 year = 123541,
 amount = 123123
 ),

 1 = array(
 person_id = ABC,
 year = 1212,
 amount = 123
 )

 ...
 );

 Last and most important thing is when workin with meta data in join
 table. You have to change the database structure of it. Basicaly join-
 table is a weak entity type consisting of foreign keys of related
 tables which are together creating primary key of the join table.
 Unfortunatelly cake don't know how to handle multicolumn primary keys
 so you have to create a autoincrementing ID primary key for your join
 table, and the associated foreign keys, well they just stay FKs. For
 your case it will be

 groups_people ( PK(id), FKs(group_id, person_id) )

 This way everything will work ok and cakes sqls will be generated
 properly.

 Remember the one important thing i've noticed up there ? Ya you now
 have to ensure that the changed join-table still works as it should,
 that means it have correct data. The fact the primary key is now ID it
 allows you to save multiple same associations which is not good. You
 can avoid this by adding a beforeSave callback to the join-table model
 and aborting the save process if you find already existing combination
 of FKs in the join table.

 Hope that helps.
 d.

 On 11. Júl, 09:19 h., XuMiX [EMAIL PROTECTED] wrote:



  and one more thing according to this code in model.php
  if (!empty($newValues)) {
  $fields = join(',', array(
  
  $db-name($this-hasAndBelongsToMany[$assoc]['foreignKey']),
  
  $db-name($this-hasAndBelongsToMany[$assoc]
  ['associationForeignKey'])
  ));
  $db-insertMulti($this-{$join}, 
  $fields, $newValues);
  }
  there is no way to save additional data

  On 2 июл, 23:23, James K [EMAIL PROTECTED] wrote:

   CakePHP has no problem reading extra fields in your join table. As
   long as you're naming your join table correctly and have a
   hasAndBelongsToMany relationship to the model on the other side of the
   join table, it'll pull the extra fields from a find automatically.

   On Jul 2, 5:35 am,XuMiX[EMAIL PROTECTED] wrote:

i have a habtm relation, persons, groups, and a relation table
groups_persons
i need to add some more info into the relation table, for instance
year of presence, role, etc.
how do i get that info within cake ? Or how do i organize my tables
and models?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: help with layout error message

2008-07-11 Thread .
I just restarted the Apache server and mysql server, and it worked! I am
still curious why this though. Any ideas? I am using XAMPP.

On Fri, Jul 11, 2008 at 1:12 AM, . [EMAIL PROTECTED] wrote:

 This seems to happen in all of my controllers where the view has a form
 submit. after I submit the form (any form) i get this error.


 On Fri, Jul 11, 2008 at 1:07 AM, . [EMAIL PROTECTED] wrote:

 Hi

 I do not have a var $layout or any setLayout in the controller.

 The wierd thing is this was working just yesterday...



 On Fri, Jul 11, 2008 at 1:00 AM, Marc MENDEZ [EMAIL PROTECTED]
 wrote:


 Hi,

 Look in the controller containing the action which raised this error, if
 you don't use a $layout variable or call setLayout() ?



 . a écrit :
  I am not referring to any Array.ctp whatsoever. Why do I get this
  error? Thanks
 
  On Fri, Jul 11, 2008 at 12:42 AM, . [EMAIL PROTECTED]
   mailto:[EMAIL PROTECTED] wrote:
 
  I need help with this error message please. I do not have any
  Array.ctp layout file. Why am I getting this all of a sudden?
 
 
 
  Missing Layout
 
  *Error: *The layout file
  /C:\xampp\htdocs\app\views\layouts\Array.ctp/ can not be found or
  does not exist.
 
  *Error: *Confirm you have created the file:
  /C:\xampp\htdocs\app\views\layouts\Array.ctp/
 
  *Notice: *If you want to customize this error message, create
  app\views\errors\missing_layout.ctp
 
 
 
  




 




--~--~-~--~~~---~--~~
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: Best way to include functionality in models

2008-07-11 Thread CrazyDave

@AD7Six, I'm still not clued up enough on behaviours to start creating
my own.  It'd help if the cakephp book had some information on
creating them and an example http://book.cakephp.org/view/88/behaviors

Also the content being saved shouldn't ever be edited so I figured
using Geshi before saving it would lower the overhead of doing it
every time it's displayed.  Other content which can be edited uses
Mark Story's Geshi Helper ;)

@James K  Joe, I'm already using the beforeSave but didn't want to
duplicate code starting up and configuring HTMLPurifier and Geshi.
I'm after a better place to put that code to then call from beforeSave/
Validate :)

On Jul 10, 10:35 pm, James K [EMAIL PROTECTED] wrote:
 I was going to suggest this as well. The beforeSave function fires
 before save/validation and you can access $this-data and modify it as
 you see fit. As long as you return true, the script will continue none
 the wiser.

 - James

 On Jul 10, 1:20 pm, Joe [EMAIL PROTECTED] wrote:

  You could use beforeSave

  On Jul 10, 9:30 am, CrazyDave [EMAIL PROTECTED] wrote:

   Hi,

   I've been wanting to include some extra functionality in a model but
   wanted to know the best CakePHP way of going about things.

   For example we've got controllers and components, then views and
   helpers.

   I want my model to behave as normal but say use something like a
   helper to process the text before saving / validation.  I did think
   about processing certain content in the model with Geshi but could see
   no easy way of doing so with adding it in all the models required or
   the appmodel.

   Should behaviours be used for this sort of thing?  As it doesn't quite
   seem right to me at the moment.

   Thanks for any help,
   Dave
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Best way to include functionality in models

2008-07-11 Thread Jon Bennett

Hi CrazyDave,

 @AD7Six, I'm still not clued up enough on behaviours to start creating
 my own.  It'd help if the cakephp book had some information on
 creating them and an example http://book.cakephp.org/view/88/behaviors

 Also the content being saved shouldn't ever be edited so I figured
 using Geshi before saving it would lower the overhead of doing it
 every time it's displayed.  Other content which can be edited uses
 Mark Story's Geshi Helper ;)

Take a look at the textile behaviour -
http://wiki.kabturek.info/textile_behavior - I think this would match
up perfectly for what you're doing.

If you are saving the text to be Geshi'd in a column called
'content', I would add a new column to the DB called 'geshi_content'.
Then, in your behaviour's beforeSave you convert the data in
$this-data[$model]['content'] with Geshi and place the converted data
in $this-data[$model]['geshi_content']. This way, you don't have to
use the helper to convert the copy every time it's requested, but it
can still be edited easily because you've stored the plain text
version. Also, by packaging up as a behaviour, you only need to add a
prefixed field to ANY table to add syntax highlighting, making it very
reusable!

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: Best way to include functionality in models

2008-07-11 Thread AD7six



On Jul 11, 10:20 am, CrazyDave [EMAIL PROTECTED] wrote:
 @AD7Six, I'm still not clued up enough on behaviours to start creating
 my own.  It'd help if the cakephp book had some information on
 creating them and an examplehttp://book.cakephp.org/view/88/behaviors

Why not look at examples
http://bakery.cakephp.org/categories/view/12

Or look at the 'empty' behavior class that all behaviors extend
http://api.cakephp.org/class_model_behavior.html
--~--~-~--~~~---~--~~
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: the questions rarely answered. why?

2008-07-11 Thread Helder Oliveira
well many times the answer is in the docs / api / google.
People should use this list for weird things and strange problems, not about
the ajax api or about the form that doesn't submit or whatever
base knowledge problem people have.

On Fri, Jul 11, 2008 at 8:57 AM, polutan [EMAIL PROTECTED] wrote:


 Hello :) i'am so sorry before if this post sounds insulting :)
 i just want to know, why most of questions here is rarely answered? is
 all happier using #cakephp instead of cake's google group? why cake's
 mailing list was not as crowded as in #cakephp irc channel?

 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: Cake 1.2 App::import(vendor) isn't finding the file

2008-07-11 Thread RichardAtHome

 I did it the other way round - Auth the user in cake and set the cookies as
 expected by PHPBB - seemed like much less work

That was the direction I was veering towards too (if the phpBB class
doesn't work...)

Will definitely post my results when (if?) I get it to work...


On Jul 11, 5:27 am, Dr. Tarique Sani [EMAIL PROTECTED] wrote:
 On Fri, Jul 11, 2008 at 12:12 AM, Jonathan Snook [EMAIL PROTECTED]
 wrote:



  btw: if you're doing what I think you're doing, I'd love to see the
  final result. To get login working for a PHPBB integration, I ended up
  just using curl to do a post request and then pass the session cookies
  onto the end user. A little hackish but it worked.

 I did it the other way round - Auth the user in cake and set the cookies as
 expected by PHPBB - seemed like much less work

 Tarique

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



Re: Cake 1.2 App::import(vendor) isn't finding the file

2008-07-11 Thread RichardAtHome

Just tried:

App::import(Vendor, PHPBB_Login, false, null, 'phpbb.php');

And I'm still getting the same error:

Fatal error: Class 'PHPBB_Login' not found in C:\htdocs\projects
\archimbolo\app\controllers\users_controller.php on line 42

On Jul 10, 9:15 pm, b logica [EMAIL PROTECTED] wrote:
 try

 App::import(Vendor, PHPBB_Login, false, null, 'phpbb.php');

 On Thu, Jul 10, 2008 at 1:21 PM, RichardAtHome [EMAIL PROTECTED] wrote:

  Hi all

  I have a vendor class I've put in \root\vendors\phpbb.php

  Which contains the class:

  class PHPBB_Login {
  }

  And am referencing it in my code with the following:

  App::import(Vendor, PHPBB_Login, array(file=phpbb.php));

  (which I think is right)

  But when I try an instance the class with:

  $phpBB = new PHPBB_Login();

  I get the following error:

  Fatal error: Class 'PHPBB_Login' not found in C:\htdocs\projects
  \archimbolo\app\controllers\users_controller.php on line 41

  CakePHP isn't finding the vendor file, it also doesn't find it if I
  put it in app\vendors either.

  Where do I put the file? Or, what does App::Import need to look like
  for it to be able to find the vendor file?

  Thanks in advance.
--~--~-~--~~~---~--~~
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 layout error message

2008-07-11 Thread Marc MENDEZ

Absolutely no idea, and it may be hard to find why since this kind of 
behavior is difficult to reproduce

Happy it works again !


. a écrit :
 I just restarted the Apache server and mysql server, and it worked! I 
 am still curious why this though. Any ideas? I am using XAMPP.

 On Fri, Jul 11, 2008 at 1:12 AM, . [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 This seems to happen in all of my controllers where the view has a
 form submit. after I submit the form (any form) i get this error.


 On Fri, Jul 11, 2008 at 1:07 AM, . [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:

 Hi
  
 I do not have a var $layout or any setLayout in the controller.
  
 The wierd thing is this was working just yesterday...


  
 On Fri, Jul 11, 2008 at 1:00 AM, Marc MENDEZ
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 wrote:


 Hi,

 Look in the controller containing the action which raised
 this error, if
 you don't use a $layout variable or call setLayout() ?



 . a écrit :
  I am not referring to any Array.ctp whatsoever. Why do I
 get this
  error? Thanks
 
  On Fri, Jul 11, 2008 at 12:42 AM, . [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
 
  I need help with this error message please. I do not
 have any
  Array.ctp layout file. Why am I getting this all of
 a sudden?
 
 
 
  Missing Layout
 
  *Error: *The layout file
  /C:\xampp\htdocs\app\views\layouts\Array.ctp/ can
 not be found or
  does not exist.
 
  *Error: *Confirm you have created the file:
  /C:\xampp\htdocs\app\views\layouts\Array.ctp/
 
  *Notice: *If you want to customize this error
 message, create
  app\views\errors\missing_layout.ctp
 
 
 
  






 




--~--~-~--~~~---~--~~
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: Use localization in model validation

2008-07-11 Thread Alessandro Daducci

Sorry, You're right! I confused my code with the one that was in your
old post you cited about __contruct(...).
I used that trick, it was great!

But I don't understand: you told that in Changeset 5815 that problem
was fixed, but I still have it in my 1.2 RC2 version. What's wrong?

Sorry for my stupid questions, but I'm a newbie...

Alessandro


On 10 Lug, 19:28, francky06l [EMAIL PROTECTED] wrote:
 @Allessandro, that would not work, you can't initialize model variable
 with a function call.

 @Emilio, I did post a ticket on this a while ago with a solution (as
 you described), it has been introduced and removed after (probably
 because it does not cover all needs etc..). I end up writing the
 invalidFields method in app_model, taking over the core method.

 http://groups.google.com/group/cake-php/browse_thread/thread/fa32c81a...

 hth

 On Jul 10, 4:43 pm, Alessandro Daducci [EMAIL PROTECTED]
 wrote:

  Hi Emilio!

   I'll ilustrate the problem with an example, I want to make something
   like this:

   code
      var $validate = array
      (
              status = array
              (
                      rule = numeric,
                      rule = array (range, -1, 101),
                      message = error_task_status,
              ),
      );
   /code

   If you see the message for the error on validation, you see
   error_task_status, the idea is that the model calls
   __(error_task_status) for the message instead of printing
   error_task_status directly.

  I don't know if I understood properly, but I usually do this way:

  var $validate = array
  (
          status = array
          (
                  rule = numeric,
                  rule = array (range, -1, 101),
                  message = __(error_task_status,true),
          ),
  );

  This way, you can perform translation automatically!

--~--~-~--~~~---~--~~
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: Use localization in model validation

2008-07-11 Thread Alessandro Daducci

Sorry, you're right! I confused my code while I rewrite it to adapt to
Emilio's case. I just used the trick you cited in yout post (about
__contruct(...) method). It was a very nice solution!

But I still understand one point: you told that in Changeset 5818 that
problem was fixed. But I still have the same problem in RC2 version.
What is wrong?

Sorry my my stupid questions, but I'm a newbie with cakephp...

Alessandro

On 10 Lug, 19:28, francky06l [EMAIL PROTECTED] wrote:
 @Allessandro, that would not work, you can't initialize model variable
 with a function call.

 @Emilio, I did post a ticket on this a while ago with a solution (as
 you described), it has been introduced and removed after (probably
 because it does not cover all needs etc..). I end up writing the
 invalidFields method in app_model, taking over the core method.

 http://groups.google.com/group/cake-php/browse_thread/thread/fa32c81a...

 hth

 On Jul 10, 4:43 pm, Alessandro Daducci [EMAIL PROTECTED]
 wrote:

  Hi Emilio!

   I'll ilustrate the problem with an example, I want to make something
   like this:

   code
      var $validate = array
      (
              status = array
              (
                      rule = numeric,
                      rule = array (range, -1, 101),
                      message = error_task_status,
              ),
      );
   /code

   If you see the message for the error on validation, you see
   error_task_status, the idea is that the model calls
   __(error_task_status) for the message instead of printing
   error_task_status directly.

  I don't know if I understood properly, but I usually do this way:

  var $validate = array
  (
          status = array
          (
                  rule = numeric,
                  rule = array (range, -1, 101),
                  message = __(error_task_status,true),
          ),
  );

  This way, you can perform translation automatically!

--~--~-~--~~~---~--~~
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: the questions rarely answered. why?

2008-07-11 Thread Adam Royle

People (including me) get sick of answering the same questions over
and over again, often from people with little self-initiative. I think
some people (especially php noobs) find it easier to post a question
on google groups rather than spend the time poring over the manual,
api, blogs, google groups, or cake source code.

Sometimes I begin writing a reply to a post, but halfway through I
decide not to post it because it's obvious the person hasn't done any
preliminary research or hasn't made the effort of asking their
question in a way that is easy to answer.

Personally I think it's better that we don't see as much flaming on
this mailing list as we used to get, but then again I still think we
need to split the group into two - one that deals with installation
and setup issues, and another that deals with actual usage of cakephp,
mvc best practices, etc.

Cheers,
Adam

On Jul 11, 5:57 pm, polutan [EMAIL PROTECTED] wrote:
 Hello :) i'am so sorry before if this post sounds insulting :)
 i just want to know, why most of questions here is rarely answered? is
 all happier using #cakephp instead of cake's google group? why cake's
 mailing list was not as crowded as in #cakephp irc channel?

 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: the questions rarely answered. why?

2008-07-11 Thread grigri

 Hello :) i'am so sorry before if this post sounds insulting :)
 i just want to know, why most of questions here is rarely answered?

 People (including me) get sick of answering the same questions over
 and over again, often from people with little self-initiative. I think
 some people (especially php noobs) find it easier to post a question
 on google groups rather than spend the time poring over the manual,
 api, blogs, google groups, or cake source code.

...and then don't even ask a decent question. A lot of the unanswered
questions are like i tried to do {x} and it didn't work - fix it for
me [as you can see, not even a question!]. People who don't put the
time in to phrasing a question properly haven't put the time into
researching the problem by themselves.

 Sometimes I begin writing a reply to a post, but halfway through I
 decide not to post it because it's obvious the person hasn't done any
 preliminary research or hasn't made the effort of asking their
 question in a way that is easy to answer.

Yeah, I do this too. I start off with all the best intentions, then
think halfway through I've answered this before... and stop.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



British pound sign in 1.2 form helper

2008-07-11 Thread Adrian

Hi,

I am developing a simple job search site in CakePHP 1.2 and I have a
problem with the text form helper. When editing a job I have a text
box to enter a salary e.g. £24,000-£30,000 a year so I have used the
form helper in my edit view like this:

[code]

?php echo $form-text('Job.salary', array('value' = $job['Job']
['salary']))?

[/code]

This gives me an empty text box if $job['Job']['salary'] contains a £
sign, if I enter anything without a £ sign it's fine. Does anyone know
a good way of correcting this? I tried using the clean function but it
doesn't strip £ signs out. Also I don't think this happened in 1.1.

Any help would be appreciated.

--~--~-~--~~~---~--~~
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: British pound sign in 1.2 form helper

2008-07-11 Thread dr. Hannibal Lecter

Did you try putting the pound sign as an entity? i.e. pound; ?

Adrian wrote:
 Hi,

 I am developing a simple job search site in CakePHP 1.2 and I have a
 problem with the text form helper. When editing a job I have a text
 box to enter a salary e.g. �24,000-�30,000 a year so I have used the
 form helper in my edit view like this:

 [code]

 ?php echo $form-text('Job.salary', array('value' = $job['Job']
 ['salary']))?

 [/code]

 This gives me an empty text box if $job['Job']['salary'] contains a �
 sign, if I enter anything without a � sign it's fine. Does anyone know
 a good way of correcting this? I tried using the clean function but it
 doesn't strip � signs out. Also I don't think this happened in 1.1.

 Any help would be appreciated.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Special flavor of the tree behaviour

2008-07-11 Thread hinge

Hi

I have a question...

I have tow models :

class Bankpost extends AppModel
{
var $name = 'Bankpost';
var $belongsTo = 'Category';
var $recursive = 0;


}

And

class Category extends AppModel {

var $name = 'Category';
var $actsAs = array('Tree');
var $hasMany = 'Bankpost';
}


The second one has a Tree behaviour.

My Bankpost model has a reference (foriegn key) to the Category model.
This reference always goes to the 3rd level of the Tree.
Is there a way to get the parent of the referenced category when I
return data from the bankpost model ?

1
|__2
 |__3 --- this is returned my the bankpost model but I also want
it to return the parent (2)


I have tried using the afterFind callback of the Bankpost model,
something like this:

function afterFind($results)
{
foreach ($results as $key =  $res):
$category_title = $this-Category-
getparentnode($res['Bankpost']['id'])
$res['Bankpost']['Parent_cat'] = 
$category_title['title']
$results[$key] = $res;

endforeach;
  }


But as far as I can see I cant acquire data from another model in a
model.

Any ideas ??

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: New to PHP - Want to Create Blog From Scratch

2008-07-11 Thread jamslug

I just finished an exercise as the one you proposed, I suggest you to
look this tutorial: http://book.cakephp.org/view/219/blog but once you
finish it for the first time, try to do it again, by yourself and
usign this: http://book.cakephp.org/view/113/code-generation-with-bake.
I have using PHP for years, and after a lot of efforts I found - first
in ATK an now - in Cake a really fast an good way for develop new
apps.

About the mixture between (X)HTML and PHP you can use an excellent
alternative called Smarty, you can find more info here:
http://bakery.cakephp.org/articles/view/the-cakephp-blog-tutorial-with-smarty

Good luck and welcome to the exciting world of PHP evolved (Cake)

;-)

On Jul 10, 1:22 pm, ToxicInflux [EMAIL PROTECTED] wrote:
 Hello everyone.  I am new to the CakePHP discussion group, and also to
 PHP.  I want to start my own blog, but I dont want to use a system
 such as WordPress.  I feel this is a good way to introduce myself to
 PHP, CMS, etc.

 I've been reading various sites, and from what I see most have me
 including snippets of PHP code throughout my XHTML ... this seems kind
 of dirty to me.  Can anyone recommend a good blog tutorial, or any
 resources where I could learn?

 One site I've found somewhat useful 
 ishttp://www.imneebu.com/2007/11/08/building-a-weblog-with-php-mysql-pa...,
 though it still has you mixing PHP in with all of your HTML content.
 Does this seem like a decent tutorial for learning the mechanics of a
 blog and how to create one in PHP?

 Thanks in advance for the help
 ToxicInflux

--~--~-~--~~~---~--~~
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: British pound sign in 1.2 form helper

2008-07-11 Thread Adrian

Hey, thanks for the reply
I tried this but it is rendered as  pound;  when used as a form
element value.

On Jul 11, 11:23 am, dr. Hannibal Lecter [EMAIL PROTECTED]
wrote:
 Did you try putting the pound sign as an entity? i.e. pound; ?

 Adrian wrote:
  Hi,

  I am developing a simple job search site in CakePHP 1.2 and I have a
  problem with the text form helper. When editing a job I have a text
  box to enter a salary e.g. �24,000-�30,000 a year so I have used the
  form helper in my edit view like this:

  [code]

  ?php echo $form-text('Job.salary', array('value' = $job['Job']
  ['salary']))?

  [/code]

  This gives me an empty text box if $job['Job']['salary'] contains a �
  sign, if I enter anything without a � sign it's fine. Does anyone know
  a good way of correcting this? I tried using the clean function but it
  doesn't strip � signs out. Also I don't think this happened in 1.1.

  Any help would be appreciated.
--~--~-~--~~~---~--~~
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: British pound sign in 1.2 form helper

2008-07-11 Thread Adrian

For now I have settled with:

[code]

input name=data[Job][salary] type=text value=?php echo
$job['Job']['salary']? id=JobSalary /

[/code]

This works but if validation fails the elements value is not filled
in.

:S

On Jul 11, 12:16 pm, Adrian [EMAIL PROTECTED] wrote:
 Hey, thanks for the reply
 I tried this but it is rendered as  pound;  when used as a form
 element value.

 On Jul 11, 11:23 am, dr. Hannibal Lecter [EMAIL PROTECTED]
 wrote:

  Did you try putting the pound sign as an entity? i.e. pound; ?

  Adrian wrote:
   Hi,

   I am developing a simple job search site in CakePHP 1.2 and I have a
   problem with the text form helper. When editing a job I have a text
   box to enter a salary e.g. �24,000-�30,000 a year so I have used the
   form helper in my edit view like this:

   [code]

   ?php echo $form-text('Job.salary', array('value' = $job['Job']
   ['salary']))?

   [/code]

   This gives me an empty text box if $job['Job']['salary'] contains a �
   sign, if I enter anything without a � sign it's fine. Does anyone know
   a good way of correcting this? I tried using the clean function but it
   doesn't strip � signs out. Also I don't think this happened in 1.1.

   Any help would be appreciated.
--~--~-~--~~~---~--~~
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: Special flavor of the tree behaviour

2008-07-11 Thread AD7six



On Jul 11, 12:26 pm, hinge [EMAIL PROTECTED] wrote:
 Hi

 I have a question...

 I have tow models :

 class Bankpost extends AppModel
 {
         var $name = 'Bankpost';
         var $belongsTo = 'Category';
         var $recursive = 0;

 }

class Bankpost extends AppModel {
 var $name = 'Bankpost';
 var $belongsTo = array(
  'Category',
  'ParentCat' = array(
   'className' = 'Category',
   'foreignKey' = false,
   'conditions' = array('ParentCat.id =
Category.parent_id')
  ),
 );
 var $recursive = 0;
}

Try that or something v. similar
--~--~-~--~~~---~--~~
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: British pound sign in 1.2 form helper

2008-07-11 Thread Sam Sherlock
what about the number helper currency?

http://book.cakephp.org/view/215/number

the following
e($number-currency('12887.57','GBP'));

outputs the following (with ncr)

#163;12,887.57



2008/7/11 Adrian [EMAIL PROTECTED]:


 For now I have settled with:

 [code]

 input name=data[Job][salary] type=text value=?php echo
 $job['Job']['salary']? id=JobSalary /

 [/code]

 This works but if validation fails the elements value is not filled
 in.

 :S

 On Jul 11, 12:16 pm, Adrian [EMAIL PROTECTED] wrote:
  Hey, thanks for the reply
  I tried this but it is rendered as  pound;  when used as a form
  element value.
 
  On Jul 11, 11:23 am, dr. Hannibal Lecter [EMAIL PROTECTED]
  wrote:
 
   Did you try putting the pound sign as an entity? i.e. pound; ?
 
   Adrian wrote:
Hi,
 
I am developing a simple job search site in CakePHP 1.2 and I have a
problem with the text form helper. When editing a job I have a text
box to enter a salary e.g. �24,000-�30,000 a year so I have used
 the
form helper in my edit view like this:
 
[code]
 
?php echo $form-text('Job.salary', array('value' = $job['Job']
['salary']))?
 
[/code]
 
This gives me an empty text box if $job['Job']['salary'] contains a �
sign, if I enter anything without a � sign it's fine. Does anyone
 know
a good way of correcting this? I tried using the clean function but
 it
doesn't strip � signs out. Also I don't think this happened in 1.1.
 
Any help would be appreciated.
 


--~--~-~--~~~---~--~~
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: British pound sign in 1.2 form helper

2008-07-11 Thread Adrian

Hi

It's a nice idea, but I would like to keep the text field as free text
so anything can be entered e.g.
 Up to £10 an hour or £24k a year plus benifits
it's stored as a VARCHAR in the database, I have tried putting pound
signs in other text and textarea fields and the same thing happens,
the value is accepted and is placed in the database, when viewing a
job it all looks how it should, it's just the form helper doesn't seem
to like outputting pound signs.

On Jul 11, 12:28 pm, Sam Sherlock [EMAIL PROTECTED] wrote:
 what about the number helper currency?

 http://book.cakephp.org/view/215/number

 the following
 e($number-currency('12887.57','GBP'));

 outputs the following (with ncr)

 #163;12,887.57

 2008/7/11 Adrian [EMAIL PROTECTED]:



  For now I have settled with:

  [code]

  input name=data[Job][salary] type=text value=?php echo
  $job['Job']['salary']? id=JobSalary /

  [/code]

  This works but if validation fails the elements value is not filled
  in.

  :S

  On Jul 11, 12:16 pm, Adrian [EMAIL PROTECTED] wrote:
   Hey, thanks for the reply
   I tried this but it is rendered as  pound;  when used as a form
   element value.

   On Jul 11, 11:23 am, dr. Hannibal Lecter [EMAIL PROTECTED]
   wrote:

Did you try putting the pound sign as an entity? i.e. pound; ?

Adrian wrote:
 Hi,

 I am developing a simple job search site in CakePHP 1.2 and I have a
 problem with the text form helper. When editing a job I have a text
 box to enter a salary e.g. �24,000-�30,000 a year so I have used
  the
 form helper in my edit view like this:

 [code]

 ?php echo $form-text('Job.salary', array('value' = $job['Job']
 ['salary']))?

 [/code]

 This gives me an empty text box if $job['Job']['salary'] contains a �
 sign, if I enter anything without a � sign it's fine. Does anyone
  know
 a good way of correcting this? I tried using the clean function but
  it
 doesn't strip � signs out. Also I don't think this happened in 1.1.

 Any help would be appreciated.
--~--~-~--~~~---~--~~
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: the questions rarely answered. why?

2008-07-11 Thread Siebren Bakker
I think that at one point or another, we've all started answering a question
before realizing that it wasn't actually a question, but actually a demand.
For the most part, if anyone takes the time to first do some research, and
still can't find an answer, if they phrase it as a polite question, with as
much supporting information as they can think of, and are willing to give
even more information if asked about it, their answers will tend to be
answered, as generally, all of the people who read the google group and have
the information sought after, are willing to help out, if nothing than to
point people in the right direction. I know I've been helped a lot through
the group, and I've helped others with things they didn't know. It's a kind
of mutual give-and-take here.


In the name of Life, Liberty, and the pursuit of my sanity.
Siebren Bakker(Aevum Decessus)

On Fri, Jul 11, 2008 at 04:53, grigri [EMAIL PROTECTED] wrote:


  Hello :) i'am so sorry before if this post sounds insulting :)
  i just want to know, why most of questions here is rarely answered?

  People (including me) get sick of answering the same questions over
  and over again, often from people with little self-initiative. I think
  some people (especially php noobs) find it easier to post a question
  on google groups rather than spend the time poring over the manual,
  api, blogs, google groups, or cake source code.

 ...and then don't even ask a decent question. A lot of the unanswered
 questions are like i tried to do {x} and it didn't work - fix it for
 me [as you can see, not even a question!]. People who don't put the
 time in to phrasing a question properly haven't put the time into
 researching the problem by themselves.

  Sometimes I begin writing a reply to a post, but halfway through I
  decide not to post it because it's obvious the person hasn't done any
  preliminary research or hasn't made the effort of asking their
  question in a way that is easy to answer.

 Yeah, I do this too. I start off with all the best intentions, then
 think halfway through I've answered this before... and stop.
 


--~--~-~--~~~---~--~~
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: British pound sign in 1.2 form helper

2008-07-11 Thread Marc MENDEZ
Hi,

Just an idea : it seems that it does not work when it's display (since 
you say you can store it in the database)

Check if you have the same trouble with any other non alaphabetic 
character (dollar, ...)
Check as well in the core.php, the value of App.encoding parameter.
Try to use ISO charset instead of UTF-8



Adrian a écrit :
 Hi

 It's a nice idea, but I would like to keep the text field as free text
 so anything can be entered e.g.
  Up to £10 an hour or £24k a year plus benifits
 it's stored as a VARCHAR in the database, I have tried putting pound
 signs in other text and textarea fields and the same thing happens,
 the value is accepted and is placed in the database, when viewing a
 job it all looks how it should, it's just the form helper doesn't seem
 to like outputting pound signs.

 On Jul 11, 12:28 pm, Sam Sherlock [EMAIL PROTECTED] wrote:
   
 what about the number helper currency?

 http://book.cakephp.org/view/215/number

 the following
 e($number-currency('12887.57','GBP'));

 outputs the following (with ncr)

 #163;12,887.57

 2008/7/11 Adrian [EMAIL PROTECTED]:



 
 For now I have settled with:
   
 [code]
   
 input name=data[Job][salary] type=text value=?php echo
 $job['Job']['salary']? id=JobSalary /
   
 [/code]
   
 This works but if validation fails the elements value is not filled
 in.
   
 :S
   
 On Jul 11, 12:16 pm, Adrian [EMAIL PROTECTED] wrote:
   
 Hey, thanks for the reply
 I tried this but it is rendered as  pound;  when used as a form
 element value.
 
 On Jul 11, 11:23 am, dr. Hannibal Lecter [EMAIL PROTECTED]
 wrote:
 
 Did you try putting the pound sign as an entity? i.e. pound; ?
   
 Adrian wrote:
   
 Hi,
 
 I am developing a simple job search site in CakePHP 1.2 and I have a
 problem with the text form helper. When editing a job I have a text
 box to enter a salary e.g. �24,000-�30,000 a year so I have used
 
 the
   
 form helper in my edit view like this:
 
 [code]
 
 ?php echo $form-text('Job.salary', array('value' = $job['Job']
 ['salary']))?
 
 [/code]
 
 This gives me an empty text box if $job['Job']['salary'] contains a �
 sign, if I enter anything without a � sign it's fine. Does anyone
 
 know
   
 a good way of correcting this? I tried using the clean function but
 
 it
   
 doesn't strip � signs out. Also I don't think this happened in 1.1.
 
 Any help would be appreciated.
 
 

   


--~--~-~--~~~---~--~~
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: British pound sign in 1.2 form helper

2008-07-11 Thread Adrian

Hi Marc,

Changing encoding to ISO worked perfectly

Thanks a bunch :D

On Jul 11, 1:23 pm, Marc MENDEZ [EMAIL PROTECTED] wrote:
 Hi,

 Just an idea : it seems that it does not work when it's display (since
 you say you can store it in the database)

 Check if you have the same trouble with any other non alaphabetic
 character (dollar, ...)
 Check as well in the core.php, the value of App.encoding parameter.
 Try to use ISO charset instead of UTF-8

 Adrian a écrit :

  Hi

  It's a nice idea, but I would like to keep the text field as free text
  so anything can be entered e.g.
   Up to £10 an hour or £24k a year plus benifits
  it's stored as a VARCHAR in the database, I have tried putting pound
  signs in other text and textarea fields and the same thing happens,
  the value is accepted and is placed in the database, when viewing a
  job it all looks how it should, it's just the form helper doesn't seem
  to like outputting pound signs.

  On Jul 11, 12:28 pm, Sam Sherlock [EMAIL PROTECTED] wrote:

  what about the number helper currency?

 http://book.cakephp.org/view/215/number

  the following
  e($number-currency('12887.57','GBP'));

  outputs the following (with ncr)

  #163;12,887.57

  2008/7/11 Adrian [EMAIL PROTECTED]:

  For now I have settled with:

  [code]

  input name=data[Job][salary] type=text value=?php echo
  $job['Job']['salary']? id=JobSalary /

  [/code]

  This works but if validation fails the elements value is not filled
  in.

  :S

  On Jul 11, 12:16 pm, Adrian [EMAIL PROTECTED] wrote:

  Hey, thanks for the reply
  I tried this but it is rendered as  pound;  when used as a form
  element value.

  On Jul 11, 11:23 am, dr. Hannibal Lecter [EMAIL PROTECTED]
  wrote:

  Did you try putting the pound sign as an entity? i.e. pound; ?

  Adrian wrote:

  Hi,

  I am developing a simple job search site in CakePHP 1.2 and I have a
  problem with the text form helper. When editing a job I have a text
  box to enter a salary e.g. �24,000-�30,000 a year so I have used

  the

  form helper in my edit view like this:

  [code]

  ?php echo $form-text('Job.salary', array('value' = $job['Job']
  ['salary']))?

  [/code]

  This gives me an empty text box if $job['Job']['salary'] contains a �
  sign, if I enter anything without a � sign it's fine. Does anyone

  know

  a good way of correcting this? I tried using the clean function but

  it

  doesn't strip � signs out. Also I don't think this happened in 1.1.

  Any help would be appreciated.
--~--~-~--~~~---~--~~
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: British pound sign in 1.2 form helper

2008-07-11 Thread Marc MENDEZ
Adriatique a écrit :
 Hi Marc,

 Changing encoding to ISO worked perfectly

 Thanks a bunch :D
   
I have a thread on an other group about this, and we are dealing with 
how to create a file in utf-8 with an editor

--~--~-~--~~~---~--~~
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: MSSQL ntext problem

2008-07-11 Thread Nate

You don't need to change the source.  Just extend the driver and
override the correct method.

On Jul 10, 8:45 pm, bitkidoku [EMAIL PROTECTED] wrote:
 Thank you very much :-) I did a change in the source in a similar way.
 It is dirty but it works.

 On Jul 11, 12:32 am, James K [EMAIL PROTECTED] wrote:

  Oh, PS - I modified the hack so that it only runs when it recognizes
  an XML type from SQL 2005. If you change my
  $fieldDescription[$fields[$i]]['type'] == 'xml' to
  $fieldDescription[$fields[$i]]['type'] == 'text', it should work for
  ntext fields in general.

  - James

  On Jul 10, 12:34 pm, James K [EMAIL PROTECTED] wrote:

   The official word from the CakePHP team is that CakePHP does not
   support ntext fields. You're stuck using the text casting hack. I'm
   using MS SQL myself, and have had to use it, unfortunately.

   I'm using 1.2 RC2 and have successfully gotten that same hack to work
   - you have to change it a bit to work with the changes introduced in
   RC1. Here's my version of the fields function from RC2:

           function fields($model, $alias = null, $fields = array(), $quote 
   =
   true) {
                   if (empty($alias)) {
                           $alias = $model-alias;
                   }
                   $fields = parent::fields($model, $alias, $fields, false);
                   $count = count($fields);

                   $fieldDescription = $this-describe($model);

                   if ($count = 1  $fields[0] != '*'  strpos($fields[0],
   'COUNT(*)') === false) {
                           for ($i = 0; $i  $count; $i++) {
                                   $prepend = '';

                                   if (strpos($fields[$i], 'DISTINCT') !== 
   false) {
                                           $prepend = 'DISTINCT ';
                                           $fields[$i] = 
   trim(str_replace('DISTINCT', '', $fields[$i]));
                                   }
                                   $fieldAlias = 
   count($this-__fieldMappings);

                                   if (!preg_match('/\s+AS\s+/i', 
   $fields[$i])) {
                                           if (strpos($fields[$i], '.') === 
   false) {
                                                   
   $this-__fieldMappings[$alias . '__' . $fieldAlias] = $alias .
   '.' . $fields[$i];
                                                   if 
   ($fieldDescription[$fields[$i]]['type'] == 'xml') {
                                                           $fieldName = 
   CAST(CAST(.$this-name($alias . '.' .
   $fields[$i]). AS VARCHAR(8000)) AS TEXT);
                                                   } else {
                                                           $fieldName  = 
   $this-name($alias . '.' . $fields[$i]);
                                                   }
                                                   $fieldAlias = 
   $this-name($alias . '__' . $fieldAlias);
                                           } else {
                                                   $build = explode('.', 
   $fields[$i]);
                                                   
   $this-__fieldMappings[$build[0] . '__' . $fieldAlias] =
   $fields[$i];
                                                   $fieldName  = 
   $this-name($build[0] . '.' . $build[1]);
                                                   $fieldAlias = 
   $this-name(preg_replace(/^\[(.+)\]$/, $1,
   $build[0]) . '__' . $fieldAlias);
                                           }
                                           if 
   ($model-getColumnType($fields[$i]) == 'datetime') {
                                                   $fieldName = 
   CONVERT(VARCHAR(20), {$fieldName}, 20);
                                           }
                                           $fields[$i] =  {$fieldName} AS 
   {$fieldAlias};
                                   }
                                   $fields[$i] = $prepend . $fields[$i];
                           }
                   }
                   return $fields;
           }

   On Jul 10, 9:59 am, bitkidoku [EMAIL PROTECTED] wrote:

Hi everyone,

I have a problem using my existing MSSQL DB. I get the following
error:
SQL Error: Unicode data in a Unicode-only collation or ntext data
cannot be sent to clients using DB-Library (such as ISQL) or ODBC
version 3.7 or earlier. [CORE\cake\libs\model\datasources
\dbo_source.php, line 512]

I encountered this error before while writing my own PHP code. It can
be 'solved' casting ntext field to text. The closest solution for
CakePHP I found is this:https://trac.cakephp.org/ticket/4287

But since that applies to 1.2.0.6311 I couldn't make it work at the
moment.

Does anyone have any idea resolving this issue?
Thanks in advance :)

PS: Why do I insist on using MSSQL? Well, that is another story... I
am not very happy about that but I have to.

Re: Mod_Rewrite problem...

2008-07-11 Thread Hitsugaya

Hey there, im been working on this problem for some time now and i
solved it. It turns out mod_rewrite was working properly from the
verry start accept somehow it is was not property sending me to the
CakePHP mainpage on http://localhost/, i still get the directory
listing.

But when i dit http://localhost/something i get a new page saying
missing somethingcontroller. So i figured...euh...it...it..it´s
working!! Only problem is that i got the directory listing. After some
googling and searching the apache conf i fount the following:
DirectoryIndex. entered index.php there and now all is working. Still
don´t quite know why that change was needed but im not complaining
since its working. Now i can finally start brushing up my PHP skills
and doing some coding.

I just thought i post the solution to support other starting people. I
wanna thank everybody posting in this thread for helping out, hope is
can return the favor sometime. Cheers!

On 8 jul, 19:37, Hitsugaya [EMAIL PROTECTED] wrote:
 I've been trying, yet again, to get mod_rewrite to work. Now i've gome
 accros something that is to me (begin a apache AND mod_rewrite noob)
 quite strange:

 I have the following file:
 C:/Program Files/Apache Group/Apache2/htdocs/cakePHP/app/
 webroot/.htaccess with the following content:
 IfModule mod_rewrite.c
     RewriteEngine On
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
 /IfModule
 When i hithttp://localhost/i get a directory listing off: :/Program
 Files/Apache Group/Apache2/htdocs/cakePHP/app/webroot
 This i think means that mod_rewrite is not functioning correclty.

 BUT, now comes the crazy thing: when i change the file to:

 C:/Program Files/Apache Group/Apache2/htdocs/cakePHP/app/
 webroot/.htaccess with the following content:
 IfModule mod_rewrite.c
     RewriteEngine On
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteRule ^silly\.html$ /exists.html [L]
     RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
 /IfModule

 I've added a second rewrite rule wich is a dummy rule (it makes
 absolutely no sense :P) BUT when i now hithttp://localhost/i get my
 CakePHP mainpage!!!

 That indicates that mod_rewrite now is working. However, with this
 little hack all images and styles dissapear. I googled it and i think
 a .htaccess file can only have one rewrite rule.
 Then howcome that the .htaccess file finally does what i needs to do
 when i add a second rewrite rule? I think that something is wrong with
 that file but i don't know what.

 Help would be GREATLY appriciated!

 On 8 jul, 14:38, Hitsugaya [EMAIL PROTECTED] wrote:



  I think they are. Just to be sure...there are .htaccess files in:

  C:/Program Files/Apache Group/Apache2/htdocs/cakePHP (the root folder
  of cakePHP). Content:
  IfModule mod_rewrite.c
     RewriteEngine on
     RewriteRule    ^$ app/webroot/    [L]
     RewriteRule    (.*) app/webroot/$1 [L]
  /IfModule

  C:/Program Files/Apache Group/Apache2/htdocs/cakePHP/app. Content:
  IfModule mod_rewrite.c
      RewriteEngine on
      RewriteRule    ^$    webroot/    [L]
      RewriteRule    (.*) webroot/$1    [L]
   /IfModule

  C:/Program Files/Apache Group/Apache2/htdocs/cakePHP/app/webroot
  IfModule mod_rewrite.c
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
  /IfModule

  All are left untouched, and the content seemes allright...

  Tnx for the relpy´s so far guys, hope we can solve this issue!

  On 8 jul, 13:44, Jonathan Snook [EMAIL PROTECTED] wrote:

   Did the .htaccess files get copied properly?

Jonathan // Im sure that the directory is my local cakephp. But the
wierd thing is that withhttp://localhost/igeta directory listing
and the index.php file is in that directory. That should point to
mod_rewrite not being enabled but when i fire up phpinfo it states
that mod_rewrite is one of the loaded modules.- Tekst uit 
oorspronkelijk bericht niet weergeven -

   - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit oorspronkelijk 
   bericht niet weergeven -

  - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit oorspronkelijk 
  bericht niet weergeven -

 - Tekst uit oorspronkelijk bericht weergeven -
--~--~-~--~~~---~--~~
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: Cake 1.2 App::import(vendor) isn't finding the file

2008-07-11 Thread clrockwell

If you happen to come by a solution, please post it here.  I am having
the same issue. Using RC2, build 7296

On Jul 11, 4:47 am, RichardAtHome [EMAIL PROTECTED] wrote:
 Just tried:

 App::import(Vendor, PHPBB_Login, false, null, 'phpbb.php');

 And I'm still getting the same error:

 Fatal error: Class 'PHPBB_Login' not found in C:\htdocs\projects
 \archimbolo\app\controllers\users_controller.php on line 42

 On Jul 10, 9:15 pm, b logica [EMAIL PROTECTED] wrote:

  try

  App::import(Vendor, PHPBB_Login, false, null, 'phpbb.php');

  On Thu, Jul 10, 2008 at 1:21 PM, RichardAtHome [EMAIL PROTECTED] wrote:

   Hi all

   I have a vendor class I've put in \root\vendors\phpbb.php

   Which contains the class:

   class PHPBB_Login {
   }

   And am referencing it in my code with the following:

   App::import(Vendor, PHPBB_Login, array(file=phpbb.php));

   (which I think is right)

   But when I try an instance the class with:

   $phpBB = new PHPBB_Login();

   I get the following error:

   Fatal error: Class 'PHPBB_Login' not found in C:\htdocs\projects
   \archimbolo\app\controllers\users_controller.php on line 41

   CakePHP isn't finding the vendor file, it also doesn't find it if I
   put it in app\vendors either.

   Where do I put the file? Or, what does App::Import need to look like
   for it to be able to find the vendor file?

   Thanks in advance.
--~--~-~--~~~---~--~~
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: Cake 1.2 App::import(vendor) isn't finding the file

2008-07-11 Thread clrockwell

If forgot to mention that I am importing a different class,
lastrss.php

Code: App::import('Vendor','lastrss');


On Jul 11, 9:29 am, clrockwell [EMAIL PROTECTED] wrote:
 If you happen to come by a solution, please post it here.  I am having
 the same issue. Using RC2, build 7296

 On Jul 11, 4:47 am, RichardAtHome [EMAIL PROTECTED] wrote:

  Just tried:

  App::import(Vendor, PHPBB_Login, false, null, 'phpbb.php');

  And I'm still getting the same error:

  Fatal error: Class 'PHPBB_Login' not found in C:\htdocs\projects
  \archimbolo\app\controllers\users_controller.php on line 42

  On Jul 10, 9:15 pm, b logica [EMAIL PROTECTED] wrote:

   try

   App::import(Vendor, PHPBB_Login, false, null, 'phpbb.php');

   On Thu, Jul 10, 2008 at 1:21 PM, RichardAtHome [EMAIL PROTECTED] wrote:

Hi all

I have a vendor class I've put in \root\vendors\phpbb.php

Which contains the class:

class PHPBB_Login {
}

And am referencing it in my code with the following:

App::import(Vendor, PHPBB_Login, array(file=phpbb.php));

(which I think is right)

But when I try an instance the class with:

$phpBB = new PHPBB_Login();

I get the following error:

Fatal error: Class 'PHPBB_Login' not found in C:\htdocs\projects
\archimbolo\app\controllers\users_controller.php on line 41

CakePHP isn't finding the vendor file, it also doesn't find it if I
put it in app\vendors either.

Where do I put the file? Or, what does App::Import need to look like
for it to be able to find the vendor file?

Thanks in advance.
--~--~-~--~~~---~--~~
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: Mod_Rewrite problem...

2008-07-11 Thread Claudia

Just for explanation - I think the following happened:

Your original htaccess:

IfModule mod_rewrite.c
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
/IfModule

This means that
- if the requested file is not a directory (RewriteCond %
{REQUEST_FILENAME} !-d)
- and if the requested file is not a file (RewriteCond %
{REQUEST_FILENAME} !-f)
- then apply the rewrite rule to send everything to htaccess
(RewriteRule ^(.*)$ index.php?url=$1 [QSA,L])

Problem:
The url 'localhost' maps to a directory for apache, so the rewrite
rule was never applied.

Then you added a silly rewrite rule to your htaccess:
IfModule mod_rewrite.c
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^silly\.html$ /exists.html [L]
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
/IfModule

A rewrite condition always applies just to the first rewrite rule that
comes after the condition(s),
so now the conditions were only applied to the silly rewrite rule.
That again means that everything was now directed to the index.php,
also your pictures and css files.

Now you added index.php as DirectoryIndex. This means that whenever
you supply a directory
without a filename in the url, apache looks for the file index.php in
this directory. So if you now request
http://localhost, the rewrite rule still will not apply, but as apache
uses the index.php anyway,  this does not matter.

When you request any cake url like http://localhost/foo, the rewrite
condition evaluates to true
(as the directory foo is neither a directory nor a file) and thus the
rewrite rule is applied.


Hope it helps you understand what was actually going on.

Claudia


On Jul 11, 3:05 pm, Hitsugaya [EMAIL PROTECTED] wrote:
 Hey there, im been working on this problem for some time now and i
 solved it. It turns out mod_rewrite was working properly from the
 verry start accept somehow it is was not property sending me to the
 CakePHP mainpage onhttp://localhost/, i still get the directory
 listing.

 But when i dithttp://localhost/somethingi get a new page saying
 missing somethingcontroller. So i figured...euh...it...it..it´s
 working!! Only problem is that i got the directory listing. After some
 googling and searching the apache conf i fount the following:
 DirectoryIndex. entered index.php there and now all is working. Still
 don´t quite know why that change was needed but im not complaining
 since its working. Now i can finally start brushing up my PHP skills
 and doing some coding.

 I just thought i post the solution to support other starting people. I
 wanna thank everybody posting in this thread for helping out, hope is
 can return the favor sometime. Cheers!

 On 8 jul, 19:37, Hitsugaya [EMAIL PROTECTED] wrote:

  I've been trying, yet again, to get mod_rewrite to work. Now i've gome
  accros something that is to me (begin a apache AND mod_rewrite noob)
  quite strange:

  I have the following file:
  C:/Program Files/Apache Group/Apache2/htdocs/cakePHP/app/
  webroot/.htaccess with the following content:
  IfModule mod_rewrite.c
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
  /IfModule
  When i hithttp://localhost/iget a directory listing off: :/Program
  Files/Apache Group/Apache2/htdocs/cakePHP/app/webroot
  This i think means that mod_rewrite is not functioning correclty.

  BUT, now comes the crazy thing: when i change the file to:

  C:/Program Files/Apache Group/Apache2/htdocs/cakePHP/app/
  webroot/.htaccess with the following content:
  IfModule mod_rewrite.c
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^silly\.html$ /exists.html [L]
  RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
  /IfModule

  I've added a second rewrite rule wich is a dummy rule (it makes
  absolutely no sense :P) BUT when i now hithttp://localhost/iget my
  CakePHP mainpage!!!

  That indicates that mod_rewrite now is working. However, with this
  little hack all images and styles dissapear. I googled it and i think
  a .htaccess file can only have one rewrite rule.
  Then howcome that the .htaccess file finally does what i needs to do
  when i add a second rewrite rule? I think that something is wrong with
  that file but i don't know what.

  Help would be GREATLY appriciated!

  On 8 jul, 14:38, Hitsugaya [EMAIL PROTECTED] wrote:

   I think they are. Just to be sure...there are .htaccess files in:

   C:/Program Files/Apache Group/Apache2/htdocs/cakePHP (the root folder
   of cakePHP). Content:
   IfModule mod_rewrite.c
  RewriteEngine on
  RewriteRule^$ app/webroot/[L]
  RewriteRule(.*) app/webroot/$1 [L]
   /IfModule

   C:/Program Files/Apache Group/Apache2/htdocs/cakePHP/app. Content:
   IfModule 

Re: need some help in data saving using cake's own functions.

2008-07-11 Thread KiANIi

I've tried the solution you have suggested but its not working the
problem is not with saving of data but when I try to search data at
the start of each iteration data is not found in table so it returns
an empty array. is there any other solution to that problem

Samuel DeVore wrote:
 before each save use create

 $this-ModelName-create();
 $this-ModelName-save($data);

 see the section in the manual on saving data

 http://book.cakephp.org/view/75/saving-your-data

 sam d
 --
 (the old fart) the advice is free, the lack of crankiness will cost you

 - its a fine line between a real question and an idiot

 http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
 http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
 http://blog.samdevore.com/cakephp-pages/i-cant-bake/


 On Thu, Jul 3, 2008 at 10:38 AM, KiANIi [EMAIL PROTECTED] wrote:
 
  Hi,
  I'm trying to save data using $this-modelName-save(data) in a loop
  but after the end of each iteration when I'm trying to find the data
  that I've inserted I could not find that data.
 
  Can anyone tell me how i can save data in table in loop.
 
  the code is:
 
 $this-model = $this-controller-modelName;
 for ($i =0 ; $i4;$i++)
 {
 echo 'Iteration # '.$i;
 $this-model-save($distributedImp);
 $res = $this-model-findAll();
 print_r($res);
 }
 
 
  
 

--~--~-~--~~~---~--~~
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: Cake 1.2 App::import(vendor) isn't finding the file

2008-07-11 Thread clrockwell

Got it working.  First I tried deprecated way of vendor('lastrss') and
it worked fine.  So I tried App::import('vendor', 'lastrss') and it
also worked fine.  Did not think it would be case sensitive, but in my
case (and maybe yours) it is.

On Jul 11, 9:31 am, clrockwell [EMAIL PROTECTED] wrote:
 If forgot to mention that I am importing a different class,
 lastrss.php

 Code: App::import('Vendor','lastrss');

 On Jul 11, 9:29 am, clrockwell [EMAIL PROTECTED] wrote:

  If you happen to come by a solution, please post it here.  I am having
  the same issue. Using RC2, build 7296

  On Jul 11, 4:47 am, RichardAtHome [EMAIL PROTECTED] wrote:

   Just tried:

   App::import(Vendor, PHPBB_Login, false, null, 'phpbb.php');

   And I'm still getting the same error:

   Fatal error: Class 'PHPBB_Login' not found in C:\htdocs\projects
   \archimbolo\app\controllers\users_controller.php on line 42

   On Jul 10, 9:15 pm, b logica [EMAIL PROTECTED] wrote:

try

App::import(Vendor, PHPBB_Login, false, null, 'phpbb.php');

On Thu, Jul 10, 2008 at 1:21 PM, RichardAtHome [EMAIL PROTECTED] 
wrote:

 Hi all

 I have a vendor class I've put in \root\vendors\phpbb.php

 Which contains the class:

 class PHPBB_Login {
 }

 And am referencing it in my code with the following:

 App::import(Vendor, PHPBB_Login, array(file=phpbb.php));

 (which I think is right)

 But when I try an instance the class with:

 $phpBB = new PHPBB_Login();

 I get the following error:

 Fatal error: Class 'PHPBB_Login' not found in C:\htdocs\projects
 \archimbolo\app\controllers\users_controller.php on line 41

 CakePHP isn't finding the vendor file, it also doesn't find it if I
 put it in app\vendors either.

 Where do I put the file? Or, what does App::Import need to look like
 for it to be able to find the vendor file?

 Thanks in advance.
--~--~-~--~~~---~--~~
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: Translate behaviour documentation

2008-07-11 Thread bitkidoku

I have the same problem, I think it is missing. I am trying to solve
the mystery from the API reference, which is not very easy.

On Jul 9, 4:05 pm, boyracerr [EMAIL PROTECTED] wrote:
 I've been searching using whatever terms I can think of, and I can't
 find anything about the use of the Translate behaviour to create
 multilingual sites (ie, where dynamic content can be in different
 languages). Could anybody provide some links to information on this
 please?

 Thanks,
 Ben
--~--~-~--~~~---~--~~
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: MSSQL ntext problem

2008-07-11 Thread bitkidoku

Thanks, good idea indeed. I added that to my todo list.

On Jul 11, 3:38 pm, Nate [EMAIL PROTECTED] wrote:
 You don't need to change the source.  Just extend the driver and
 override the correct method.

 On Jul 10, 8:45 pm, bitkidoku [EMAIL PROTECTED] wrote:

  Thank you very much :-) I did a change in the source in a similar way.
  It is dirty but it works.

  On Jul 11, 12:32 am, James K [EMAIL PROTECTED] wrote:

   Oh, PS - I modified the hack so that it only runs when it recognizes
   an XML type from SQL 2005. If you change my
   $fieldDescription[$fields[$i]]['type'] == 'xml' to
   $fieldDescription[$fields[$i]]['type'] == 'text', it should work for
   ntext fields in general.

   - James

   On Jul 10, 12:34 pm, James K [EMAIL PROTECTED] wrote:

The official word from the CakePHP team is that CakePHP does not
support ntext fields. You're stuck using the text casting hack. I'm
using MS SQL myself, and have had to use it, unfortunately.

I'm using 1.2 RC2 and have successfully gotten that same hack to work
- you have to change it a bit to work with the changes introduced in
RC1. Here's my version of the fields function from RC2:

        function fields($model, $alias = null, $fields = array(), 
$quote =
true) {
                if (empty($alias)) {
                        $alias = $model-alias;
                }
                $fields = parent::fields($model, $alias, $fields, 
false);
                $count = count($fields);

                $fieldDescription = $this-describe($model);

                if ($count = 1  $fields[0] != '*'  
strpos($fields[0],
'COUNT(*)') === false) {
                        for ($i = 0; $i  $count; $i++) {
                                $prepend = '';

                                if (strpos($fields[$i], 'DISTINCT') !== 
false) {
                                        $prepend = 'DISTINCT ';
                                        $fields[$i] = 
trim(str_replace('DISTINCT', '', $fields[$i]));
                                }
                                $fieldAlias = 
count($this-__fieldMappings);

                                if (!preg_match('/\s+AS\s+/i', 
$fields[$i])) {
                                        if (strpos($fields[$i], '.') 
=== false) {
                                                
$this-__fieldMappings[$alias . '__' . $fieldAlias] = $alias .
'.' . $fields[$i];
                                                if 
($fieldDescription[$fields[$i]]['type'] == 'xml') {
                                                        $fieldName = 
CAST(CAST(.$this-name($alias . '.' .
$fields[$i]). AS VARCHAR(8000)) AS TEXT);
                                                } else {
                                                        $fieldName  = 
$this-name($alias . '.' . $fields[$i]);
                                                }
                                                $fieldAlias = 
$this-name($alias . '__' . $fieldAlias);
                                        } else {
                                                $build = explode('.', 
$fields[$i]);
                                                
$this-__fieldMappings[$build[0] . '__' . $fieldAlias] =
$fields[$i];
                                                $fieldName  = 
$this-name($build[0] . '.' . $build[1]);
                                                $fieldAlias = 
$this-name(preg_replace(/^\[(.+)\]$/, $1,
$build[0]) . '__' . $fieldAlias);
                                        }
                                        if 
($model-getColumnType($fields[$i]) == 'datetime') {
                                                $fieldName = 
CONVERT(VARCHAR(20), {$fieldName}, 20);
                                        }
                                        $fields[$i] =  {$fieldName} AS 
{$fieldAlias};
                                }
                                $fields[$i] = $prepend . $fields[$i];
                        }
                }
                return $fields;
        }

On Jul 10, 9:59 am, bitkidoku [EMAIL PROTECTED] wrote:

 Hi everyone,

 I have a problem using my existing MSSQL DB. I get the following
 error:
 SQL Error: Unicode data in a Unicode-only collation or ntext data
 cannot be sent to clients using DB-Library (such as ISQL) or ODBC
 version 3.7 or earlier. [CORE\cake\libs\model\datasources
 \dbo_source.php, line 512]

 I encountered this error before while writing my own PHP code. It can
 be 'solved' casting ntext field to text. The closest solution for
 CakePHP I found is this:https://trac.cakephp.org/ticket/4287

 But since that applies to 1.2.0.6311 I couldn't make it work at the
 moment.

 

Re: Cake 1.2 App::import(vendor) isn't finding the file

2008-07-11 Thread NOSLOW

I think the second paramter, PHPBB_Login, should be all lower case
just to get the file to load. Then when instantiating the class
PHPBB_Login, keep the case as it's defined inside the file.

Based on the examples here: http://book.cakephp.org/view/499/the-app-class,
it looks that as soon as you introduce capital letters into that
second parameter, it's expected a Cake well named file (i.e.
WellNamed expects well.named.php). I'd imagine in your case, it's
expecting a file named p.h.p.b.b_.login.php, Keeping it all lower
case should solve this.

But then again, if you read here: 
http://book.cakephp.org/view/411/migrating-from-cakephp-1-1-to-,
it suggests that the second parameter is just a unique identifier so
long as you supply the path and file name:

App::import('vendor', 'aUniqueIdentifier', array('file' ='path/
relative/to/vendor/file.php'));

which is the same as what is not working:

App::import(Vendor, PHPBB_Login, array(file=phpbb.php));

Have you tried using sub folders for each vendors (a good practice):

App::import(Vendor, PHPBB_Login, array(file=phpbb/
phpbb.php));

As far as that parameter being 'aUniqueIdentifier', I have found that
to be true - you cannot load 2 different files using the same
identifier:

App::import('vendor', 'aUniqueIdentifier', array('file' ='path/
relative/to/vendor/file_one.php')); // loads file_one.php
App::import('vendor', 'aUniqueIdentifier', array('file' ='path/
relative/to/vendor/file_two.php')); // does NOT load file_two.php
because Cake thinks it's already loaded based on it using the same
identifier of the previous call.

After checking out the unit tests in the Cake core, I found this
interesting way of loading multiple vendor files:
App::import('Vendor', array('simpletest'.DS.'unit_tester',
'simpletest'.DS.'mock_objects', 'simpletest'.DS.'web_tester'));

If anyone has some definitive answers on this stuff, let's try to get
the Cookbook updated.


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



Controller Tests and fixtures

2008-07-11 Thread neverlosty

Hi guys,

I can't seem to get fixtures working with Controller tests.
I tried the examples from the cakephp docs but it seemed to not be
working:

$result = $this-testAction('/controller/action', array('fixturize' =
'MyObject'));

Could anyone please show me an example of a controller test file which
has worked?

thanks heaps,
Tony.
--~--~-~--~~~---~--~~
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: need some help in data saving using cake's own functions.

2008-07-11 Thread simonb

 for ($i =0 ; $i4;$i++)
{
echo 'Iteration # '.$i;
$this-model-save($distributedImp);
$res = $this-model-findAll();
print_r($res);
}


for($i=0;$i  4 ; $i++) {
   $data = $this-Model-create();
   $this-Model-save($data);

}

On Jul 11, 2:44 pm, KiANIi [EMAIL PROTECTED] wrote:
 I've tried the solution you have suggested but its not working the
 problem is not with saving of data but when I try to search data at
 the start of each iteration data is not found in table so it returns
 an empty array. is there any other solution to that problem

 Samuel DeVore wrote:
  before each save use create

  $this-ModelName-create();
  $this-ModelName-save($data);

  see the section in the manual on saving data

 http://book.cakephp.org/view/75/saving-your-data

  sam d
  --
  (the old fart) the advice is free, the lack of crankiness will cost you

  - its a fine line between a real question and an idiot

 http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
 http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
 http://blog.samdevore.com/cakephp-pages/i-cant-bake/

  On Thu, Jul 3, 2008 at 10:38 AM, KiANIi [EMAIL PROTECTED] wrote:

   Hi,
   I'm trying to save data using $this-modelName-save(data) in a loop
   but after the end of each iteration when I'm trying to find the data
   that I've inserted I could not find that data.

   Can anyone tell me how i can save data in table in loop.

   the code is:

  $this-model = $this-controller-modelName;
  for ($i =0 ; $i4;$i++)
  {
  echo 'Iteration # '.$i;
  $this-model-save($distributedImp);
  $res = $this-model-findAll();
  print_r($res);
  }
--~--~-~--~~~---~--~~
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: need some help in data saving using cake's own functions.

2008-07-11 Thread simonb

you need to use $data = $this-ModelName-create();

this populates the model with the default data and created the
structure for the data.

For example if you have a table model with the following structure

id int
name varchar(100) defaul 'My Name'
age int(3) default 12


Then using $data = $this-Model-create();
would give
$data['Model']['name']= 'My Name';
$data['Model'][age'] = 12;


You could then set $data['Model']['age'] = 42;

then save the data

$this-Model-save($data);

this would then save to the database;;





On Jul 11, 2:44 pm, KiANIi [EMAIL PROTECTED] wrote:
 I've tried the solution you have suggested but its not working the
 problem is not with saving of data but when I try to search data at
 the start of each iteration data is not found in table so it returns
 an empty array. is there any other solution to that problem

 Samuel DeVore wrote:
  before each save use create

  $this-ModelName-create();
  $this-ModelName-save($data);

  see the section in the manual on saving data

 http://book.cakephp.org/view/75/saving-your-data

  sam d
  --
  (the old fart) the advice is free, the lack of crankiness will cost you

  - its a fine line between a real question and an idiot

 http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
 http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
 http://blog.samdevore.com/cakephp-pages/i-cant-bake/

  On Thu, Jul 3, 2008 at 10:38 AM, KiANIi [EMAIL PROTECTED] wrote:

   Hi,
   I'm trying to save data using $this-modelName-save(data) in a loop
   but after the end of each iteration when I'm trying to find the data
   that I've inserted I could not find that data.

   Can anyone tell me how i can save data in table in loop.

   the code is:

  $this-model = $this-controller-modelName;
  for ($i =0 ; $i4;$i++)
  {
  echo 'Iteration # '.$i;
  $this-model-save($distributedImp);
  $res = $this-model-findAll();
  print_r($res);
  }
--~--~-~--~~~---~--~~
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: Best way to include functionality in models

2008-07-11 Thread mbavio

Also, Mariano´s presentation in CakeFest in available for download in
the official website, it is about behaviors and is a really good one.

Cheers,
mbavio

On Jul 11, 5:42 am, AD7six [EMAIL PROTECTED] wrote:
 On Jul 11, 10:20 am, CrazyDave [EMAIL PROTECTED] wrote:

  @AD7Six, I'm still not clued up enough on behaviours to start creating
  my own.  It'd help if the cakephp book had some information on
  creating them and an examplehttp://book.cakephp.org/view/88/behaviors

 Why not look at exampleshttp://bakery.cakephp.org/categories/view/12

 Or look at the 'empty' behavior class that all behaviors 
 extendhttp://api.cakephp.org/class_model_behavior.html
--~--~-~--~~~---~--~~
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: the questions rarely answered. why?

2008-07-11 Thread mbavio

There is a reason why Google exists, and I really hate when users post
something that can be founded in 20 seconds of Google. Feels like you
are wasting my time and yours too.

Cheers,
mbavio

On Jul 11, 9:13 am, Siebren Bakker [EMAIL PROTECTED] wrote:
 I think that at one point or another, we've all started answering a question
 before realizing that it wasn't actually a question, but actually a demand.
 For the most part, if anyone takes the time to first do some research, and
 still can't find an answer, if they phrase it as a polite question, with as
 much supporting information as they can think of, and are willing to give
 even more information if asked about it, their answers will tend to be
 answered, as generally, all of the people who read the google group and have
 the information sought after, are willing to help out, if nothing than to
 point people in the right direction. I know I've been helped a lot through
 the group, and I've helped others with things they didn't know. It's a kind
 of mutual give-and-take here.

 In the name of Life, Liberty, and the pursuit of my sanity.
 Siebren Bakker(Aevum Decessus)

 On Fri, Jul 11, 2008 at 04:53, grigri [EMAIL PROTECTED] wrote:

   Hello :) i'am so sorry before if this post sounds insulting :)
   i just want to know, why most of questions here is rarely answered?

   People (including me) get sick of answering the same questions over
   and over again, often from people with little self-initiative. I think
   some people (especially php noobs) find it easier to post a question
   on google groups rather than spend the time poring over the manual,
   api, blogs, google groups, or cake source code.

  ...and then don't even ask a decent question. A lot of the unanswered
  questions are like i tried to do {x} and it didn't work - fix it for
  me [as you can see, not even a question!]. People who don't put the
  time in to phrasing a question properly haven't put the time into
  researching the problem by themselves.

   Sometimes I begin writing a reply to a post, but halfway through I
   decide not to post it because it's obvious the person hasn't done any
   preliminary research or hasn't made the effort of asking their
   question in a way that is easy to answer.

  Yeah, I do this too. I start off with all the best intentions, then
  think halfway through I've answered this before... and stop.
--~--~-~--~~~---~--~~
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: Basic help with render() function

2008-07-11 Thread mark_story

On Jul 10, 12:52 pm, Sir Tabs [EMAIL PROTECTED] wrote:
 Now I think I have the feel for the process: each action that is
 called attempts, through automagic, to render the screen with it's
 particular view file. If I use Ajax to call the particular action, and
 use the 'update' option and specify a DOM item, then the action will
 render it's view code inside of this DOM item.

 Is this best practice? Should I be worried that I'm essentially
 inserting one view inside of another?

I think it is a fine option.  Furthermore without javascript the form
will submit to that page, and a full page will be rendered.

As far as best practice when using cake, this is a perfectly suitable
solution.  You are still keeping the separation of Models, View and
Controllers.  Furthermore you are keeping each action separate, and
focused.  Seems like a good solution to me.

-Mark


--~--~-~--~~~---~--~~
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-link after ajax.updater

2008-07-11 Thread mark_story

This is a javascript problem and has nothing to do with cake.
Basically when your HTML response is injected into the page, the
script tags are not parsed and evaled.  There is an option to turn on
scriptEval or parseScripts for this somewhere in prototype.  I don't
know prototype well enough to say where though.

-Mark

On Jul 10, 12:54 pm, Ben [EMAIL PROTECTED] wrote:
 As expected by Pere it was a similar situation.

 The mainpage was reloaded by an AJAX.Updater. This one was the reason
 for the problem. After adding the option 'evalScripts : true'
 everything works fine.

 Thanks for all activated brain waves at all!
 Ben

 P.S.: If someone got this problem and don't understand all this here,
 feel free to contact 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: Cake 1.2 App::import(vendor) isn't finding the file

2008-07-11 Thread mark_story



On Jul 11, 11:07 am, NOSLOW [EMAIL PROTECTED] wrote:
 I think the second paramter, PHPBB_Login, should be all lower case
 just to get the file to load. Then when instantiating the class
 PHPBB_Login, keep the case as it's defined inside the file.

 Based on the examples here:http://book.cakephp.org/view/499/the-app-class,
 it looks that as soon as you introduce capital letters into that
 second parameter, it's expected a Cake well named file (i.e.
 WellNamed expects well.named.php). I'd imagine in your case, it's
 expecting a file named p.h.p.b.b_.login.php, Keeping it all lower
 case should solve this.

 But then again, if you read 
 here:http://book.cakephp.org/view/411/migrating-from-cakephp-1-1-to-,
 it suggests that the second parameter is just a unique identifier so
 long as you supply the path and file name:

 App::import('vendor', 'aUniqueIdentifier', array('file' ='path/
 relative/to/vendor/file.php'));

 which is the same as what is not working:

 App::import(Vendor, PHPBB_Login, array(file=phpbb.php));

 Have you tried using sub folders for each vendors (a good practice):

 App::import(Vendor, PHPBB_Login, array(file=phpbb/
 phpbb.php));

 As far as that parameter being 'aUniqueIdentifier', I have found that
 to be true - you cannot load 2 different files using the same
 identifier:

 App::import('vendor', 'aUniqueIdentifier', array('file' ='path/
 relative/to/vendor/file_one.php')); // loads file_one.php
 App::import('vendor', 'aUniqueIdentifier', array('file' ='path/
 relative/to/vendor/file_two.php')); // does NOT load file_two.php
 because Cake thinks it's already loaded based on it using the same
 identifier of the previous call.

 After checking out the unit tests in the Cake core, I found this
 interesting way of loading multiple vendor files:
 App::import('Vendor', array('simpletest'.DS.'unit_tester',
 'simpletest'.DS.'mock_objects', 'simpletest'.DS.'web_tester'));

 If anyone has some definitive answers on this stuff, let's try to get
 the Cookbook updated.

I recently updated the cookbook section related to App::import()
inclusive of Vendor loading most cases are covered now I think..

-Mark
--~--~-~--~~~---~--~~
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: the questions rarely answered. why?

2008-07-11 Thread francky06l

Yes guys you right ..  after a while you think sometimes if I answer
this, it will take ages and probably more following questions will
raise and I have also a full job, a girlfriend etc ...

At the very beginning, I was reading a lot the list mainly before
questionning, then I began to answer ..and there is a lot to learn in
answering..
That's the point, I was searching the answer for some peolple, a very
good learning way ..
Now, it's very rare that I am interested in a question, I still answer
though ... but a bit by sequence..

Polutan, you should try to answer to people, you will realize that you
learn so much that you do not have many questions...

cheers


On Jul 11, 7:50 pm, mbavio [EMAIL PROTECTED] wrote:
 There is a reason why Google exists, and I really hate when users post
 something that can be founded in 20 seconds of Google. Feels like you
 are wasting my time and yours too.

 Cheers,
 mbavio

 On Jul 11, 9:13 am, Siebren Bakker [EMAIL PROTECTED] wrote:

  I think that at one point or another, we've all started answering a question
  before realizing that it wasn't actually a question, but actually a demand.
  For the most part, if anyone takes the time to first do some research, and
  still can't find an answer, if they phrase it as a polite question, with as
  much supporting information as they can think of, and are willing to give
  even more information if asked about it, their answers will tend to be
  answered, as generally, all of the people who read the google group and have
  the information sought after, are willing to help out, if nothing than to
  point people in the right direction. I know I've been helped a lot through
  the group, and I've helped others with things they didn't know. It's a kind
  of mutual give-and-take here.

  In the name of Life, Liberty, and the pursuit of my sanity.
  Siebren Bakker(Aevum Decessus)

  On Fri, Jul 11, 2008 at 04:53, grigri [EMAIL PROTECTED] wrote:

Hello :) i'am so sorry before if this post sounds insulting :)
i just want to know, why most of questions here is rarely answered?

People (including me) get sick of answering the same questions over
and over again, often from people with little self-initiative. I think
some people (especially php noobs) find it easier to post a question
on google groups rather than spend the time poring over the manual,
api, blogs, google groups, or cake source code.

   ...and then don't even ask a decent question. A lot of the unanswered
   questions are like i tried to do {x} and it didn't work - fix it for
   me [as you can see, not even a question!]. People who don't put the
   time in to phrasing a question properly haven't put the time into
   researching the problem by themselves.

Sometimes I begin writing a reply to a post, but halfway through I
decide not to post it because it's obvious the person hasn't done any
preliminary research or hasn't made the effort of asking their
question in a way that is easy to answer.

   Yeah, I do this too. I start off with all the best intentions, then
   think halfway through I've answered this before... and stop.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



calling helper functions from within the controller

2008-07-11 Thread Siegfried Hirsch

Hello,

 the subject says it all:
is it possible to call a helper function from within the controller.
Of course the helper is
included in the var $helpers = array('Myhelper');

class MyController extends AppController {
   function index() {
$this-Myhelper-function_to_call(); // DOES NOT WORK - is it
possible in any way ?
   }
}

Siegfried

--~--~-~--~~~---~--~~
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: calling helper functions from within the controller

2008-07-11 Thread Chris Hartjes

On Fri, Jul 11, 2008 at 3:39 PM, Siegfried Hirsch
[EMAIL PROTECTED] wrote:

 Hello,

  the subject says it all:
 is it possible to call a helper function from within the controller.
 Of course the helper is
 included in the var $helpers = array('Myhelper');

Helpers are called within views, not controllers.

Perhaps you can place that function somewhere else?  Like in a model?

-- 
Chris Hartjes
Motto for 2008: Moving from herding elephants to handling snakes...
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: calling helper functions from within the controller

2008-07-11 Thread Siegfried Hirsch

Hello Chris,

yes I know. Maybe I need a hint for my problem.

I have written a new Helper. Now I want to set some variables, that
I can use from within the helper (yes I know I could handle this with
parameters), but I am trying to save some parameters, cause the
values are always the same.

Siegfried

On Fri, Jul 11, 2008 at 9:41 PM, Chris Hartjes [EMAIL PROTECTED] wrote:

 Helpers are called within views, not controllers.

 Perhaps you can place that function somewhere else?  Like in a model?

--~--~-~--~~~---~--~~
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: Good practice - Ajax action views?

2008-07-11 Thread francky06l

In case of ajax, a view can be considered as an element since there is
no layout in it..

Now, if you observe every single field on the form and make a server
call everytine, it might get slow. Why not submit the complete form,
validate all and render the form again (if error), you could also use
javascript validation .. ?

The basic of ajax is to update the Dom document using javascript. I
have tried once to make an application 100% ajax, and it's a mistake..
The dom somehow becomes heavier and slower .. So, a good complete HTML
refreshes and cleans everything.
If the ajax call updates the complete view except the layout, then
better using classic html.



On Jul 11, 1:59 am, Sir Tabs [EMAIL PROTECTED] wrote:
 I'm still getting used to cakePHP and the MVC, and I had a question
 about good practices when updating an element on a page with an Ajax
 action.

 Currently I have $ajax-observeField() watching the fields of my form,
 checking to see that the information the user types in is valid. The
 data is checked by a custom action in my controller: validateField().
 Since this is an action, it necessarily needs a view whenever the
 action is called. As it is, the view file, valid_field.ctp, contains
 code that will display the appropriate validation message after the
 action has run. This information in valid_field.ctp is then inserted
 (via the 'update' option) back into the original form that contains
 the form.

 This doesn't strike me as good practice, because it seems like I'm
 inserting one view inside of another.

 Should I use an element instead? Or, even more different, is it better
 to have the actual 'add' action somehow provide the Ajax validation
 and update the appropriate div? (Which would complicate things because
 then my add view, add.ctp would have to intelligently distinguish
 which error message to display inside of each error_message div).

 So, when you have an Ajax specific request, what's best practice? Do
 you make a call to an ajax specific function? And then that Ajax
 function has it's own view file?

 I think I'm missing something simple. I've browsed around the forums
 and documentation quite a bit, but there isn't really an example of
 best practices for Ajax and keeping consistent with MVC.

 Thanks for the help --
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



HTTP Authentication and Security Component Redirect

2008-07-11 Thread daphonz

Hey Folks,

I'm trying to use the Security component for a simple HTTP
authentication on a single item in my Cake App, and I'm having trouble
getting a proper error message to display upon incorrect login or when
I cancel the login.  At the moment, I just a blank page when I would
expected a standard Apache 401 Authorization error screen to appear.

I've traced through the code, and see that $this-redirect is being
trigged from Security::blackHole() as:

$controller-redirect(null, $code, true);

Where $code is set to 401.

Also, the session does not seem to reset between a failed login
attempt, so I don't get prompted for a login screen again until I
delete my authenticated sessions in my browser.

I'm using the code almost exactly as suggested in the Cake Book.  In
my app_controller.php :

function beforeFilter() {

   // othAuth login stuff that triggers on Cake.admin
   // if not admin then.
   $pass = Router::getParam('pass');
   $controller = Router::getParam('controller');

# See if there are any pages set to be protected in the
current controller #
$protectedPages = Configure::read('HTTPAuth.'.$controller);

if (!is_array($protectedPages)) {
$protectedPages = array();
}
if (isset($pass[0])  array_key_exists($pass[0],$protectedPages)) {

$this-Security-loginOptions = array(
'type'='basic',
'realm'=$controller.'/';
);

$password = Configure::read('HTTPAuth.generalLogin.password');
$user = Configure::read('HTTPAuth.generalLogin.username');
$this-Security-loginUsers[$user] = $password;

$this-Security-requireLogin();
}
}

I've doubled checked, and I am getting values for $username and
$password.  The prompt works, it's just the error I'm having trouble
making work correctly.

Thanks in advance for any and all help!

-Casey

--~--~-~--~~~---~--~~
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: calling helper functions from within the controller

2008-07-11 Thread francky06l

Maybe parameters that do not change often can be in a config
file  .. ? Then use Configure::read where ever you are ...
just a hint

On Jul 11, 9:56 pm, Siegfried Hirsch [EMAIL PROTECTED]
wrote:
 Hello Chris,

 yes I know. Maybe I need a hint for my problem.

 I have written a new Helper. Now I want to set some variables, that
 I can use from within the helper (yes I know I could handle this with
 parameters), but I am trying to save some parameters, cause the
 values are always the same.

 Siegfried

 On Fri, Jul 11, 2008 at 9:41 PM, Chris Hartjes [EMAIL PROTECTED] wrote:

  Helpers are called within views, not controllers.

  Perhaps you can place that function somewhere else?  Like in a model?
--~--~-~--~~~---~--~~
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: the questions rarely answered. why?

2008-07-11 Thread Wayne Fay

Polutan, are you looking at the same CakePHP email list archive that I
am looking at?? Gmail shows me the following # of responses for the
most recent ~30 email threads:
3, 0, 1, 6, 10, 4, 5, 9, 5, 0, 5, 1, 9, 8, 1, 2, 4, 6, 6, 0, 3, 5, 9,
2, 3, 0, 0, 2

I see a few with 0 responses, some with 2 or 3, and many with 5-10. So
it seems like most questions are answered contrary to your original
claim. Are you seeing something different that the rest of us?? Or are
you claiming that most of these responses do not actually answer the
question(s) that are posed?

Wayne

On 7/11/08, francky06l [EMAIL PROTECTED] wrote:

 Yes guys you right ..  after a while you think sometimes if I answer
 this, it will take ages and probably more following questions will
 raise and I have also a full job, a girlfriend etc ...

 At the very beginning, I was reading a lot the list mainly before
 questionning, then I began to answer ..and there is a lot to learn in
 answering..
 That's the point, I was searching the answer for some peolple, a very
 good learning way ..
 Now, it's very rare that I am interested in a question, I still answer
 though ... but a bit by sequence..

 Polutan, you should try to answer to people, you will realize that you
 learn so much that you do not have many questions...

 cheers


 On Jul 11, 7:50 pm, mbavio [EMAIL PROTECTED] wrote:
  There is a reason why Google exists, and I really hate when users post
  something that can be founded in 20 seconds of Google. Feels like you
  are wasting my time and yours too.
 
  Cheers,
  mbavio
 
  On Jul 11, 9:13 am, Siebren Bakker [EMAIL PROTECTED] wrote:
 
   I think that at one point or another, we've all started answering a 
   question
   before realizing that it wasn't actually a question, but actually a 
   demand.
   For the most part, if anyone takes the time to first do some research, and
   still can't find an answer, if they phrase it as a polite question, with 
   as
   much supporting information as they can think of, and are willing to give
   even more information if asked about it, their answers will tend to be
   answered, as generally, all of the people who read the google group and 
   have
   the information sought after, are willing to help out, if nothing than to
   point people in the right direction. I know I've been helped a lot through
   the group, and I've helped others with things they didn't know. It's a 
   kind
   of mutual give-and-take here.
 
   In the name of Life, Liberty, and the pursuit of my sanity.
   Siebren Bakker(Aevum Decessus)
 
   On Fri, Jul 11, 2008 at 04:53, grigri [EMAIL PROTECTED] wrote:
 
 Hello :) i'am so sorry before if this post sounds insulting :)
 i just want to know, why most of questions here is rarely answered?
 
 People (including me) get sick of answering the same questions over
 and over again, often from people with little self-initiative. I think
 some people (especially php noobs) find it easier to post a question
 on google groups rather than spend the time poring over the manual,
 api, blogs, google groups, or cake source code.
 
...and then don't even ask a decent question. A lot of the unanswered
questions are like i tried to do {x} and it didn't work - fix it for
me [as you can see, not even a question!]. People who don't put the
time in to phrasing a question properly haven't put the time into
researching the problem by themselves.
 
 Sometimes I begin writing a reply to a post, but halfway through I
 decide not to post it because it's obvious the person hasn't done any
 preliminary research or hasn't made the effort of asking their
 question in a way that is easy to answer.
 
Yeah, I do this too. I start off with all the best intentions, then
think halfway through I've answered this before... and stop.
 


--~--~-~--~~~---~--~~
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: the questions rarely answered. why?

2008-07-11 Thread aranworld

I agree with Wayne.  More often than not a question is answered on
this group.  I would go so far as to say that the high quality of the
community in this group is a selling point for CakePHP.  Most often, I
would say that a question doesn't get answered, because either:

1) it is about quite an obscure issue that most people maybe haven't
encountered

2) the subject line is poorly worded.  For example need help rather
than Emails sent by email component don't have line breaks

The more work you put into formatting your question, the more likely
it is you will get a response.

On Jul 11, 4:36 pm, Wayne Fay [EMAIL PROTECTED] wrote:
 Polutan, are you looking at the same CakePHP email list archive that I
 am looking at?? Gmail shows me the following # of responses for the
 most recent ~30 email threads:
 3, 0, 1, 6, 10, 4, 5, 9, 5, 0, 5, 1, 9, 8, 1, 2, 4, 6, 6, 0, 3, 5, 9,
 2, 3, 0, 0, 2

 I see a few with 0 responses, some with 2 or 3, and many with 5-10. So
 it seems like most questions are answered contrary to your original
 claim. Are you seeing something different that the rest of us?? Or are
 you claiming that most of these responses do not actually answer the
 question(s) that are posed?

 Wayne

 On 7/11/08, francky06l [EMAIL PROTECTED] wrote:



  Yes guys you right ..  after a while you think sometimes if I answer
  this, it will take ages and probably more following questions will
  raise and I have also a full job, a girlfriend etc ...

  At the very beginning, I was reading a lot the list mainly before
  questionning, then I began to answer ..and there is a lot to learn in
  answering..
  That's the point, I was searching the answer for some peolple, a very
  good learning way ..
  Now, it's very rare that I am interested in a question, I still answer
  though ... but a bit by sequence..

  Polutan, you should try to answer to people, you will realize that you
  learn so much that you do not have many questions...

  cheers

  On Jul 11, 7:50 pm, mbavio [EMAIL PROTECTED] wrote:
   There is a reason why Google exists, and I really hate when users post
   something that can be founded in 20 seconds of Google. Feels like you
   are wasting my time and yours too.

   Cheers,
   mbavio

   On Jul 11, 9:13 am, Siebren Bakker [EMAIL PROTECTED] wrote:

I think that at one point or another, we've all started answering a 
question
before realizing that it wasn't actually a question, but actually a 
demand.
For the most part, if anyone takes the time to first do some research, 
and
still can't find an answer, if they phrase it as a polite question, 
with as
much supporting information as they can think of, and are willing to 
give
even more information if asked about it, their answers will tend to be
answered, as generally, all of the people who read the google group and 
have
the information sought after, are willing to help out, if nothing than 
to
point people in the right direction. I know I've been helped a lot 
through
the group, and I've helped others with things they didn't know. It's a 
kind
of mutual give-and-take here.

In the name of Life, Liberty, and the pursuit of my sanity.
Siebren Bakker(Aevum Decessus)

On Fri, Jul 11, 2008 at 04:53, grigri [EMAIL PROTECTED] wrote:

  Hello :) i'am so sorry before if this post sounds insulting :)
  i just want to know, why most of questions here is rarely answered?

  People (including me) get sick of answering the same questions over
  and over again, often from people with little self-initiative. I 
  think
  some people (especially php noobs) find it easier to post a question
  on google groups rather than spend the time poring over the manual,
  api, blogs, google groups, or cake source code.

 ...and then don't even ask a decent question. A lot of the unanswered
 questions are like i tried to do {x} and it didn't work - fix it for
 me [as you can see, not even a question!]. People who don't put the
 time in to phrasing a question properly haven't put the time into
 researching the problem by themselves.

  Sometimes I begin writing a reply to a post, but halfway through I
  decide not to post it because it's obvious the person hasn't done 
  any
  preliminary research or hasn't made the effort of asking their
  question in a way that is easy to answer.

 Yeah, I do this too. I start off with all the best intentions, then
 think halfway through I've answered this before... and stop.
--~--~-~--~~~---~--~~
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: calling helper functions from within the controller

2008-07-11 Thread Daniel Hofstetter

Hi Siegfried,

  the subject says it all:
 is it possible to call a helper function from within the controller.
 Of course the helper is
 included in the var $helpers = array('Myhelper');

 class MyController extends AppController {
    function index() {
         $this-Myhelper-function_to_call(); // DOES NOT WORK - is it
 possible in any way ?
    }

 }

Just an idea:

function index() {
$myHelper = new MyHelper();
$myHelper-function_to_call();
$this-set('myHelper', $myHelper);
}

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



Setting the years

2008-07-11 Thread Vixy

Hi, In the HTML Helper, I found this code:
function yearOptionTag($tagName, $value = null, $minYear = null,
$maxYear = null, $selected = null, $selectAttr = null, $optionAttr =
null, $showEmpty = true) {
if (empty($selected)  ($this-tagValue($tagName))) {
$selected = date('Y', 
strtotime($this-tagValue($tagName)));
}

$yearValue = empty($selected) ? ($showEmpty ? NULL : date('Y')) 
:
$selected;
$currentYear = date('Y');
$maxYear = is_null($maxYear) ? $currentYear + 11 : $maxYear + 1;
$minYear = is_null($minYear) ? $currentYear - 60 : $minYear;

if ($minYear  $maxYear) {
$tmpYear = $minYear;
$minYear = $maxYear;
$maxYear = $tmpYear;
}

$minYear = $currentYear  $minYear ? $currentYear : $minYear;
$maxYear = $currentYear  $maxYear ? $currentYear : $maxYear;

for ($yearCounter = $minYear; $yearCounter  $maxYear; 
$yearCounter+
+) {
$years[$yearCounter] = $yearCounter;
}

return $this-selectTag($tagName . _year, $years, $yearValue,
$selectAttr, $optionAttr, $showEmpty);
}

This out puts a drop down box for my signup form. The years that show
up are from 1948 - 2018. This is a signup form and if someone is
signning up, how can they have thier birthday in 2018? So how can I
change it to this range: 1980-1994?
Thanks, Vix
--~--~-~--~~~---~--~~
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-textarea displaying actual html codes

2008-07-11 Thread Vixy

No one knows the answer to this? i really need help people.

On Jul 10, 4:14 pm, Vixy [EMAIL PROTECTED] wrote:
 Thanks, I'll go with the 3rd option. How can I disable it from
 CakePHP? What files do I need to edit?
 Thanks, Vix
 On Jul 10, 3:58 pm, Lance Willett [EMAIL PROTECTED] wrote:

   Thanks, my question is, how can i stop the script from out putting the
   html code when its inserted through the comments box?

  It appears that you are using a JavaScript comment form preview
  script, which unfortunately I can't help you with—and if it *is* a
  JavaScript issue it's probably not a topic for the CakePHP group here,
  anyway.

  Some things to think about are:
  1) What's the purpose of the script? Does it preview the comment, or
  is it simply to post the comment without refreshing the page?
  2) Have you tried processing the comment without JavaScript? It's
  highly recommended to get the form working as you intend first, then
  add scripting later to improve the usability. There are lots of ways
  to clean and filter input in PHP, and CakePHP has some nice built-in
  tools like Sanitize (http://api.cakephp.org/1.2/class_sanitize.html
  andhttp://book.cakephp.org/view/153/data-sanitization).
  3) If you don't want HTML to be allowed in the comment form, you can
  filter the input and give an error to the view that says something
  like HTML not allowed. With CakePHP you can do this type of
  validation without any JavaScript involved.

  Hope that helps you.

   here what Iam using:
   form action=?php echo $html-url('/THEURL/'.$uid); ? method=post
   div class=optional
   ?php echo $form-labelTag( 'THEURL', 'Comment' );?
   div style=margin-left:174px
              ?php echo $html-textarea( 'THEURL', array('class'= 
   'editor') );?
              script type=text/javascript
              $.editor.start({ path:'?php echo $html-url('/Theeditor'); 
   ?/', width: '600px',height: '400px' });
              $.editor.update();
              /script
   In Firefox 3 it doesn't display editor instead it shows a black box
   and in that black box, any one can add any type of code they want and
   it will output it. So my question is, how can i stop the black box
   from outputting the codes OR how can I make Firefox 3 display editor
   too?
   Thanks, Vix
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---