Re: Manipulating the right hand side of the conditions array in find/findAll queries

2007-02-21 Thread AD7six



On Feb 21, 8:54 am, ianh [EMAIL PROTECTED] wrote:
 Hi all,

 I'm working on an app to allow people to book courses online. I want
 users to be able to select courses by the day on which they are held.
 I have a start date (in datetime format) and have been trying to
 create a conditions array a bit like this:

 $conditions = aa('dayofweek(Course.start)', $var);

 The statement generated by Cake has this at the end: AND
 (`dayofweek(Course`.`start)` = '2')
 but unsurprisingly the DB returns 1054: Unknown column
 'dayofweek(Course.start)' in 'where clause'

 Does anybody know if the above possible using find/findAll or am I
 going to need to resort to a query?

 Thanks, Ian

Try
$conditions = aa('dayofweek(`Course`.`start`)', $var);
Note the backticks.

HTH,

AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Manipulating the right hand side of the conditions array in find/findAll queries

2007-02-21 Thread ianh

Worked a treat - thanks so much. Ian

On 21 Feb, 00:04, AD7six [EMAIL PROTECTED] wrote:
 On Feb 21, 8:54 am, ianh [EMAIL PROTECTED] wrote:



  Hi all,

  I'm working on an app to allow people to book courses online. I want
  users to be able to select courses by the day on which they are held.
  I have a start date (in datetime format) and have been trying to
  create a conditions array a bit like this:

  $conditions = aa('dayofweek(Course.start)', $var);

  The statement generated by Cake has this at the end: AND
  (`dayofweek(Course`.`start)` = '2')
  but unsurprisingly the DB returns 1054: Unknown column
  'dayofweek(Course.start)' in 'where clause'

  Does anybody know if the above possible using find/findAll or am I
  going to need to resort to a query?

  Thanks, Ian

 Try
 $conditions = aa('dayofweek(`Course`.`start`)', $var);
 Note the backticks.

 HTH,

 AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



invalidate for certain actions within beforevalidate()

2007-02-21 Thread MaxPower

Hello all,
I'm trying to set up validation to check for existing values within
the beforeValidate() function. What I'm aiming for is to do a check to
make sure the username  email isn't already taken when the user is
signing up. But when the user is editing their info I don't want an
error thrown if they don't change other details but not their username
and/or email. Here's what I have that works for adding users.

function beforeValidate() {
if ($this-findByUsername($this-data[$this-name]['username'])) {
$this-invalidate('username_unique');
}

if ($this-findByEmail($this-data[$this-name]['email'])) {
$this-invalidate('email_unique');
}

return true;
}


This works fine when adding a user but it also runs when the user is
editing their details and doesn't change the username or email. So I
thought maybe I could do different logic for each action like:

if ($this-params['action'] == 'add') {
   // do the above code
} else if ($this-params['action'] == 'edit') {
  // check to see if username/email in $this-data is the same as the
existing records for the given $id
}

But that doesn't work, it doesn't run the invalidation logic within
the if statement, and also generates a notice:

Notice: Undefined property: User::$action in /cakeapp/models/user.php
on line 49

Any input on what i could do differently?

Thanks,
Byron


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: invalidate for certain actions within beforevalidate()

2007-02-21 Thread Dr. Tarique Sani

On 2/21/07, MaxPower [EMAIL PROTECTED] wrote:
 if ($this-params['action'] == 'add') {
// do the above code
 } else if ($this-params['action'] == 'edit') {
   // check to see if username/email in $this-data is the same as the
 existing records for the given $id
 }

Try checking if the $this-data has id set - a missing id means INSERT
if id is present then CakePHP UPDATEs

HTH

Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: $helpers doesn't work for java script function in layouts files but it work on views index files.

2007-02-21 Thread mindcharger

Isn't there any way to purge the groups posts?
There would be cool to have some kind of moderation that eliminated
duplicate questions and posts in other languages than English...
I know that moderating is a time consuming task, but there are ways to
distribute the load (a moderator for every week day, etc...)

Thanks!



On Feb 20, 10:47 am, Dr. Tarique Sani [EMAIL PROTECTED] wrote:
 On 2/20/07, AD7six [EMAIL PROTECTED] wrote:

  Throw me a bone here :)!

 Woof!!

 Andy I think the earlier query was from the same person/team - it
 reads exactly the same

 Tarique

 --
 =
 PHP for E-Biz:http://sanisoft.com
 Cheesecake-Photoblog:http://cheesecake-photoblog.org
 =


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Include Js file in layouts

2007-02-21 Thread CraZyLeGs

The head helper isn't part of the  core.
it was written by rossoft and it's available in his blog

On Feb 20, 9:33 am, GreyCells [EMAIL PROTECTED] wrote:
 If you're using 1.2, then take a look here:

 http://cake.insertdesignhere.com/posts/view/17

 The HeadHelper functionality is implemented in the core.

 ~GreyCells

 On Feb 20, 8:07 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  I want to include javascript file in layout.It is possible? if it is,
  how to include javascript file.

  If i include like this

  app/views/layouts/index.thtml

  head
  titleUntitled-1/title
  meta http-equiv=Content-Type content=text/html;
  charset=iso-8859-1
  /head

  script src='../js/shal.js' language='javascript'/script

  it is not working.


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



Re: CakePHP and LiveGrid (Rico)

2007-02-21 Thread CraZyLeGs

http://en.wikipedia.org/wiki/Scaffolding

On Feb 20, 3:44 pm, anselm [EMAIL PROTECTED] wrote:
  Would be nice from the doc team should to clarify if scaffold is or not OK
  for production...

 That's not really up to them to tell you -- because this is a process
 problem, not a technical problem. If your scaffolded forms do what you
 need, then, technically, you can use them in your product.The problem
 with scaffolding is that as soon as you want to change any little
 thing, you end up having to re-write the whole form.

 I've been hurt before (not with Cake) :

 Write the app with some scaffolding. You're late (as usual), the
 deadline is looking at you with big menacing eyes, and the scaffolded
 forms do the job -- so you leave them in, ship the product with
 scaffolded forms, and forget about it. Half a year later the client
 asks you to change those forms a little bit - and there you're stuck,
 because you have to do the forms completely by hand.

 Now you can either explain to the client that you didn't do the job
 properly the first time round, and that her little insignificant
 changes will cost some money and you can't do them straight away ; or
 you do the work without telling the client anything, do those forms
 (that you should have done the first time round) with the added
 complication of having to fit this extra, unpaid work in your current
 schedule (which will invariably delay your current project, pushing
 you to cut corners again...)

 Shipping a product with scafolded forms is just asking for trouble
 later ! Scaffolding is good for prototyping but I'd advise against
 using it in your actual product, because it doesn't remove work, it
 delays it. And keeping extra work for the end of a project is a sure
 way to miss deadlines.

 Anselm


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



Re: CakePHP and LiveGrid (Rico)

2007-02-21 Thread jitka

http://www.cakepeople.com/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: invalidate help

2007-02-21 Thread Grzegorz Pawlik

where do You call this function? Is it in some of your controllers
method or callback?

On Feb 21, 2:44 am, josesquared [EMAIL PROTECTED] wrote:
 I am using the invalidate function in the controller and it is not
 triggering the tagErrorMsg.  I also tested and it doesn't seem to
 block the save either.  The validation works fine when I construct the
 validation array in the Model but I just want to know if I'm able to
 do it through the controller.  All the documentation I've read seem to
 say it's possible but I haven't found any luck

 Here's my code:

 In the controller:
$this-User-invalidate('email');

 In the view:
?php echo $html-input('User/email', array('size' = '35',
 'class'='formbox'))?
?php echo $html-tagErrorMsg('User/email', 'Email Address is
 required.') ?

 Any help would be appreciated.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



seaching various feilds

2007-02-21 Thread mike

 Hi,

I have implimented a search using the code below which works well, but
it only searches one field. What I'd like is a drop down box in the
view to select the feild to be searched (name, address, postcode,
etc). However i'm not sure how to reflect this in the controller code.
I wonder if someone could give me a hint?

Thanks,

Mike.

function search() {
if(empty($this-data)) {
$this-render();
} else {
$conditions =array();
$search_term = $this-data['Enquiry']['surname'];
$conditions['Enquiry']['surname'] = LIKE %{$search_term}
%;
$query = $this-Enquiry-findAll($conditions);
$this-set('data', $query);
$this-render('search');
}
}


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: View Caching of Home Page

2007-02-21 Thread PaulV



On Feb 21, 1:49 am, lloydhome [EMAIL PROTECTED] wrote:

 The easiest solution off the top of my head is to use mod_rewrite to
 force ^$  and ^/$  to go to your custom controller/action

 RewriteRule ^$   index.php?url=/mycontroller/myaction [QSA,L]
 RewriteRule ^/$  index.php?url=/mycontroller/myaction [QSA,L]

This doesn't seem to work. I guess the caching code uses the actual
url typed, and it doesn't matter if you rewrite it. since to the code,
it just appears as the original url??

   Paul


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Associations cross databases

2007-02-21 Thread safl

Grant Cox's reply solved my issue.

Having a db config setup with persistent = false is REQUIRED for it
to work (as nate states) but it is not sufficient.
Login/pass needs to be different (at least with MySQL DBMS) for each
dbconfig as Grant Cox states.

Then associations across databases works.

My issue is solved, i am very thankful!
This great journey of CakePHP continues, I'm loving it :)

On Feb 21, 5:01 am, nate [EMAIL PROTECTED] wrote:
 All you have to do is set the 'persistent' key to false in both
 connections, and the driver will set the $new_link parameter itself.

 On Feb 20, 6:53 pm, Grant Cox [EMAIL PROTECTED] wrote:

  It should just work - just make sure you have the appropriate
  connections in your app/config/database.php, and that each model has
  the appropriate $useDbConfig set.

  The only thing that can mess it up, is a bug, apparently in MySQL,
  where connections to multiple databases need to have different
  usernames and passwords. So, in your app/config/database.php, each
  connection needs to connect with a different username/password.

  I found out about this from someone on the IRC channel (probably
  PhpNut) some months ago, but I didn't keep a note of any urls for more
  information...


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



created and modified fields with SQL Server 2000

2007-02-21 Thread fire

Hi all!

In reply to an old thread that I found (couldn´t answer there, just
send it to the author?).
I think this could help others running CakePHP against SQL Server
2000:

I know that this thread is quite old, but I just had the same problem
on Windows Server 2003 and SQL Server 2000.

Create new and editing works fine, but the columns created and
modified in the database stay empty.
Couldn´t find any solution in the manual or the group.

After some trying I got it to work, the solution is to change the
datatype from datetime to varchar in the tables (only for SQL
Server 2000).

Hope this helps somebody..
Fire


On 9 Aug. 2006, 16:34, Santo Bartez [EMAIL PROTECTED] wrote:
 I've managed to installed CakePHP (1.1.7.3363) on Windows 2000, SQL
 Server 2000, and IIS (w/ISAPI_Rewrite). I've followed the tutorial
 located here grahambird.co.uk/cake/tutorials/scaffolding.php.

 I can list and insert and edit entries into the bookmarks with one
 exception. Thecreated/modifieddate fields never insert or update. The
 fields also display as editable fields when editing or inserting an
 entry. If I manually enter values into those fields through the
 scaffold insert/edit form, it updates the table properly.

 I'm confused on this behavior and a little lost. I've searched through
 trac.cakephp.org and wiki.cakephp.org and couldn't find anything that
 addressed this issue.

 Here's the table:
 CREATE TABLE [bookmarks] {
 [id] [int] IDENTITY (1,1) NOT NULL,
 [name] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
 [url] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
 [created] [datetime] NULL,
 [modified] [datetime] NULL,
 CONSTRAINT [PK_bookmarks_6E565CE8] PRIMARY KEY CLUSTERED
 {
 [id]
 } ON [PRIMARY]

 } ON [PRIMARY]



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Specifying plugin in a route?

2007-02-21 Thread joelmoss

I have a plugin setup in 1.2, yet it seems that routes don't seem to
recognise them.

Router::connect('/switchboard/blog/1', array('plugin' =
'switchboard', 'controller' = 'blog', 'action' = 'read'));

The above code tries to access the blog_controller within the app's
controllers and not within the plugin controllers.

Am I missing something here?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: launched a small cake site...weird problem

2007-02-21 Thread :uic

Hi...im having the same problem..and i found this is only happening
when the conten i try to load in $contentforlayout is smaller than the
content in the layout.. i have a sidebar in the layout and when i load
a content shorter than this sidebar, the problem appears..i duplicate
the content and it loads perfectly...dont know if it helps..im still
looking for the solution.

On 3 feb, 22:19, Walker Hamilton [EMAIL PROTECTED] wrote:
 I launched a small cake site but there's a really weird problem only
 in IE 6, when you click a link the page goes blank. you have to
 refresh the page to get anything.

 IE 6 only.

 see for yourself:http://bucketridergallery.com

 Does anyone have any ideas or suggestions?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Mail function

2007-02-21 Thread [EMAIL PROTECTED]


In my project after registration completed  i want to send a mail to
that user and admin.Give me an examples


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Mail function

2007-02-21 Thread AD7six



On Feb 21, 2:16 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 In my project after registration completed  i want to send a mail to
 that user and admin.Give me an examples

At the very least, you are missing the magic word.

http://www.google.com/search?q=cakephp+send+email


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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 does not work with find when I specify fields

2007-02-21 Thread AD7six



On Feb 20, 7:01 pm, codecowboy [EMAIL PROTECTED] wrote:
 Thank you.  Can you elaborate a little on that last paragraph?  Are
 you talking about adding code to the CollegeDepartment model?

Hi Codecowboy,

Although not mentioned in the manual you can define the fields for an
association (at least iirc you can).

You can see what I'm referring to here:
https://trac.cakephp.org/browser/branches/1.1.x.x/cake/libs/model/model_php4.php#L229

In principle you should be able to one of the following:

1) By defining it in the association directly
?php
class CollegeDepartmentextends AppModel
{
var $name = 'CollegeDepartment';
var $hasAndBelongsToMany = array('Organization' =
array(
  'fields'   = array('user_id','name')
)
  );
}
?

2) by binding a parameter (don't think this currently works)
$this-CollegeDepartment-
bindModel('Organization'=array('fields'=array('user_id','name));

3) By setting it explicitly on the model (a bit dirty)
$this-CollegeDepartment-hasAndBelongsToMany['Organization']
['fields'] = array('user_id','name);

Please reply with success/furthre problems so the thread is complete.

Cheers,

AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Rendering views of another ojbect with AJAX

2007-02-21 Thread jamieh

Hi again [EMAIL PROTECTED],

Eventually managed to get back onto this.  I am a little lost now as I
don't understand why i would need to use:

$uses = array(Users, Projects);

My biggest problem is the understanding of AJAX and how models work
together within AJAX operations!

Would the best approach be to have my Projects::Add inside my Users
controller like Users::AddProject for example?

If i have in Users::Add the following:

$this-render('projects/add/', 'ajax');

Cake populates the DIV with an error (and the layout again):

You are seeing this error because the view for
UsersController::projects/add/() could not be found.

So it is always expecting the render path to appended to the current
object; not another object!

Hmmm; ideally I would like to keep my objects and their methods
independent from each other and was hoping they could be used this way
with AJAX; but this doesn't seem to be the case.

So is it true that I cant render a view from another object inside the
view of the active object view?

I really wanted to make use of AJAX so that users didn't have to
reload entire pages whilst filling in separate forms belonging to
different objects/controllers.

Has anyone else achieved this?

Thanks,
Jamieh...


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: seaching various feilds

2007-02-21 Thread Mariano Iglesias

First set the options in the controller as to the available fields the
search can use (you can do so on your AppController::beforeRender() method
if the search form is displayed directly on the layout):

$fields = array (
'surname' = 'Surname',
'name' = 'Name'
);

$this-set('fields', $fields);

Then on the view inside the search form show the select box:

?php echo $html-selectTag('Enquiry/field', $fields, null, array(), null,
false); ?

Then modify the search() action accordingly (I've also removed things you
didn't want, such as: calling $this-render() and $this-render('search')
inside search() action is exactly the same, and it is not needed since
CakePHP will automatically render the view 'search' once action search() is
processed):

function search() {
if(!empty($this-data)) {
$conditions = array();
$search_term = $this-data['Enquiry']['surname'];
$search_field = $this-data['Enquiry']['field'];

$conditions['Enquiry'][$search_field] = LIKE
%{$search_term}
%;
$query = $this-Enquiry-findAll($conditions);

$this-set('data', $query);
}
}

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de mike
Enviado el: Miércoles, 21 de Febrero de 2007 07:11 a.m.
Para: Cake PHP
Asunto: seaching various feilds

I have implimented a search using the code below which works well, but
it only searches one field. What I'd like is a drop down box in the
view to select the feild to be searched (name, address, postcode,
etc). However i'm not sure how to reflect this in the controller code.
I wonder if someone could give me a hint?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Twisting a little bit afterSave() use...

2007-02-21 Thread mindcharger

Hello!

Many thanks to Mariano and Wood for your inputs.

You know, I'm having a little trouble making the

function afterSave()
{
if (!isset($this-data[$this-name]['id']) ||
empty($this-data[$this-name]['id']))
{
// We just created the record
}

} 

solution work. It always executes the code inside the if(), no matter
if you're creating the object or just editing it. It's weird...

Anyway, I'm going to try Wood solution by now and report back later
on.

Thanks again.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Bake fatal error

2007-02-21 Thread knuwe1

Hi,
I tried to use cake_1.2.0.4451alpha from nigthlybuild ... but
unfortunately I always get this Fatal error: Class 'Model'  not found
in ... bake.php line 437.
The name of the Model should be ok ... Sportler?

About the lines that Toby mentioned to uncomment: Which lines are
affected?

Thanks a lot for your support in this group!!!

Best regards,
Knut

On 11 Feb., 16:15, biesbjerg [EMAIL PROTECTED] wrote:
 Get the nightly build athttp://cakephp.org/downloads/index/nightly/
 1.2.x.x

 The bug has been fixed there.

 On Feb 11, 4:33 am, Jeffrey [EMAIL PROTECTED] wrote:



  What would cause thiserrorwhen trying to usebaketo create a new
 model?

 Fatalerror: Class 'Model' not found in /Users/jeffreystevison/Sites/
  cake/cake/scripts/bake.php on line 435- Zitierten Text ausblenden -

 - Zitierten Text anzeigen -


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: seaching various feilds

2007-02-21 Thread mike

That's great works a treat thanks. I thing..could you tell me the
advantage of putting it the AppController::beforeRender() method
rather than just in the controller.

Thanks again.

On Feb 21, 2:31 pm, Mariano Iglesias [EMAIL PROTECTED]
wrote:
 First set the options in the controller as to the available fields the
 search can use (you can do so on your AppController::beforeRender() method
 if the search form is displayed directly on the layout):

 $fields = array (
 'surname' = 'Surname',
 'name' = 'Name'
 );

 $this-set('fields', $fields);

 Then on the view inside the search form show the select box:

 ?php echo $html-selectTag('Enquiry/field', $fields, null, array(), null,
 false); ?

 Then modify the search() action accordingly (I've also removed things you
 didn't want, such as: calling $this-render() and $this-render('search')
 inside search() action is exactly the same, and it is not needed since
 CakePHP will automatically render the view 'search' once action search() is
 processed):

 function search() {
 if(!empty($this-data)) {
 $conditions = array();
 $search_term = $this-data['Enquiry']['surname'];
 $search_field = $this-data['Enquiry']['field'];

 $conditions['Enquiry'][$search_field] = LIKE
 %{$search_term}
 %;
 $query = $this-Enquiry-findAll($conditions);

 $this-set('data', $query);
 }

 }

 -MI

 ---

 Remember, smart coders answer ten questions for every question they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog:http://www.MarianoIglesias.com.ar

 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
 de mike
 Enviado el: Miércoles, 21 de Febrero de 2007 07:11 a.m.
 Para: Cake PHP
 Asunto: seaching various feilds

 I have implimented a search using the code below which works well, but
 it only searches one field. What I'd like is a drop down box in the
 view to select the feild to be searched (name, address, postcode,
 etc). However i'm not sure how to reflect this in the controller code.
 I wonder if someone could give me a hint?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: launched a small cake site...weird problem

2007-02-21 Thread [EMAIL PROTECTED]

Hey walker,
I tried your site in IE6.0, IE7.0 and FireFox2, all running on WinXP
SP2.

In each case everything worked fine. Must be a Mac/IE thing...

cook


On Feb 7, 12:29 pm, Walker Hamilton [EMAIL PROTECTED] wrote:
 Lance,

 Thank you thank you thank you.
 I was only able to use one system (that had IE6 available) to test it
 and it was not working properly on that system. It was a Mac running
 windows using BootCamp, though, so I was somewhat suspicious.

 Thanks for testing this out for me

 Walker

 On Feb 6, 4:17 pm, Lance Willett [EMAIL PROTECTED] wrote:

  On 2/3/07, Walker Hamilton [EMAIL PROTECTED] wrote:

   I launched a small cake site but there's a really weird problem only
   in IE 6, when you click a link the page goes blank. you have to
   refresh the page to get anything.

   IE 6 only.

   see for yourself:http://bucketridergallery.com

   Does anyone have any ideas or suggestions?

  Walker,
  I checked that site in both Firefox and IE6 and all the pages seemed
  to load fine the first time except 
  forhttp://bucketridergallery.com/shows/upcoming(butthat didn't work in
  Firefox either).

  (In case it helps I used IE6 on Windows XP SP1 and Firefox 1.5.0 on Mac OS 
  X).

  Have you been able to reproduce the problem on any other systems or
  browsers? Try IE7 also to see if it happens there.

  HTH,

  --
  Lance Willett
  simpledream web studiohttp://www.simpledream.net


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



hasMany/belongsTo

2007-02-21 Thread Kathrin

Hello,
ich have Problems to save data in a hasMany/belonsto
Users_ProfilesTable.
Sie Array is OK.
My source:

View User:
?php // echo $html-hidden('User/user_id', array('value' =
$post['User']['id']));?
post to  User/Controller save the data and post user_id to Profile/
controller
View/Profile
echo $form-hidden('User/user_id', array('value'= $userid));
Controller/Profile
function addprofile($userid=0) {
$this-set('userid',$userid);
if (!empty ($this-data)) {  #Formular wurde
abgeschickt-eingegebene Datenspeichern
$this-cleanUpFields();
$this-Profile-create();

$this-data['Profile']['user_id']=array($this-data['User']
['user_id']);
$this-Profile-save($this-data);
$this-data['User']['profile_id']=array($this-Profile-
getLastInsertId());
//error_log(print_r($this-data,true));
$this-Session-setFlash('The Profile-Data has been 
saved');
exit();
}
Have somebody an idea?
Sincerely Kathrin


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



CakePHP configuration on WAMP - directory path settings?

2007-02-21 Thread spheroid2007

I successfully set up Cake on my LAMP hosting to have multiple
applications on one hosting account (http://bakery.cakephp.org/
articles/view/141). Now, I'm not sure the settings on my WAMP (local
computer) for the directory of the application.

On my local system, I've set up cake in the following structure:

c:\wamp
   \cake
  \cake
  \vendors
   \apps\cakeApp1
   \www\cakeApp1

So the setup when working will allow me to view the cake app at
http://localhost/cakeApp1.

Question: when configuring c:\wamp\www\cakeApp1\index.php, what
settings would I change below:

if (!defined('ROOT')) {
 define('ROOT', DS.'apps'.DS.'cakeApp1');
}
if (!defined('APP_DIR')) {
 define('APP_DIR',dirname('cakeApp1'));
}
/**
 * This only needs to be changed if the cake installed libs are
located
 * outside of the distributed directory structure.
 */
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
  define('CAKE_CORE_INCLUDE_PATH', DS.'cake');
}

This doesn't work correctly. Thanks in advance!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Sorting on Related Field with Sub-Query - Is There A Better Way?

2007-02-21 Thread NOSLOW

I was able to sort my related data on field that was another level
deep in the relationship, but I'm not sure if it's the Cake way
since it required me to write a very specific SQL fragment
(subquery) . Let me try to explain with a simple example:

Let's say I have a dynamically generated questionnaire that contains
many questions, and I want to sort those questions based on a
display_order field. When an instance of a questionnaire gets
generated, an instance of each question is also generated. The
questions are all defined in a library of questions, if you will
(table name is questions), where the display_order field is
maintained.

So, to control the display order of my question instances within a
Questionnaire, the model definition for  Questionnaire has this
relationship defined with the 'order' parameter set with a specific
sub-query:
var $hasMany = array(
'QuestionInstance' =array('className' = 
'QuestionInstance',
'foreignKey' = 
'question_instance_id',
'conditions' = 
'',
'fields' = '',
'order' = 
'(Select Question.display_order FROM questions AS
Question WHERE QuestionInstance.question_id = Question.id) ASC',
'limit' = '',
'offset' = '',
'dependent' = 
'',
'exclusive' = 
'',
'finderQuery' 
= '',
'counterQuery' 
= ''),
);

Is there a better, or preferred way to accomplish the same sort
without explicitly writing a sub-query?  I thought that by putting
Question.display_order for the 'order' parameter would work, but it
did not.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Twisting a little bit afterSave() use...

2007-02-21 Thread mindcharger

Hello again!!

I think I've found a way to solve my problem...

I do the table creation before saving (using beforeSave() as opposed
to afterSaave())
and use the

$this-exists()

method to check wheter or not my Model instance already exists...

I think it's pretty straightforward...but I might be poisoned by
thinking about this some much time... :-)

Anyway, this is just for prototyping effects, for the app first
version...later on, me or some other team member will code a proper
solution...

I leave here the code stub, in case anyone else might have the same
problem in the future...

 function beforeSave()
 {
// Checking if the instance exists...
if (! $this-exists())
{
// Create the table
}

return true;
  }

Thanks again to everybody!

Cheers.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Bake fatal error

2007-02-21 Thread Steve W

I had the same problem using bake.php from 1.1.x.x/SVN.

I discovered that Model.php wasn't being included and I added the
following at line 131:

require_once (CORE_PATH.'cake'.DS.'libs'.DS.'model'.DS.'model.php');


On 21 Feb, 17:06, Michael Gartner [EMAIL PROTECTED] wrote:
 I have the latest nightly build and I also get this error when baking
 a model.

 My error reads:
 Fatal error: Class 'Model' not found in C:\Program Files\xampp\cake
 \cake\scripts\bake.php on line 437

 and when I try and bake a controller named Student:

 Fatal error: Class 'Student' not found in C:\Program Files\xampp\cake
 \cake\scripts\bake.php on line 1413

 The bake in 1.1.13.4450 works fine for me, but not in 1.2.0.4451alpha.

 I'm using xampp on XP Pro Sp2.

 On Feb 11, 10:15 am, biesbjerg [EMAIL PROTECTED] wrote:

  Get the nightly build athttp://cakephp.org/downloads/index/nightly/
  1.2.x.x

  The bug has been fixed there.

  On Feb 11, 4:33 am, Jeffrey [EMAIL PROTECTED] wrote:

   What would cause thiserrorwhen trying to usebaketo create a new
   model?

   Fatalerror: Class 'Model' not found in /Users/jeffreystevison/Sites/
   cake/cake/scripts/bake.php on line 435


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: invalidate help

2007-02-21 Thread josesquared

It is inside a method.

On Feb 21, 1:51 am, Grzegorz Pawlik [EMAIL PROTECTED]
wrote:
 where do You call this function? Is it in some of your controllers
 method or callback?

 On Feb 21, 2:44 am, josesquared [EMAIL PROTECTED] wrote:

  I am using theinvalidatefunction in the controller and it is not
  triggering the tagErrorMsg.  I also tested and it doesn't seem to
  block the save either.  The validation works fine when I construct the
  validation array in the Model but I just want to know if I'm able to
  do it through the controller.  All the documentation I've read seem to
  say it's possible but I haven't found any luck

  Here's my code:

  In the controller:
 $this-User-invalidate('email');

  In the view:
 ?php echo $html-input('User/email', array('size' = '35',
  'class'='formbox'))?
 ?php echo $html-tagErrorMsg('User/email', 'Email Address is
  required.') ?

  Anyhelpwould be appreciated.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



pagination issue in 1.2

2007-02-21 Thread isk

I have this code in the AgentsController
var $paginate = array('limit' = 2, 'page' = 1);
...
function index() {
..
$this-set('table', $this-paginate('Agent'));
..
}

and this in the view:

?= $paginator-prev(' Previous', null, null, array('class' = 'nav-
dis')) ?
|?= $paginator-next('Next ', null, null, array('class' = 'nav-
dis')) ?

on the first page I get next link as action/page:2 - what is correct,
but on second page prev link generates as action/page:1page:1 (page
parameter repeated)

No extra code related to paginator.
Any thought ?
Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: [C] Problem with custom validation

2007-02-21 Thread abba bryant


If you are using the validator class from CheeseCake or others ( I assume
here - not sure if it Tariq's or someone else's and he is simply using it. )
the correct method is to use

echo $validator-tagErrorMsg( 'Project/start_date' );

I am NOT sure if this is the codebase you are working with but it sounds
likely. Also, note the lack of message in the function call. In the
validator class I am familiar with ( see above ) the messages depend on the
error and are found through the validation array in the model.

Abba Bryant


vidya-6 wrote:
 
 
 Hai,
 
 I have one problem with custom validation. In my model class validater
 function is
 
 function validates()
 {
  // Validation code goes here
if($error)
   return false;
 
  }
 
 Validation worked for me, but i can't display the error message on the
 view using tagErrorMsg.
 ie;
 echo $html-tagErrorMsg('Project/start_date', 'please enter a valid
 date')  ;
 
 Can any one solve this problem?
 
 Thanks,
 Vidya.
 
 
  
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-custom-validation-tf3252461.html#a9086606
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Bake fatal error

2007-02-21 Thread Michael Gartner

I have the latest nightly build and I also get this error when baking
a model.

My error reads:
Fatal error: Class 'Model' not found in C:\Program Files\xampp\cake
\cake\scripts\bake.php on line 437

and when I try and bake a controller named Student:

Fatal error: Class 'Student' not found in C:\Program Files\xampp\cake
\cake\scripts\bake.php on line 1413

The bake in 1.1.13.4450 works fine for me, but not in 1.2.0.4451alpha.

I'm using xampp on XP Pro Sp2.


On Feb 11, 10:15 am, biesbjerg [EMAIL PROTECTED] wrote:
 Get the nightly build athttp://cakephp.org/downloads/index/nightly/
 1.2.x.x

 The bug has been fixed there.

 On Feb 11, 4:33 am, Jeffrey [EMAIL PROTECTED] wrote:

  What would cause thiserrorwhen trying to usebaketo create a new
  model?

  Fatalerror: Class 'Model' not found in /Users/jeffreystevison/Sites/
  cake/cake/scripts/bake.php on line 435


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



othAuth, what next

2007-02-21 Thread peter stranney

Hi there, I have implemented othAuth and all is working fine. When I
log in it attemps to go to admin/index. After writing an
admin_controller stub it now complains about 'No Database table for
model Admin (expected admins)' I am a newbie to cakPHP and I have
looked though the manual. Could someone point me in the right
direction, I wish to fully implement this login system and so what
more must I develop?

Thanks for your time.

Best wishes,

Peter


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: seaching various feilds

2007-02-21 Thread Mariano Iglesias

If the form was available throughout your site (like setting it in the
layout or through an element) then that variable was needed on
beforeRender(). But if you are only showing the form on the search view,
then there's no need for that.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de mike
Enviado el: Miércoles, 21 de Febrero de 2007 12:14 p.m.
Para: Cake PHP
Asunto: Re: seaching various feilds

That's great works a treat thanks. I thing..could you tell me the
advantage of putting it the AppController::beforeRender() method
rather than just in the controller.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: using models in elements

2007-02-21 Thread nate

Woodsman,

The helper grabs the metadata of the model behind-the-scenes.  This
does not involve access or manipulation of the model data itself, it
simply introspects static data about the model.  Subtle difference.

On Feb 21, 3:05 pm, the_woodsman [EMAIL PROTECTED] wrote:
 Ad7six,

 Thans for your input, but to be honest i'm still confused!

 To quote from that link you posted:

 In Cake 1.2, we're transitioning to an approach to form building that
 is more directly model-oriented, and according to the API, the first
 parameter to FormHelper::create() is actually supposed to be the name
 of a model, i.e.:
 ?=$form-create('Task', array('default' = false)); ?
 However, if you don't provide one, it is assumed to be the default
 model for the controller (in this case TasksController).

 If this doesn't look at the Model in any way, why would you need the
 name of the model?!? Surely there's nothing in $data to use ot guess
 what kind of form field to use...

 I'm sure once i switch to 1.2 It'll all become clear!

 Woody

 On Feb 21, 7:52 am, AD7six [EMAIL PROTECTED] wrote:

  On Feb 21, 2:02 am, the_woodsman [EMAIL PROTECTED] wrote:

   I'm confused about this issue.
   I had assumed having Models referenced directly in presentation
   related code was bad practice - but isn't that the Cake 1.2 way of
   doing form inputs?

  HiWoodsman,

  The methods which are used to generate form inputs have been modified
  in 1.2 but the MVC concepts certainly havent.

  See here for some examples, note the references to $data, and nothing
  at all do with instanciating and using a 
  model.http://cake.insertdesignhere.com/posts/view/15

  HTH,

  AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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 does not work with find when I specify fields

2007-02-21 Thread AD7six



On Feb 21, 7:44 pm, codecowboy [EMAIL PROTECTED] wrote:
  1) By defining it in the association directly
  ?php
  class CollegeDepartmentextends AppModel
  {
  var $name = 'CollegeDepartment';
  var $hasAndBelongsToMany = array('Organization' =
  array(
'fields'   = array('user_id','name')
  )
);}

  ?

   This one works as typed.  Thank you.

  2) by binding a parameter (don't think this currently works)
  $this-CollegeDepartment-bindModel('Organization'=array('fields'=array('user_id','name));

  This one does not work.  I had to change the code to:
 
 $this-CollegeDepartment-bindModel(array('hasAndBelongsToMany'=array('Organization'=array('fields'=array('user_id','name');

  That still does not work.  I do not understand why (1) works but not
 (2).  They should both be using the same functions within the model
 controller.  I tried to look
  into the cake core but I didn't really understand why it wasn't
 working.  Do you know if bindModel is fixed in cake 1.2?  It would be
 great if it were because
  otherwise you would need to create multiple habtm associations for
 the same two tables just to specify different field sets.  Let me know
 if you find out anything
  else on this topic.

Yeah I was a bit lazy writing out the array oops :).

An upgrade appears to be in order to make that work - This changeset
fixes the problem of all the keys being ignored:
https://trac.cakephp.org/changeset/4389/branches/1.1.x.x/cake/libs/model/model_php4.php

So it's fixed in both branches already. Thanks for replying.

Cheers,

AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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 does not work with find when I specify fields

2007-02-21 Thread codecowboy

 1) By defining it in the association directly
 ?php
 class CollegeDepartmentextends AppModel
 {
 var $name = 'CollegeDepartment';
 var $hasAndBelongsToMany = array('Organization' =
 array(
   'fields'   = array('user_id','name')
 )
   );}

 ?

  This one works as typed.  Thank you.

 2) by binding a parameter (don't think this currently works)
 $this-CollegeDepartment-bindModel('Organization'=array('fields'=array('user_id','name));

 This one does not work.  I had to change the code to:
$this-CollegeDepartment-
bindModel(array('hasAndBelongsToMany'=array('Organization'=array('fields'=array('user_id','name');
 That still does not work.  I do not understand why (1) works but not
(2).  They should both be using the same functions within the model
controller.  I tried to look
 into the cake core but I didn't really understand why it wasn't
working.  Do you know if bindModel is fixed in cake 1.2?  It would be
great if it were because
 otherwise you would need to create multiple habtm associations for
the same two tables just to specify different field sets.  Let me know
if you find out anything
 else on this topic.

 3) By setting it explicitly on the model (a bit dirty)
 $this-CollegeDepartment-hasAndBelongsToMany['Organization']['fields'] = 
 array('user_id','name);

 This one works (in case someone else tries to copypaste, 'name
should be 'name' ;-) )

Thank you,

Guy


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Old release downloads and subversion history...

2007-02-21 Thread TheIdeaMan

Ah. Thanks, Grant. I suppose I should have realized that I could use
the revision numbers from the back of the release numbers. I had been
looking for taged copies, but revision numbers should work just fine.

I'll give the upgrade another try. To date it hasn't been as easy as
hoped or promised, but there may be something I'm missing.

Thanks for your help, Grant,
TheIdeaMan

On 2/20/07, Grant Cox [EMAIL PROTECTED] wrote:

 You can check out every revision through Subversion, via
 https://svn.cakephp.org/repo/trunk/cake/1.1.x.x/

 You should find minimal changes migrating to 1.1.13 (the latest 1.1.x
 code).  Look through the old release announcements from PhpNut - he
 will mention in those anything that changed that would break previous
 code (like lazy model loading).  But up to 1.1.13, there won't be
 many.

 To 1.2, you will find many more things, as this is a major release.
 Plus, it is a major release that is not yet final, so there is not a
 lot of documentation around.  Depending on how urgent your migration
 is, perhaps you could wait until a final version is available.



 TheIdeaMan wrote:
  I have some CakePHP apps that were build on earlier versions of Cake
  (1.0.1.2708) and I'm wanting to migrate them up to the latest 1.2.
  Doing this has proved to be a headache thus far. Each release (even
  minor) changed enough things (syntax, api) to make moving from 1.0 to
  1.1 to 1.2 rather hard.
 
  Along those lines, I had hoped to find old copies of earlier releases
  and work my way up through them following what changed in the release
  notes for each, so I could avoid trying to tackle the entire history
  of changes in one upgrade.
 
  The CakePHP site, however, only has the most recent files and the
  subversion repo only has a few releases tagged.
 
  Is there a way I can get these old releases from the repo? or as a tar
  file? I think it would be helpful to keep these downloads around for
  these and other situations that may arise. It also makes the project
  look better: http://www.ohloh.net/projects/3176
 
  Thanks,
  TheIdeaMan


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Configure Object as global variable storage

2007-02-21 Thread jyrgen

hi there,

i've utilized the Configure class in cake to store some app wide
settings, which are accessed in views as well as controllers.

now i would like to avoid initialising them as follows:

$this-set('rechte_values',Configure::read('rechte_values'));
$this-set('texttyp_values',Configure::read('texttyp_values'));
$this-set('ressort_values',Configure::read('ressort_values'));
$this-
set('darstellung_values',Configure::read('darstellung_values'));
$this-set('honorar_values',Configure::read('honorar_values'));

... and so on

is the a way to load/read all variables that i have defined ?
like traversing ??

thanks a lot again !

jyrgen


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: using models in elements

2007-02-21 Thread AD7six



On Feb 21, 9:05 pm, the_woodsman [EMAIL PROTECTED] wrote:
 Ad7six,

 Thans for your input, but to be honest i'm still confused!

 To quote from that link you posted:

 In Cake 1.2, we're transitioning to an approach to form building that
 is more directly model-oriented, and according to the API, the first
 parameter to FormHelper::create() is actually supposed to be the name
 of a model, i.e.:
 ?=$form-create('Task', array('default' = false)); ?
 However, if you don't provide one, it is assumed to be the default
 model for the controller (in this case TasksController).

 If this doesn't look at the Model in any way, why would you need the
 name of the model?!? Surely there's nothing in $data to use ot guess
 what kind of form field to use...

 I'm sure once i switch to 1.2 It'll all become clear!

 Woody

Hi Woody

Try this:

put the following in any form view file (use the blog tutorial if
nothing else):
pr ($data);

look for the name of a model and the name of a field, especially after
submitting a form with something missing (i.e. using the blog tutorial
and tryihng to create an empty post)

Note that a model INSTANCE is nowhere visible or accessible the model
NAME is but that is just data.

HTH

AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Populate select field from a db?

2007-02-21 Thread MickeU

Hi there, my first post here, and also new to cakephp, so bear with
me.

In my app that i´m trying to build i´m using two separate tables for
populating two select fields in a register form. Is there a simple way
using form helpers to accomplish this?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: 1.2: Can I use new validation class in a component?

2007-02-21 Thread nate

For the most part, the methods of the Validation class can be accessed
statically, i.e. to validate a date, you can just do
Validation::date($date).  There's also an optional $format parameter
which defaults to 'ymd'.

On Feb 21, 2:09 pm, Cynthia [EMAIL PROTECTED] wrote:
 I'm writing a component which a bunch of controllers can use to always
 do the same job: take some dates or date range information and return
 some conditions.

 I thought it would be cute to have the component also check if those
 entered dates are in the right format and are valid. But for the life
 of me, I can't seem to get to the validation thing.

 I tried $uses, $helper, $component. Most of the time there is no
 error ... but then maybe I don't know the path to get to it?

 $this-MyComponent-Validation-validate ... or

 $this-MyComponent-OriginalController-Validation

 For the moment I'll just CP the date checking method ... but would be
 nice to learn how to do this the right way :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



pagination component / question / typo

2007-02-21 Thread jyrgen

i installed this pagination component:

http://bakery.cakephp.org/articles/view/65

which does a fine job, but i'm not getting further with query
constraints that i would like to maintain across pages.

i have selectbox with different time intervals constraining
the data amount being pulled from the db. for example i
would like to generate pagination html links like this :

articles/index?page=2interval=2months

the helper methods only generate links like this:

articles/index?page=2

-- how can i attach further parameters to this link ? --
param1=value1param2=value2


there was(is?) a typo in the helper class, line 326:

if ($this-_pageDetails['page']$this-_page['pageCount'])

should read

if ($this-_pageDetails['page']$this-_pageDetails['pageCount'])


thanks a ton
( and please don't point me to the new 1.2 version which comes
with a builtin pagination facility...)

jyrgen


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Looking for DB2, Cloudscape, Derby alpha testers

2007-02-21 Thread Daniel Krook

DB2, Cloudscape, Derby developers:

The first version of the DB2 driver built on the ibm_db2 extension
(db2_* functions) has been committed to the 1.2 branch:
https://trac.cakephp.org/changeset/4519
https://svn.cakephp.org/repo/branches/1.2.x.x/

Please try it out and submit your bug reports to Trac with DB2 in
the title. Information on the particular database product, platform
and version you are using would be helpful as well.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: pagination issue in 1.2

2007-02-21 Thread isk

thanks Preloader, I saw your trick in the groups - but it does not
work for me (I use
1.2.0.4451alpha), parameters stay repeated even I do unset($this-
params['pass']['page']) in the view before all paginator calls.

when I add  filtering parameters by array('url' = $this-
params['pass']) my links does not work at all - they repeat all
parameters twice (like page:1page:1.. and so on), so links become
twice longer :)

but when I do your trick in the view - it makes links working (though
they are ugly)

Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: othAuth, what next

2007-02-21 Thread Jon Bennett

 Hi there, I have implemented othAuth and all is working fine. When I
 log in it attemps to go to admin/index. After writing an
 admin_controller stub it now complains about 'No Database table for
 model Admin (expected admins)' I am a newbie to cakPHP and I have
 looked though the manual. Could someone point me in the right
 direction, I wish to fully implement this login system and so what
 more must I develop?

sounds like you need to enable 'admin' routing in /app/config/core.php

http://manual.cakephp.org/chapter/configuration

you could also change the location that you're redirecting to as that
sounds like the default that othAuth starts with (not sure how as I
don't use it).

hth

Jon

-- 


jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Populate select field from a db?

2007-02-21 Thread Cynthia

If those tables and your models are properly related you can do
something like this:

$one = $this-Whatever-Oneofyourtable-generateList();
$two = $this-Whatever-Othertable-generateList();
$this-set(compact('one', 'two'));

On Feb 21, 4:38 pm, MickeU [EMAIL PROTECTED] wrote:
 Hi there, my first post here, and also new to cakephp, so bear with
 me.

 In my app that i´m trying to build i´m using two separate tables for
 populating two select fields in a register form. Is there a simple way
 using form helpers to accomplish this?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: 1.2: Can I use new validation class in a component?

2007-02-21 Thread Cynthia

Hi Nate :-)

After just having learned about using the Inflector statically I hoped
that this would do the trick ... but when I call Validation from my
component this way I get:

Fatal error: Call to undefined function: __reset()

:(

On Feb 21, 3:43 pm, nate [EMAIL PROTECTED] wrote:
 For the most part, the methods of the Validation class can be accessed
 statically, i.e. to validate a date, you can just do
 Validation::date($date).  There's also an optional $format parameter
 which defaults to 'ymd'.

 On Feb 21, 2:09 pm, Cynthia [EMAIL PROTECTED] wrote:

  I'm writing a component which a bunch of controllers can use to always
  do the same job: take some dates or date range information and return
  some conditions.

  I thought it would be cute to have the component also check if those
  entered dates are in the right format and are valid. But for the life
  of me, I can't seem to get to the validation thing.

  I tried $uses, $helper, $component. Most of the time there is no
  error ... but then maybe I don't know the path to get to it?

  $this-MyComponent-Validation-validate ... or

  $this-MyComponent-OriginalController-Validation

  For the moment I'll just CP the date checking method ... but would be
  nice to learn how to do this the right way :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Installing a CakePHP application on an existing site

2007-02-21 Thread Wey

Hi, I'm actually trying to do exactly this.  I don't know .htaccess
that well, so I how would I configure it to serve up directories and
files if they exist?

TIA

On 15 Feb, 21:39, Dat Chu [EMAIL PROTECTED] wrote:
 In .htaccess, you can specify that if the URL is a correct file/
 directory path, then it will serve the page. Otherwise, it will
 rewrite to your index.php in cake webroot (to be handled by cake).

 That way, you cake files can stay on / as well.

 On Feb 15, 7:07 pm, the_woodsman [EMAIL PROTECTED] wrote:

  I've done something similar,
  and the only big issues are URLs (as Eric described, use of htaccess
  fiels and mod rewrite help here) and sharing the session between
  standard PHP and Cake.

  Wood

  On Feb 15, 11:18 pm, Eric C Blount [EMAIL PROTECTED] wrote:

   If you extract CakePHP to a directory called /store/ under your main
   website, then only the store directory will be Cake powered, which should 
   be
   what you want. Just make sure to get all of the .htaccess files in the 
   right
   places when you extract.

   HTH,
   Eric

   On 2/15/07, Mike [EMAIL PROTECTED] wrote:

Hi,

I think my first post was eaten, so here I am again.  If it wasn't,
please ignore this spam.

If I write an app with Cake called Store (for example), can I install
it onto an existing site likewww.mysite.com, which has other non-Cake
pages and sub directories so that I have:

   www.mysite.com/Store

While keeping the other non-Cake pages, etc?  It seems like I should
be able to based upon the text in the online manual under http://
manual.cakephp.org/chapter/installing Section 4 Advanced Setup...?

Or perhaps using a virtual host?

Basically, I just want to be sure I can use CakePHP without having to
have everything on the site be Cake-enabled.

Thanks.

--
Mike


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: pagination issue in 1.2

2007-02-21 Thread Cynthia

Try it with:

var $paginate = array( 'limit' = 2);

I don't set any page value and it works *great* for me :)

On Feb 21, 3:34 pm, isk [EMAIL PROTECTED] wrote:
 thanks Preloader, I saw your trick in the groups - but it does not
 work for me (I use
 1.2.0.4451alpha), parameters stay repeated even I do unset($this-

 params['pass']['page']) in the view before all paginator calls.

 when I add  filtering parameters by array('url' = $this-params['pass']) my 
 links does not work at all - they repeat all

 parameters twice (like page:1page:1.. and so on), so links become
 twice longer :)

 but when I do your trick in the view - it makes links working (though
 they are ugly)

 Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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 directories...

2007-02-21 Thread [EMAIL PROTECTED]

I'm new to cakephp and very confused about setting directories...
I want to create a development directory and place the app and cake
folders inside of it.   I created a database called contactos and a
table
called bookmarks..I created the bookmark.php inside dev/app/models/
and the bookmarks_controller.php inside dev/app/controllers I also did
the setup on the database.php file inside the configuration folder. I
placed the url to my database, my username and my pasword but when I
type this www.mysitename.com/dev  it doesn't do anything...when i go
to www.jhinestrosa.com/dev/bookmarks is says this:

No Database table for model User (expected users), create it first.

Can somebody help me please.its urgent

Thank you very much...


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Configure Object as global variable storage

2007-02-21 Thread Mariano Iglesias

Set the names of your config vars in the form of:

App.variable

So instead you would have:

$this-set('rechte_values',Configure::read('App.rechte_values'));
$this-set('texttyp_values',Configure::read('App.texttyp_values'));
$this-set('ressort_values',Configure::read('App.ressort_values'));
$this-
set('darstellung_values',Configure::read('App.darstellung_values'));
$this-set('honorar_values',Configure::read('App.honorar_values'));

And then do:

$result = Configure::read('App');

pr($result);

You'll see that you get an array with all variables starting with App.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de jyrgen
Enviado el: Miércoles, 21 de Febrero de 2007 07:29 p.m.
Para: Cake PHP
Asunto: Configure Object as global variable storage

is the a way to load/read all variables that i have defined ?
like traversing ??

thanks a lot again !


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



file upload

2007-02-21 Thread bingo

Hi,

I want to allow users to upload files on to the server...however, I
got all the code..but have some problem in providing a link to the
user..

my configuration is as follows

mysite
-- app
-- cake
-- file //in this folder I will keep all the uploaded files

however, if I create a link such as http://localhost/mysite/file/demo.pdf
cake takes over the control and display a page with error:
You are seeing this error because controller FilesController  could
not be found.

is there a way to avoid cakephp taking control over file the folder


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: setting directories...

2007-02-21 Thread Mariano Iglesias

If you do:

http://www.jhinestrosa.com/dev

you don't get anything, but if you do:

http://www.jhinestrosa.com/dev/

You do, there's an issue on your server.

Regarding the model error, that's because you may be setting User as a model
in your controller but don't have the table created yet. Can you post your
controller code for bookmarks_controller.php?

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de [EMAIL PROTECTED]
Enviado el: Miércoles, 21 de Febrero de 2007 08:33 p.m.
Para: Cake PHP
Asunto: setting directories...


I'm new to cakephp and very confused about setting directories...
I want to create a development directory and place the app and cake
folders inside of it. 


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



Re: Custom Validate

2007-02-21 Thread Seb

Hey,

You might want to give this article from the bakery a look;
http://bakery.cakephp.org/articles/view/55

I've been using it and extending it for months now and it works like a
charm!

Hope this helps!

Seb.

Grant Cox wrote:
 I haven't really looked at the new Validation options, but the
 traditional way is to do this in your model beforeValidate callback.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: pagination component / question / typo

2007-02-21 Thread Seb

Hey there,

For I have use that same pagination helper, I'm almost sure there is
no way to add more param/value pairs to the generated Url.
However I extended it to add a 'filterBy' and it ended up being fairly
simple (minimal coding).

I haven't had the time to have a good look at the new paginator from
1.2, so I can't say if it provides what you are looking for.
Anyone?

I don't mind sending you my code if you want to look into it, however
there is very little new stuff.. mostly duplicating+adating the
current SortBy stuff.

Hope this helps!

Seb.


jyrgen wrote:
 i installed this pagination component:

 http://bakery.cakephp.org/articles/view/65

 which does a fine job, but i'm not getting further with query
 constraints that i would like to maintain across pages.

 i have selectbox with different time intervals constraining
 the data amount being pulled from the db. for example i
 would like to generate pagination html links like this :

 articles/index?page=2interval=2months

 the helper methods only generate links like this:

 articles/index?page=2

 -- how can i attach further parameters to this link ? --
 param1=value1param2=value2


 there was(is?) a typo in the helper class, line 326:

 if ($this-_pageDetails['page']$this-_page['pageCount'])

 should read

 if ($this-_pageDetails['page']$this-_pageDetails['pageCount'])


 thanks a ton
 ( and please don't point me to the new 1.2 version which comes
 with a builtin pagination facility...)

 jyrgen


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: file upload

2007-02-21 Thread Mariano Iglesias

Put file inside your webroot folder instead. Still link it as
/file/demo.pdf, but file folder should be inside webroot. This is why: your
/.htaccess file reads:

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

This means that everything is sent as app/webroot. You could modify the
above htaccess to add handlers so only it does that for non existing
files/directories (NOT recommended), or just move files folder inside
webroot.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de bingo
Enviado el: Miércoles, 21 de Febrero de 2007 08:59 p.m.
Para: Cake PHP
Asunto: file upload

however, if I create a link such as http://localhost/mysite/file/demo.pdf
cake takes over the control and display a page with error:
You are seeing this error because controller FilesController  could
not be found.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: file upload

2007-02-21 Thread bingo

Hi

thanks to all your reply..I got file upload working..however there is
one problem..
Now anyone can see the directory structure and all the files..
I am not sure how to manipulate htaccess so users can only use the
link provided by the application and do not have access to other files

Regards,
Ritesh

On Feb 21, 8:16 pm, Jon Bennett [EMAIL PROTECTED] wrote:
  is there a way to avoid cakephp taking control over file the folder

 why not follow Cake's conventions and save the files in:

 mysite/app/webroot/files

 which will be publically accessible via:

 www.mysite.com/files/filename.ext

 hth

 jon

 --

 jon bennett
 t: +44 (0) 1225 341 039 w:http://www.jben.net/
 iChat (AIM): jbendotnet Skype: jon-bennett


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: file upload

2007-02-21 Thread Jon Bennett

 is there a way to avoid cakephp taking control over file the folder

why not follow Cake's conventions and save the files in:

mysite/app/webroot/files

which will be publically accessible via:

www.mysite.com/files/filename.ext

hth

jon

-- 


jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: file upload

2007-02-21 Thread bingo

Hi,

I think i found solution to my problem..
I created a .htaccess file and placed it inside files folder with the
following line

#prevent directory listing
IndexIgnore *

and now it doesn't allow browsing...great

Regards,
Ritesh

On Feb 21, 8:31 pm, bingo [EMAIL PROTECTED] wrote:
 Hi

 thanks to all your reply..I got file upload working..however there is
 one problem..
 Now anyone can see the directory structure and all the files..
 I am not sure how to manipulate htaccess so users can only use the
 link provided by the application and do not have access to other files

 Regards,
 Ritesh

 On Feb 21, 8:16 pm, Jon Bennett [EMAIL PROTECTED] wrote:



   is there a way to avoid cakephp taking control over file the folder

  why not follow Cake's conventions and save the files in:

  mysite/app/webroot/files

  which will be publically accessible via:

 www.mysite.com/files/filename.ext

  hth

  jon

  --

  jon bennett
  t: +44 (0) 1225 341 039 w:http://www.jben.net/
  iChat (AIM): jbendotnet Skype: jon-bennett- Hide quoted text -

 - Show quoted text -


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



Re: Custom Validate

2007-02-21 Thread Grant Cox

I haven't really looked at the new Validation options, but the
traditional way is to do this in your model beforeValidate callback.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: file upload

2007-02-21 Thread lloydhome

You need to put it under the webroot
mysite
  -- app
  - webroot
   file

HTH,

David Lloyd
--
lloydhome consulting, inc
http://lloydhome.com


On Feb 21, 6:58 pm, bingo [EMAIL PROTECTED] wrote:
 Hi,

 I want to allow users to upload files on to the server...however, I
 got all the code..but have some problem in providing a link to the
 user..

 my configuration is as follows

 mysite
 -- app
 -- cake
 -- file //in this folder I will keep all the uploaded files

 however, if I create a link such ashttp://localhost/mysite/file/demo.pdf
 cake takes over the control and display a page with error:
 You are seeing this error because controller FilesController  could
 not be found.

 is there a way to avoid cakephp taking control over file the folder


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: file upload

2007-02-21 Thread Rhett Waldock

Hi Ritesh,

Try placing:

Options -Indexes

In your .htaccess file.
That should disable directory listings.

Rhett
-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of bingo
Sent: Wednesday, February 21, 2007 7:41 PM
To: Cake PHP
Subject: Re: file upload


Hi,

I think i found solution to my problem..
I created a .htaccess file and placed it inside files folder with the
following line

#prevent directory listing
IndexIgnore *

and now it doesn't allow browsing...great

Regards,
Ritesh

On Feb 21, 8:31 pm, bingo [EMAIL PROTECTED] wrote:
 Hi

 thanks to all your reply..I got file upload working..however there is
 one problem..
 Now anyone can see the directory structure and all the files..
 I am not sure how to manipulate htaccess so users can only use the
 link provided by the application and do not have access to other files

 Regards,
 Ritesh

 On Feb 21, 8:16 pm, Jon Bennett [EMAIL PROTECTED] wrote:



   is there a way to avoid cakephp taking control over file the folder

  why not follow Cake's conventions and save the files in:

  mysite/app/webroot/files

  which will be publically accessible via:

 www.mysite.com/files/filename.ext

  hth

  jon

  --

  jon bennett
  t: +44 (0) 1225 341 039 w:http://www.jben.net/
  iChat (AIM): jbendotnet Skype: jon-bennett- Hide quoted text -

 - Show quoted text -






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: hasMany/belongsTo

2007-02-21 Thread Seb

Uuummm, I must say I don't really understand what your problem
precisely is, however I can spot a few mistakes in the code you
provided;

* using the HtmlHelper the tagName param should be User/id, not User/
user_id (that's if you're using the cake naming conventions)
* also if your relations are defined properly, you shouldn't have to
$this-data['User']['profile_id']=array($this-Profile-
getLastInsertId());

if I understand your app properly (Please, provide more details!) you
should have something like this for a one to one relationship;

User Model:
$hasOne = array('Profile');

Profile Model:
$belongsTo = array('User');

However, I see you have a Users_Profiles, meaning your having a many
to many relationship...??!

If that's the case, make sure your table is named Profiles_Users
(alphabetical) and you should not have a profile_id in the user table
nor in the user model.

Then try that; (assuming you have used the proper naming conv...!)

User Model:
var $hasAndBelongsToMany = array('Profile');

and the Profile Model should have the reverse;
var $hasAnd BelongsToMany = array('User');


So anyway, again, I'm really not sure where you're heading... but post
some more code (models, views and tbl structure) and we'll see what we
can do!

Hope it helps!

Seb./

Kathrin wrote:
 Hello,
 ich have Problems to save data in a hasMany/belonsto
 Users_ProfilesTable.
 Sie Array is OK.
 My source:

 View User:
 ?php // echo $html-hidden('User/user_id', array('value' =
 $post['User']['id']));?
 post to  User/Controller save the data and post user_id to Profile/
 controller
 View/Profile
 echo $form-hidden('User/user_id', array('value'= $userid));
 Controller/Profile
 function addprofile($userid=0) {
   $this-set('userid',$userid);
 if (!empty ($this-data)) {  #Formular wurde
 abgeschickt-eingegebene Datenspeichern
 $this-cleanUpFields();
 $this-Profile-create();
   
 $this-data['Profile']['user_id']=array($this-data['User']
 ['user_id']);
 $this-Profile-save($this-data);
   $this-data['User']['profile_id']=array($this-Profile-
 getLastInsertId());
   //error_log(print_r($this-data,true));
   $this-Session-setFlash('The Profile-Data has been 
 saved');
 exit();
 }
 Have somebody an idea?
 Sincerely Kathrin


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: pagination component / question / typo

2007-02-21 Thread jyrgen

Hello,

thanks for your answer !

i found that AD7six, Andy Dawson created that component,
so let's hope he looks over this thread... hehe

Well, i *bet* there is a way of extending the helper methods
_generateUrl / _generateLink
but i need some idea to get started.

in the meantime, yes, post your workaround please.

cheers, jyrgen



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: pagination component / question / typo

2007-02-21 Thread jyrgen

i found that any pre-existing GET parameters are automatically
sorted out and re-appended during the pagelink generation.
that's really nice, because you just have to pass an initial extra
parameter like this:

http://localhost/cake/index.php/articles/index?myparam=1

the next button link will become

http://localhost/cake/index.php/articles/index?myparam=1page=2


j.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Extracting Anchor string from URL

2007-02-21 Thread aranworld

I am familiar with CakePHP's $params array which can give me the GET
values from a URL.

However, does CakePHP keep track of the anchor text in a URL?

For example, if my URL is:

http://www.usa.gov/billofrights/#amend10

Referring to the in-page anchor named amend10, can I access this
information anywhere from withint CakePHP?

It doesn't appear as if the $params array keeps track of this
information.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Custom Validate

2007-02-21 Thread Petry

Hi All

Why i Create a custom function for valide only uploaded imagem files?

In cake/libs/validators.php is possible create a custom validade, but
only using regular expressions, right?

I'd like to create a custom validade for example which these code:

?php
function validateImage($field){
$imagetypes = array( 'image/jpeg', // images
  'image/pjpeg',
  'image/png',
  'image/gif',
  'image/tiff',
  'image/x-tiff');

if(!in_array($field['type'],$imagetypes)){
return true;
}else{
return false;
}
}
print validateImage('');
?


thanks!

Petry


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



Re: CakePHP configuration on WAMP - directory path settings?

2007-02-21 Thread Grant Cox

In windows you can't start a path with a backslash.  Try:

if (!defined('ROOT')) {
define('ROOT', 'C:'.DS.'wamp'.DS.'apps');
}
if (!defined('APP_DIR')) {
define('APP_DIR', 'cakeApp1' );
}
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', 'C:'.DS.'wamp'.DS.'cake' );
}


spheroid2007 wrote:
 I successfully set up Cake on my LAMP hosting to have multiple
 applications on one hosting account (http://bakery.cakephp.org/
 articles/view/141). Now, I'm not sure the settings on my WAMP (local
 computer) for the directory of the application.

 On my local system, I've set up cake in the following structure:

 c:\wamp
\cake
   \cake
   \vendors
\apps\cakeApp1
\www\cakeApp1

 So the setup when working will allow me to view the cake app at
 http://localhost/cakeApp1.

 Question: when configuring c:\wamp\www\cakeApp1\index.php, what
 settings would I change below:

 if (!defined('ROOT')) {
  define('ROOT', DS.'apps'.DS.'cakeApp1');
 }
 if (!defined('APP_DIR')) {
  define('APP_DIR',dirname('cakeApp1'));
 }
 /**
  * This only needs to be changed if the cake installed libs are
 located
  * outside of the distributed directory structure.
  */
 if (!defined('CAKE_CORE_INCLUDE_PATH')) {
   define('CAKE_CORE_INCLUDE_PATH', DS.'cake');
 }

 This doesn't work correctly. Thanks in advance!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Extracting Anchor string from URL

2007-02-21 Thread Rhett Waldock

I think you would have to use JavaScript to extract an anchor value and send
the information to Cake through AJAX. I could be mistaken but as far as I
know, the anchor portion of a request URL is not even passed to the server.

Rhett
-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of aranworld
Sent: Wednesday, February 21, 2007 8:26 PM
To: Cake PHP
Subject: Extracting Anchor string from URL


I am familiar with CakePHP's $params array which can give me the GET
values from a URL.

However, does CakePHP keep track of the anchor text in a URL?

For example, if my URL is:

http://www.usa.gov/billofrights/#amend10

Referring to the in-page anchor named amend10, can I access this
information anywhere from withint CakePHP?

It doesn't appear as if the $params array keeps track of this
information.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Extracting Anchor string from URL

2007-02-21 Thread Mariano Iglesias

Anchors are dealt on the browser side, there's nothing going on the server
side.

1. If you are on page /controller/action and you have a link like so: a
href=#anchor then the browser would look for anchor #anchor on the
current loaded page.

2. If you are on page /controller/action and you have a link like so: a
href=/controller/action2#anchor then SERVER will give your browser
contents for /controller/action2, and browser would then look for anchor
#anchor.

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de aranworld
Enviado el: Miércoles, 21 de Febrero de 2007 11:26 p.m.
Para: Cake PHP
Asunto: Extracting Anchor string from URL

I am familiar with CakePHP's $params array which can give me the GET
values from a URL.

However, does CakePHP keep track of the anchor text in a URL?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: 1.2: Can I use new validation class in a component?

2007-02-21 Thread Cynthia

Looking at the new test file I think I have it.

On top:

uses('Validation');

then before use:

$Validation = new Validation();

Then it works :-)



On Feb 21, 6:07 pm, Cynthia [EMAIL PROTECTED] wrote:
 Hi Nate :-)

 After just having learned about using the Inflector statically I hoped
 that this would do the trick ... but when I call Validation from my
 component this way I get:

 Fatal error: Call to undefined function: __reset()

 :(

 On Feb 21, 3:43 pm, nate [EMAIL PROTECTED] wrote:

  For the most part, the methods of the Validation class can be accessed
  statically, i.e. to validate a date, you can just do
  Validation::date($date).  There's also an optional $format parameter
  which defaults to 'ymd'.

  On Feb 21, 2:09 pm, Cynthia [EMAIL PROTECTED] wrote:

   I'm writing a component which a bunch of controllers can use to always
   do the same job: take some dates or date range information and return
   some conditions.

   I thought it would be cute to have the component also check if those
   entered dates are in the right format and are valid. But for the life
   of me, I can't seem to get to the validation thing.

   I tried $uses, $helper, $component. Most of the time there is no
   error ... but then maybe I don't know the path to get to it?

   $this-MyComponent-Validation-validate ... or

   $this-MyComponent-OriginalController-Validation

   For the moment I'll just CP the date checking method ... but would be
   nice to learn how to do this the right way :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Extracting Anchor string from URL

2007-02-21 Thread nate

http://us2.php.net/parse_url

On Feb 21, 9:26 pm, aranworld [EMAIL PROTECTED] wrote:
 I am familiar with CakePHP's $params array which can give me the GET
 values from a URL.

 However, does CakePHP keep track of the anchor text in a URL?

 For example, if my URL is:

 http://www.usa.gov/billofrights/#amend10

 Referring to the in-page anchor named amend10, can I access this
 information anywhere from withint CakePHP?

 It doesn't appear as if the $params array keeps track of this
 information.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Extracting Anchor string from URL

2007-02-21 Thread mariano.iglesias

Sorry mate I misunderstood your question. I thought you were asking if
Cake was doing something about the anchor ;)

-MI


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: View Caching of Home Page

2007-02-21 Thread MattC

PaulV,
I've encountered a similar problem.  For now I've worked around it by
putting the following AT THE BOTTOM of my .htaccess file:

RewriteRule ^$  /controller/action [R,L]
RewriteRule ^/$ /controller/action [R,L]

If you want to read all the gory details on why this is happening:
http://www.siteamonth.com/archives/2007/02/21/cakephp-cache-workarounds-part-1/

-Matt

On Feb 20, 6:51 pm, PaulV [EMAIL PROTECTED] wrote:
 Hi Guys,

 I am trying to improve the performance of loading my home page by
 turning on view caching in Cake Stable: 1.1.13.4450

 My home page (e.g. at http://myurl/) is routed to a custom
 controller using the following in routes.php

 $Route-connect('/', array('controller' = 'pub', 'action' =
 'index', ''));

 where I have a custom controller pub_controller.php with a custom
 action index and the appropriate CACHE_CHECK global and cacheAction
 variables have been set.

 When I visit the home page, no file gets created in the tmp/cache/
 views directory. If I visit other URLs, a cache file is created (eg. I
 visit pub/index as above).

 Can someone let me know how I can solve this problem?

 Thanks,
Paul


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Mail function

2007-02-21 Thread Dr. Tarique Sani

On 2/21/07, AD7six [EMAIL PROTECTED] wrote:
 On Feb 21, 2:16 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  In my project after registration completed  i want to send a mail to
  that user and admin.Give me an examples

 At the very least, you are missing the magic word.


Hint: Request, don't demand.

Tarique

=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Extracting Anchor string from URL

2007-02-21 Thread Rhett Waldock

parse_url() would work well for this IF you could pass a full URL including
the anchor to it, but the HTTP request sent to the server does not include
the anchor.  

Javascripts in the view would have access to the location URL including the
anchor... so you could send that information to the server using Ajax and
then process it with parse_url() to identify the anchor.

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of nate
Sent: Wednesday, February 21, 2007 9:47 PM
To: Cake PHP
Subject: Re: Extracting Anchor string from URL


http://us2.php.net/parse_url

On Feb 21, 9:26 pm, aranworld [EMAIL PROTECTED] wrote:
 I am familiar with CakePHP's $params array which can give me the GET
 values from a URL.

 However, does CakePHP keep track of the anchor text in a URL?

 For example, if my URL is:

 http://www.usa.gov/billofrights/#amend10

 Referring to the in-page anchor named amend10, can I access this
 information anywhere from withint CakePHP?

 It doesn't appear as if the $params array keeps track of this
 information.






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Rendering views of another ojbect with AJAX

2007-02-21 Thread Dr. Tarique Sani

On 2/21/07, jamieh [EMAIL PROTECTED] wrote:

 Hi again [EMAIL PROTECTED],

 Eventually managed to get back onto this.  I am a little lost now as I
 don't understand why i would need to use:

 $uses = array(Users, Projects);

You would need that if your User and Project are not associated. and
you are wanting to do operations on Project from within your
UsersController - looks like this is not the case

 My biggest problem is the understanding of AJAX and how models work
 together within AJAX operations!

The same as normal CakePHP

 Would the best approach be to have my Projects::Add inside my Users
 controller like Users::AddProject for example?

Yes because you are doing/wanting to do  $this-User-Project-save()
within the UsersController - the action for whatever you are doing is
still in UsersController.

But still this is not what you are wanting to do (but doing ;) )

 If i have in Users::Add the following:

 $this-render('projects/add/', 'ajax');

Try using $this-render(null,null,'complete/path/to/project/add.thtml');

Should work, and I presume that the form will submit to ProjectsController::add

HTH
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: [C] Problem with custom validation

2007-02-21 Thread Dr. Tarique Sani

On 2/22/07, abba bryant [EMAIL PROTECTED] wrote:


 If you are using the validator class from CheeseCake or others ( I assume
 here - not sure if it Tariq's or someone else's and he is simply using it. )
 the correct method is to use

The class is ours (cheesecake team) but heavily draws from work of others

 echo $validator-tagErrorMsg( 'Project/start_date' );

I don't think that she is using the cheesecake validator - OTOH if
someone is using cheesecake validators we would appreciate feedback /
bug reports

Cheers
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Installing a CakePHP application on an existing site

2007-02-21 Thread Dr. Tarique Sani

On 2/22/07, Wey [EMAIL PROTECTED] wrote:
  Hi, I'm actually trying to do exactly this.  I don't know .htaccess
 that well, so I how would I configure it to serve up directories and
 files if they exist?

I just solved a similar situation where in I wanted the
http://mysite.com/ (and in turn urls like http://mysite.com/about,
http://mysite.com/portfolio etc)  to be served by a cakeapp but at the
same time http://mysite.com/blog/ http://mysite.com/some_other_app/ to
work just as well

The setup ultimately became something like

public_html
 |
 \--page (the app which serves / )
 |
 \--blog
 .htaccess

the .htaccess has

IfModule mod_rewrite.c
   RewriteEngine on
   RewriteRule ^$ page/app/webroot/[L]
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule (.*) page/app/webroot/$1 [L]
/IfModule

Some simple mapping in the page/app/config/routes.php solved everything

Anyone has any better suggestions?

Cheers
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Directory Separators / Best Practice?

2007-02-21 Thread Rhett Waldock

Hello Everyone,

Another thread here made me want to raise a question of best practices when
defining directory paths - it really applies both in Cake and in general.

I notice that the Cake convention when defining paths is to create a
concatenated string for the path using the DS constant for each directory
separator in the path.  An example, selectively copied from a post in
another thread:

if (!defined('ROOT')) {
define('ROOT', 'C:'.DS.'wamp'.DS.'apps');
}
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', 'C:'.DS.'wamp'.DS.'cake' );
}

I completely understand why it's important to use the DS constant for
self-discovery paths that are generated on-the-fly on many platforms (like
the Cake core).  However, when defining these absolute paths, which
obviously do not cross platforms anyways, what is the benefit of this
convention?

Using continuous strings, the values are much more readable and also easier
to change:

if (!defined('ROOT')) {
define('ROOT', 'C:\wamp\apps');
}
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', 'C:\wamp\cake' );
}

What am I missing?

Rhett


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: [C] Problem with custom validation

2007-02-21 Thread abba bryant


Well now. * I * have used it some for my own development / learning cycles a
number of times. The one thing I noticed is the order of the errors and
messages in the validation arrays matters. You need to put them in the
specific order you want the tests checked. IE valid not empty needs then the
regex, so that it must pass the first to make it to the second. I hope that
was clear.

Anyways I am loving what I have seen it capable of so far.
Are the licencse issues I should be aware of before I consider using /
modifying it for my own aside from the notes at the top of each file from
svn? I should also note I am not using the ajax validation or any javascript
nor the cheese helper. I did notice some jquery action in your svn. Sexy.

Abba Bryant


Dr. Tarique Sani wrote:
 
 
 On 2/22/07, abba bryant [EMAIL PROTECTED] wrote:


 If you are using the validator class from CheeseCake or others ( I assume
 here - not sure if it Tariq's or someone else's and he is simply using
 it. )
 the correct method is to use
 
 The class is ours (cheesecake team) but heavily draws from work of others
 
 echo $validator-tagErrorMsg( 'Project/start_date' );
 
 I don't think that she is using the cheesecake validator - OTOH if
 someone is using cheesecake validators we would appreciate feedback /
 bug reports
 
 Cheers
 Tarique
 
 -- 
 =
 PHP for E-Biz: http://sanisoft.com
 Cheesecake-Photoblog: http://cheesecake-photoblog.org
 =
 
  
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-custom-validation-tf3252461.html#a9095461
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: [C] Problem with custom validation

2007-02-21 Thread abba bryant


It would also seem useful to add an html helper or override the
html-tagErrorMsg so that it could accept both the old and the cheesecake
methods. That would make it more portable. I have been caught ( about 20
minutes ago ) attempting to use the validator and still had $html-tagE.. in
my views that I missed. Oops. 

Abba Bryant


Dr. Tarique Sani wrote:
 
 
 On 2/22/07, abba bryant [EMAIL PROTECTED] wrote:


 If you are using the validator class from CheeseCake or others ( I assume
 here - not sure if it Tariq's or someone else's and he is simply using
 it. )
 the correct method is to use
 
 The class is ours (cheesecake team) but heavily draws from work of others
 
 echo $validator-tagErrorMsg( 'Project/start_date' );
 
 I don't think that she is using the cheesecake validator - OTOH if
 someone is using cheesecake validators we would appreciate feedback /
 bug reports
 
 Cheers
 Tarique
 
 -- 
 =
 PHP for E-Biz: http://sanisoft.com
 Cheesecake-Photoblog: http://cheesecake-photoblog.org
 =
 
  
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-custom-validation-tf3252461.html#a9095474
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: [C] Problem with custom validation

2007-02-21 Thread Dr. Tarique Sani

On 2/22/07, abba bryant [EMAIL PROTECTED] wrote:
 minutes ago ) attempting to use the validator and still had $html-tagE.. in
 my views that I missed. Oops.
Thanks for the feedback.

If you use the latest SVN version it is 100% backwards compatible (or
atleast thats what we tried to make it)

A tutorial has been written - hopefully I will be able to edit it this
weekend and put it online.
If you want to see AJAX validation in action - try commenting on the
Cheesecake demo

Thanks once again

Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Cake 1.2 pagination using hasAndBelongToMany association!

2007-02-21 Thread Vu Nguyen

I'm having this problem with cake 1.2 pagination: Things work well if
I just want to search and paginate data on 1 model (i.e: $this-
paginate(Entry, $condition);)
However, if Entry can have and belong to many Tags (I have table
entries_tags and table tags), I want to search and paginate all
entries with certain names and certain tags, i.e:
$this-paginate(array(Entry.name = blah blah, Tag.name =
nonsense));

This doesn't work, Cake will just search in the table of the current
controller (if I put this in Tag controller then it will search in
tags table only, which will break the sql)

I think bindModel might be the solution, but I can't figure out how to
do it.

Any suggestion please?

Thank you so much.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---