HABTM and extra foreign keys

2009-07-27 Thread matias

Hi!
I have a problem. I want to link relational table of two habtm tables
with another one.
I have table `types` (id, name) that is habtm `characteristics` (id,
name). Their rel table is `characteristics_types` (id,
characteristic_id, type_id). I want to link each record from this
table with many records in 4th table `options` (id, name,
characteristics_types_id).
But it doesnt work. Cake says Undefined property:  Property::
$CharacteristicsType. Can somebody help me? please?

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



Re: $data always empty - Please HELP!

2008-04-20 Thread Matias Veleda
Hey guys,

Thanks for the answers. I think I'm doing things right, I mean, I followed
the Post/Comments example on the CakePHP Manual. In my case, I hace
Masters and MasterDetails. Just for you to have an idea:

The function in the Controller looks like this:

function add()
{
if (!empty($this-data))
{
if ($this-Master-save($this-data))
{
$this-flash('Your post has been saved.','/masters');
}
}
}

And a part of the html that build the field looks like this:

tr
td colspan=2
?php echo $form-input('Master/name',
array('type' = 'text', 'size' = '30','class' = 'formfield', 'name' =
'name'))?
?php echo $form-error('Master/name', 'Name is
required.') ?
/td
/tr

The form is going to the right function cuz I placed and echo at the
beginning and it works, but still $data is always empty. Is this anything
wrong in the HTML?

Thanks in advance!

Matt.


On Sun, Apr 20, 2008 at 3:40 AM, Gonzalo Servat [EMAIL PROTECTED] wrote:

 On Sat, Apr 19, 2008 at 9:31 PM, Matias Veleda [EMAIL PROTECTED]
 wrote:

 
  Hey guys,
 
  I'm new to CakePHP. I followed the instructions in the manual, the
  example case and everytime I want to update my databaser from a form
  my $data is always empty, what am I doing wrong? It's like nothing
  happens when I press submit button.
  Sorry my english, I'm from Argentina. Hope someone can help me soon
  cuz I need to solve this urgently!
 

 ES
 Hola Matias,

 Desde donde estas tratando de ver el contenido de $data ? En el controller
 tendrias que fijate en $this-data, y si queres ver el contenido desde un
 Model tendrias que pasar $this-data como argumento.

 Suerte!
 /ES

 EN
 Hi Matias,

 Where are you trying to look at the content of $data from? If it's from a
 controller you'd have to look into $this-data, and if you want to look at
 the content from a Model you'd have to pass $this-data as an argument.

 Good luck!
 /EN

 - Gonzalo

 


--~--~-~--~~~---~--~~
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: $data always empty - Please HELP!

2008-04-20 Thread Matias Veleda
B Logica ot works!!

Thank you so much!! Now I can keep moving on this amazing framework!! Thanks
to all you guys for your answers!! Hope someday I can help you on something.
Just the last question about this problem. When I echo and input it renders
a label in the view with the field name right next to the input box. How can
I make that label not to appear cuz I want to make labels on my own. Thanks.

Anytime,

Matt.-

On Sun, Apr 20, 2008 at 12:30 PM, b logica [EMAIL PROTECTED] wrote:


function add()
{
if (!empty($this-data))
{
 // debugging; make sure app/tmp is writeable by the webserver
$this-log($this-data);
// Remove that later, btw. Look in app/tmp/logs/error.log

// add this
$this-Master-create();

if ($this-Master-save($this-data))
{
$this-flash('Your post has been saved.','/masters');
}
}
}


 Make sure your view has the correct form opener:

 $form-create('Master', array('action' = 'add'))

 And leave out the 'name' on your form inputs. Let Cake handle that.
 You're free to set the ID how you want, in case of javascript
 interaction.

 If you're using Cake 1.2 use this syntax:

 $form-input('Master.name', array('type' = 'text', 'size' =
 '30','class' = 'formfield'))

 Also, you're using echo for your inputs, so make sure to put a
 semi-colon at the end

 ?php echo $form-input(...); ?

 If you use the short tag syntax you don't need it, though.

 ?= $form-input(...) ?

 On Sun, Apr 20, 2008 at 2:52 AM, Matias Veleda [EMAIL PROTECTED]
 wrote:
  Hey guys,
 
  Thanks for the answers. I think I'm doing things right, I mean, I
 followed
  the Post/Comments example on the CakePHP Manual. In my case, I hace
  Masters and MasterDetails. Just for you to have an idea:
 
  The function in the Controller looks like this:
 
  function add()
  {
  if (!empty($this-data))
  {
  if ($this-Master-save($this-data))
  {
   $this-flash('Your post has been saved.','/masters');
  }
  }
  }
 
  And a part of the html that build the field looks like this:
 
  tr
   td colspan=2
  ?php echo $form-input('Master/name',
  array('type' = 'text', 'size' = '30','class' = 'formfield', 'name' =
  'name'))?
   ?php echo $form-error('Master/name',
 'Name is
  required.') ?
  /td
  /tr
 
  The form is going to the right function cuz I placed and echo at the
  beginning and it works, but still $data is always empty. Is this
 anything
  wrong in the HTML?
 
  Thanks in advance!
 
  Matt.
 
 
 
 
  On Sun, Apr 20, 2008 at 3:40 AM, Gonzalo Servat [EMAIL PROTECTED]
 wrote:
  
  
  
   On Sat, Apr 19, 2008 at 9:31 PM, Matias Veleda [EMAIL PROTECTED]
 
  wrote:
  
  
  
  
  
   
Hey guys,
   
I'm new to CakePHP. I followed the instructions in the manual, the
example case and everytime I want to update my databaser from a form
my $data is always empty, what am I doing wrong? It's like nothing
happens when I press submit button.
Sorry my english, I'm from Argentina. Hope someone can help me soon
cuz I need to solve this urgently!
   
  
  
   ES
   Hola Matias,
  
   Desde donde estas tratando de ver el contenido de $data ? En el
 controller
  tendrias que fijate en $this-data, y si queres ver el contenido desde
 un
  Model tendrias que pasar $this-data como argumento.
  
   Suerte!
   /ES
  
   EN
   Hi Matias,
  
   Where are you trying to look at the content of $data from? If it's
 from a
  controller you'd have to look into $this-data, and if you want to look
 at
  the content from a Model you'd have to pass $this-data as an argument.
  
   Good luck!
   /EN
  
   - Gonzalo
  
  
  
  
  
  
 
 
   
 

 


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



Re: $data always empty - Please HELP!

2008-04-20 Thread Matias Veleda
Thanks a lot! It works perfectly! :-)

Anytime,

Matt.-

On Sun, Apr 20, 2008 at 7:29 PM, b logica [EMAIL PROTECTED] wrote:


 $form-input('INPUT_NAME', array('label' = false,  other options ...))

 I forgot where to find this but you can also modify how labels are
 created (ie. inside a div or not, class name, etc).

 On Sun, Apr 20, 2008 at 2:55 PM, Matias Veleda [EMAIL PROTECTED]
 wrote:
  B Logica ot works!!
 
  Thank you so much!! Now I can keep moving on this amazing framework!!
 Thanks
  to all you guys for your answers!! Hope someday I can help you on
 something.
  Just the last question about this problem. When I echo and input it
 renders
  a label in the view with the field name right next to the input box. How
 can
  I make that label not to appear cuz I want to make labels on my own.
 Thanks.
 
  Anytime,
 
  Matt.-
 
 
 
  On Sun, Apr 20, 2008 at 12:30 PM, b logica [EMAIL PROTECTED] wrote:
  
  
  function add()
  {
  if (!empty($this-data))
  {
  // debugging; make sure app/tmp is writeable by the
 webserver
  $this-log($this-data);
  // Remove that later, btw. Look in app/tmp/logs/error.log
  
  // add this
  $this-Master-create();
  
  
  if ($this-Master-save($this-data))
  {
  $this-flash('Your post has been saved.','/masters');
  }
  }
  }
  
  
   Make sure your view has the correct form opener:
  
   $form-create('Master', array('action' = 'add'))
  
   And leave out the 'name' on your form inputs. Let Cake handle that.
   You're free to set the ID how you want, in case of javascript
   interaction.
  
   If you're using Cake 1.2 use this syntax:
  
  
   $form-input('Master.name', array('type' = 'text', 'size' =
   '30','class' = 'formfield'))
  
   Also, you're using echo for your inputs, so make sure to put a
   semi-colon at the end
  
   ?php echo $form-input(...); ?
  
   If you use the short tag syntax you don't need it, though.
  
   ?= $form-input(...) ?
  
  
  
  
   On Sun, Apr 20, 2008 at 2:52 AM, Matias Veleda [EMAIL PROTECTED]
 
  wrote:
Hey guys,
   
Thanks for the answers. I think I'm doing things right, I mean, I
  followed
the Post/Comments example on the CakePHP Manual. In my case, I
 hace
Masters and MasterDetails. Just for you to have an idea:
   
The function in the Controller looks like this:
   
function add()
{
if (!empty($this-data))
{
if ($this-Master-save($this-data))
{
 $this-flash('Your post has been
 saved.','/masters');
}
}
}
   
And a part of the html that build the field looks like this:
   
tr
 td colspan=2
?php echo $form-input('Master/name',
array('type' = 'text', 'size' = '30','class' = 'formfield',
 'name' =
'name'))?
 ?php echo $form-error('Master/name',
  'Name is
required.') ?
/td
/tr
   
The form is going to the right function cuz I placed and echo at the
beginning and it works, but still $data is always empty. Is this
  anything
wrong in the HTML?
   
Thanks in advance!
   
Matt.
   
   
   
   
On Sun, Apr 20, 2008 at 3:40 AM, Gonzalo Servat [EMAIL PROTECTED]
  wrote:



 On Sat, Apr 19, 2008 at 9:31 PM, Matias Veleda
  [EMAIL PROTECTED]
wrote:





 
  Hey guys,
 
  I'm new to CakePHP. I followed the instructions in the manual,
 the
  example case and everytime I want to update my databaser from a
 form
  my $data is always empty, what am I doing wrong? It's like
 nothing
  happens when I press submit button.
  Sorry my english, I'm from Argentina. Hope someone can help me
 soon
  cuz I need to solve this urgently!
 


 ES
 Hola Matias,

 Desde donde estas tratando de ver el contenido de $data ? En el
  controller
tendrias que fijate en $this-data, y si queres ver el contenido
 desde
  un
Model tendrias que pasar $this-data como argumento.

 Suerte!
 /ES

 EN
 Hi Matias,

 Where are you trying to look at the content of $data from? If it's
  from a
controller you'd have to look into $this-data, and if you want to
 look
  at
the content from a Model you'd have to pass $this-data as an
 argument.

 Good luck!
 /EN

 - Gonzalo






   
   
 
   
  
  
  
 
 
   
 

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more

$data always empty - Please HELP!

2008-04-19 Thread Matias Veleda

Hey guys,

I'm new to CakePHP. I followed the instructions in the manual, the
example case and everytime I want to update my databaser from a form
my $data is always empty, what am I doing wrong? It's like nothing
happens when I press submit button.
Sorry my english, I'm from Argentina. Hope someone can help me soon
cuz I need to solve this urgently!

Thanks in advance!

Matt.-


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

2008-04-04 Thread Matias Lespiau
I'm not sure but I think you can provide an alias to the helper this way:

$helpers = array('CustomHtml' = 'Html');

On Fri, Apr 4, 2008 at 11:32 AM, Greg Baker [EMAIL PROTECTED]
wrote:


 Very interesting fixexactly what I was looking for.  Thanks

 On Apr 4, 12:26 pm, grigri [EMAIL PROTECTED] wrote:
  There should be an official solution sometime involving aliased
  helpers.
 
  In the meantime, check out my hack here:
 
  http://groups.google.com/group/cake-php/browse_thread/thread/1c1c3701...
 
  On Apr 4, 3:02 pm, Greg Baker [EMAIL PROTECTED] wrote:
 
   I want to create a custom HTML helper that extends htmlhelper..
   However because of the code I have already that I don't want to
   change, I want to name this helper so that I can use $html-... in my
   views.
 
   Any way I can do this?
   Normally if this was a new project I'd just create a new class and use
   that in my views, but I have a lot of code changing to do in this one
   if I do that.
 



-- 
Matias Lespiau
http://www.gignus.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: Model find() to return object; instead of array (?)

2008-04-03 Thread Matias Lespiau
I think this is the link your a looking for:
http://bin.cakephp.org/saved/1237


On Thu, Apr 3, 2008 at 4:24 AM, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:


 Like it is written in one of the comments on the page you link to.
 Cake does not return objects partly because it does not fit well with
 the PHP-language. In ruby, everyhing is an object. Every character,
 every number is its own object. So it is very natural to use objects
 for the model-data to follow the language conventions. Doing the same
 in PHP would be fighting the language every step of the way.

 I understand your desire to have lazy data retieval and access to
 methods on your data. I want that to from time to time (specifically
 when I have been developing in a more OO language for a while and come
 back to PHP).

 As on that page I would also suggest you look at some of the bahaviors
 in the Bakery that can help with binding and unbinding data not needed
 for the current request.

 Another thing you can make use of for exports is paginate. Yes
 really :) If you are dumping 600 000 rows at once you could probably
 run out of memory. By running the export in a few passes are appending
 the exported file (or wherever the data is going) each time you will
 use less memory. (sure you can also paginate manually but what fun
 would that be?)

 I often run big-memory and long-time data management from the php-cli
 using cron or other trigger.

 /Martin


 On Apr 3, 7:41 am, R. Rajesh Jeba Anbiah
 [EMAIL PROTECTED] wrote:
It's very crucial to have the find() or similar returns DB
  object instead of full array--as for any data export module, we cannot
  dump the whole array which would result in memory error. IIRC, someone
  provided how to do that in CakePHP, but I lost the link; but, when I
  google, the closest I get now ishttp://
 jimmyzimmerman.com/blog/2007/05/why-i-prefer-ruby-on-rails-ove...
  Is there anyone who bookmarked such previous hack or can provide any
  hint? TIA
 
  --
?php echo 'Just another PHP saint'; ?
  Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/
 



-- 
Matias Lespiau
http://www.gignus.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: Unbind Reverse Relations in Recursive Queries

2008-03-02 Thread Matias Lespiau
On Mon, Mar 3, 2008 at 5:38 AM, sabkaraja [EMAIL PROTECTED] wrote:


 Hi


Hi,



 I have 3 models: Subject, Topic  Chapter

 Subject  hasMany  Topics  Topic  belongsTo  Subject
 Topic  hasMany  Chapters  Chapter  belongsTo  Topic
 User  HABTM  Chapter

 I am trying to do a recursive query ($this-Subject-
 findAll('Subject.enabled=1'); ) to find out all the subjects  topics
  chapters (and if needed users), I get results (copied only relevant
 bits) like the following:

 Array
 (
[Subject] = Array
(
[id] = 1
...
...

)

[Topic] = Array
(
[0] = Array
(
[id] = 1
[subject_id] = 1
...
...
...
[Subject] = Array
(
[id] = 1
...
...
)

[Chapter] = Array
(
[0] = Array
(
[id] = 1
[topic_id] = 1
...
...
)

)

)
}
 }

 I want only a forward relationship records. that is: subject  Topics
  chapters  users. I dont want Topics  Subject query. This adds
 considerable overhead to a findAll query.
 How can I avoid that?


I think $this-Subject-Topic-unbindModel(array('belongsTo' = 'Subject'));
before the findAll should do the trick. If you want an easy way of handling
model bindings, try out Mariano Iglesia's Bindable Behavior:
http://bakery.cakephp.org/articles/view/bindable-behavior-control-your-model-bindings


-- 
Matias Lespiau
http://www.gignus.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: formHelper-inputs example

2008-02-25 Thread Matias Lespiau
 Hi,


Hi,


 I'm trying to use the inputs method to logically group a couple of
 textfields but I haven't figured out how to specify the legend of the
 fieldset. For example:

 ?php echo $form-inputs(array('ftp_user',ftp_password')); ?

 Creates the fieldset but with a default legend of New Server (where
 Server is the name of the model). If I specify a first parameter with
 the model name like:

 ?php echo $form-inputs('Server', array('ftp_user',ftp_password')); ?

 Then all the fields of the model are included in the fieldset with the
 legend Server. What I want to do is to group just a couple of the
 fields of the model but with a custom legend, for example Remote
 Login Information but I don't get how to do that using the inputs
 method of formHelper. Ideas ?


You can do it using this notation:

echo $form-inputs(array('legend' = 'Remote Login Information', 'fields' =
array('ftp_user', 'ftp_password') ));

-- 
Matias Lespiau
http://www.gignus.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: hasAndBelongsToMany with additional join table columns?

2008-02-21 Thread Matias

Another solution might be (don't know how elegant this is) to add a
finderQuery in your HABTM-relation. Just copy the present habtm-query
(you'll see it with debug level 2, for example), modify it a bit and
add it to your models habtm-statement. In your case the modification
should be something like this: in the SELECT-section add
posts_tags.tag_link_id AS Tag__tag_link_id and than modify the
tag_id the JOIN's ON-section to be a magical {$__cakeID__$} and than
your habtm-query should return the tag_link_id in the associated Tag-
model.

As I said, I don't know how elegant this approach is, but it worked
for me :)

On Feb 21, 6:41 am, mason [EMAIL PROTECTED] wrote:
 Hello all, got a question that I haven't yet seen an answer to...

 I have a fairly standard many:many relationship, much like the classic
 Posts-Tags example. I have the standard join table, with an extra
 column, for example:

 posts (id, text)
 tags (id, name)
 posts_tags (post_id, tag_id, tag_link_id)

 So this is where it gets unorthodox. Using the standard
 hasAndBelongsToMany, when I'm iterating a list of posts I can easily
 enough get the tags. But does anyone have a suggestion for *also*
 getting the tag_link_id for the association?

 As an example, I'd like to take a Post, and iterate its array of Tags.
 For each Tag, I want to get Tag.name but also get the tag_link_id from
 the corresponding row in posts_tags. I suppose I could do a find in
 posts_tags using the post_id and tag_id, but that's an extra database
 query for data that I should already have.

 Any suggestions of a clever way to carry this associated data along?

 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: Model primarykey

2008-02-12 Thread Matias Lespiau
On Feb 12, 2008 3:56 AM, adammc84 [EMAIL PROTECTED] wrote:


 if the MySql database table my model is 'modeled' from has a primary
 key that is user_id,posts_id how do i configure that in cake model to
 use a dual primary key ?


Hi adammc84,

Cake does not support multiple primary keys.

-- 
Matias Lespiau
http://www.gignus.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: how images stored in database

2008-02-12 Thread Matias Lespiau
This might help you:
http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/


On Feb 11, 2008 6:14 PM, AD7six [EMAIL PROTECTED] wrote:




 On Feb 11, 10:39 am, abiram [EMAIL PROTECTED] wrote:
  Hi all i want store images in database actually images stored in
  webroot img folder in database image path is entering it means only
  img names or overall path and how to retrive viewpage like
  ?php $product['products']['img] ?
  and what path is save in database pls send answ

 Google is your best buddy

 http://www.google.es/search?q=cakephp+store+image+meta+data+in+database
 



-- 
Matias Lespiau
http://www.gignus.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: New install: default layout is not being applied

2008-02-10 Thread Matias Lespiau
Hi drimo,

On Feb 10, 2008 2:28 AM, drimo [EMAIL PROTECTED] wrote:


 I have a new install for a development machine and right off the bat I
 can see the default layout is not being applied.  This happens when no
 custom layout is used and when a custom layout is defined.  See the
 linked screenshot for more information.  What is going on here?
 Thanks!

 http://starbarmonkey.com/upload/cakeError.JPG


I think your problem might be that your mod_rewrite is not working, so links
to css and images are not being loaded.
You can try to set you're document root to cake's dir/app/webroot and it
should work.

-- 
Matias Lespiau
http://www.gignus.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: New install: default layout is not being applied

2008-02-10 Thread Matias Lespiau
I still think your mod_rewrite might be disabled, if you have problem with
the urls, recheck your mod_rewrite configuration. Meanwhile, you can access
the pages as /index.php?url=/controllername/actionname/params

Good luck.

On Feb 10, 2008 12:22 PM, drimo [EMAIL PROTECTED] wrote:


 Thanks Matias!  I set apache's document root to /var/www/html/cake/app/
 webroot and the default layout applied immediately after restarting
 apache.  Thank you very much for your help!

 On Feb 10, 6:06 am, Matias Lespiau [EMAIL PROTECTED] wrote:
  Hi drimo,
 
  On Feb 10, 2008 2:28 AM, drimo [EMAIL PROTECTED] wrote:
 
 
 
   I have a new install for a development machine and right off the bat I
   can see the default layout is not being applied.  This happens when no
   custom layout is used and when a custom layout is defined.  See the
   linked screenshot for more information.  What is going on here?
   Thanks!
 
  http://starbarmonkey.com/upload/cakeError.JPG
 
  I think your problem might be that your mod_rewrite is not working, so
 links
  to css and images are not being loaded.
  You can try to set you're document root to cake's dir/app/webroot and it
  should work.
 
  --
  Matias Lespiauhttp://www.gignus.com/
 



-- 
Matias Lespiau
http://www.gignus.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: cakephp 1.2 pdfb helper

2008-02-07 Thread Matias Lespiau
Andrés,

With the information you are giving us there is little we can do to help
you. Also, you didn't asked a question. Are you looking for another PDF
solution? What does broken PDF means? Why don't you post the code of you
controller/view?

Cheers,


On Feb 7, 2008 11:07 AM, Andrés Otárola [EMAIL PROTECTED] wrote:


 Hi people!

 I've been having trouble using the library pdfb as a helper, even
 following the guide
 http://bakery.cakephp.org/articles/view/barcode-with-cake
 ( well, that's for 1.1 anyways...)

 ...the result is a broken pdf document



 any help would be appreciated...

 



-- 
Matias Lespiau
http://www.gignus.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: cakePHP redirect

2008-02-05 Thread Matias Lespiau
I think the referal's information is handled by the browser, so yes, those
pages will know where they come from.

On Feb 3, 2008 2:04 PM, Manu0310 [EMAIL PROTECTED] wrote:


 Hey I have a website with a lot of outgoing links to others.
 It is important that other sites I am referring people to know of
 these referrals.
 Does anyone know if the cakePHP redirect function will achieve this
 for me?
 Thank you.

 



-- 
Matias Lespiau
http://www.gignus.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: Case by case validation

2008-02-05 Thread Matias Lespiau
Maybe you can create a behavior. That way you control which models has those
validation rules available.

I don't know how cake's implement the 'on' = 'create' or 'update' rules,
but maybe you can sort of extend that to add more states, like 'on' =
'logged'.

Cheers,

On Feb 3, 2008 10:13 AM, cronet [EMAIL PROTECTED] wrote:


 Hello,


 how realising case by case validation ?? (e.g. A form need to validate
 different for a user logged in, or not logged in)

 First, I thought about creating two different Models with the
 different validation cases.
 But what about the funcitons I need for the models which I would pack
 in the model itselfs. So I would need to create the same functions in
 both models... Not really DRY...
 In app_model these functions would be available in all models, which i
 don't prefer...

 What would be a more elegant way to handle case by case validations ?

 Regards,
 Alexander





 



-- 
Matias Lespiau
http://www.gignus.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: How to update myprofile data in more than one table

2008-02-01 Thread Matias Lespiau
You will have to set $this-UserProfile-id before saving so cake knows
you're willing to update:



 ! Userprofile  Table code starts--

  $good=$this-UserProfile-findByUserId($this-
 data['User']['id']);
$note = $this-UserProfile-find($good['UserProfile']
 ['id']);

 I get the id of the userprofile table and did the same process what i
 did for the users table, but it will insert a data in a new row.it

wont update my data.


Now before saving set:
   if($note  0){
*   $this-UserProfile-id = $good['UserProfile']['id'];*

$this-UserProfile-save($this-data);
$this-Session-setFlash($good['UserProfile']['id']);
$this-redirect('/users/account_settings');
}else{
$this-Session-setFlash('Please check');
$this-redirect('/users/account_settings');
}

! Userprofile  Table code ends-


Hope that works, good luck!
-- 
Matias Lespiau
http://www.gignus.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: WYSIWYG + source code formatting

2008-01-31 Thread Matias Lespiau
I've written a simple code highlighter helper,
http://www.gignus.com/blog/posts/view/11 that uses GeSHi.

Maybe you can make use of it to highlight your code.

You would have to create a new button in tinyMCE that wraps your code in
pre class=code php/pre or pre class=code javascript/pre or
whatever language (supported by GeSHi) that you want to highlight and then
parse all the text with this helper.

-- 
Matias Lespiau
http://www.gignus.com/



On Jan 31, 2008 9:31 AM, grigri [EMAIL PROTECTED] wrote:


 Markdown does indeed preserve indentation, because code blocks are
 wrapped in pre tags. Syntax hilighting is another matter...

 I used to really like Markdown, because it's very readable.
 Unfortunately, (I feel) this comes at a price: loss of flexibility.
 While
 adding support to a bbCode parsing engine for '[php]...[/php]' tags is
 easy, adding stuff to markdown is difficult. I find it particularly
 annoying that there's no way to specify css classes for elements, for
 example.

 I've heard people rave about Flay, though I've never used it myself.
 WikiCode looks horribly complicated, but I'm sure it isn't really.

 For an example of one way of handling code snippets in articles,
 download the code for the bakery. It's far from perfect, but it has
 its good points!

 On Jan 31, 12:12 pm, dr. Hannibal Lecter [EMAIL PROTECTED]
 wrote:
  Hi grigri,
 
  actually, that might halp me :-)
 
  I must agree with you on WYSIWYG, they mostly turn out to be
  disappointments. WYMeditor seems promising, but it is still unusable
  in real life.
 
  Markup format is indeed a very good suggestion, very tempting. But I'm
  not sure if that will solve my problems. How will Markdown handle the
  code snippets exactly? How to preserve indentation etc.. is it a built
  in feature or do I need to hack it?
 
  Thanks for a prompt reply!
 
   If the users on your website that use the article submission are
   expected to add code snippets, it's probably a given that they are
   coders of some form or another, so getting them to use some markup
   format shouldn't be too hard. bbCode, Flay, Markdown, WikiCode, ...
   there's a lot out there, and they all work fine.
 
   If you deem this as too old-school then write an ajax-based auto-
   preview or something like that. There's always room for more 2.0
 
   Like I said, this probably won't help you if you're determined to use
   wysiwyg, but it's my £0.0100332
 


--~--~-~--~~~---~--~~
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: WYSIWYG + source code formatting

2008-01-31 Thread Matias Lespiau
It seems great!

If I only knew it before


On Jan 31, 2008 11:40 AM, Ron Chaplin [EMAIL PROTECTED] wrote:

  Hey all,
 A Nice solution I found for my blog was to use FCKeditor with a plugin
 called GeSHiPro.
 All the GeSHi features in a Wysiwyg Editor. What more can you ask for? I
 know, FCK Editor is a bit bloated, but for blog posting it's great imho

 GeshiPro -- http://www.shaunfreeman.co.uk/index.php?page=6
 Just My 2 cents

 Ron Chaplin
 t73-softdesign.com
 mentalramblings.info


 On Thu, 2008-01-31 at 06:13 -0800, dr. Hannibal Lecter wrote:

 Well, if Markdown keeps the formatting, then it would be a piece ofCake (pun 
 intended) to implement highlighting withdp.SyntaxHighlighter ..probably.. ..I 
 hope.. :-)
 Btw, how do I go about downloading the Bakery code? I'm unable to doan 
 export, it seems like the SVN repo is for devs only.. :-/



 



-- 
Matias Lespiau
http://www.gignus.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: Controller confusion

2008-01-31 Thread Matias Lespiau
I think your problem is that you're asking cake to just bring you the id's:

array('fields' =array('Manager.id http://manager.id/', 'Manager.user_id')

should be:

array('fields' =array('Manager.id http://manager.id/', 'Manager.user_id',
'User.realname')

On Jan 31, 2008 8:09 PM, judouk [EMAIL PROTECTED] wrote:


 Hi list

 Once again, I find myself stuck.

 I have three tables - users - managers - projects.
 The users table has fields defined for users real name (user.realname)
 and an id (user.id),
 the managers table has fields defined for the user id
 (manager.user_id) and
 a projects table which has fields defined for project id (project.id)
 and managers id (project.manager_id).

 These arent the only fields but it makes it a little easier.

 I've defined my models to associate the three tables

 // models/manager.php
 ?php
 class Manager extends AppModel
 {
  var $name = 'Manager';
  var $hasone = array('User' =
array(
  'className' = 'User',
  'conditions' = '',
  'order' = '',
  'dependent' = true,
  'foreignKey' = 'user_id'
)
  );
 }
 ?

 and

 // models/project.php
 ?php
 class Project extends AppModel
 {
  var $name = 'Project';
  var $useTable = 'projects';

  var $belongsTo = array(
'Manager' = array('className' = 'Manager',
  'foreignKey' = 'manager_id',
  'conditions' = '',
  'fields' = '',
  'order' = ''
);
 }
 ?


 What I want to be able to do is in my projects view is to see the
 fullname of the manager.
 I can get the managers user ID by adding the following within my
 projects controller...

  $l = $this-Job-Manager-find('all', array('fields' =
 array('Manager.id', 'Manager.user_id')));
  $result = Set::combine($l, {n}.Manager.id,
 {n}.Manager.user_id);
  $this-set('managers', $result);

 and in my projects view, I can use $managers to create a select list.

 What I cant seem to work out is how to see the managers fullname
 instead of his/her userid.
 I believe this is because its not inside my projects model but I'm
 really not sure.


 I hope that is enough information.
 Any help would be gratefully received.
 Thanks
 JudoUK


 



-- 
Matias Lespiau
http://www.gignus.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: Controller confusion

2008-01-31 Thread Matias Lespiau
I think case matters and you have a typo when setting the asociation (you
wrote $hasone and it's $hasOne ).
Also try setting the recursion level to something  0 before calling find:

$this-Job-Manager-recursive = 1;
 $l = $this-Job-Manager-find('all', array('fields' =
array('Manager.id http://manager.id/', 'Manager.user_id', 'User.first_name
',
'User.surname')));
 $result = Set::combine($l, {n}.Manager.id,
{n}.Manager.user_id);
 $this-set('managers', $result);

Good luck, I hope that works!


On Jan 31, 2008 10:14 PM, judouk [EMAIL PROTECTED] wrote:



 On 31 Jan, 23:49, Matias Lespiau [EMAIL PROTECTED] wrote:
  I think your problem is that you're asking cake to just bring you the
 id's:
 

 Thanks

 I've tried that

 I now have

  $l = $this-Job-Manager-find('all', array('fields' =
 array('Manager.id', 'Manager.user_id', 'User.first_name',
 'User.surname')));
  $result = Set::combine($l, {n}.Manager.id,
 {n}.Manager.user_id);
  $this-set('managers', $result);


 but now I get the error;

 Query: SELECT `Manager`.`id`, `Manager`.`user_id`,
 `User`.`first_name`, `User`.`surname` FROM `managers` AS `Manager`
 WHERE 1 = 1
 Warning (512): SQL Error: 1109: Unknown table 'User' in field list
 [CORE/cake/libs/model/datasources/dbo_source.php, line 440]

 I suspect this is because the two tables aren't linked in that way.
 Not sureits getting late at night so may not be thinking about
 this the right way either! (which probably isnt helping)

 J
 



-- 
Matias Lespiau
http://www.gignus.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: Help me with Associations

2008-01-30 Thread Matias Lespiau
Also be sure to set recursive  0 before calling find().

$this-TasksList-recursive = 1;
$this-TasksList-findAll();

On Jan 30, 2008 10:28 AM, grigri [EMAIL PROTECTED] wrote:


 Shouldn't your first association be:

 var $belongsTo = array(
'TasksPriority' = array(
'className' =
 'TasksPriority',
'foreignKey' =
 'tasks_priorities_id'
)
);

 ? Double-check all your database keys and make sure they are properly
 referenced in the associations array.

 If you have more trouble with this, paste both your SQL dump (the
 relevant bits) and your database schema here.

 Also, $uses() does absolutely nothing in a model. It's a controller
 variable.

 On Jan 30, 12:18 pm, manish [EMAIL PROTECTED] wrote:
  I have defined association between Two of my models:
 
  /app/models/TasksList.php
  ?php
  class TasksList extends AppModel {
  var $useTable = 'tasks_lists';
  var $uses=array('TasksPriority','TasksList');
  var $belongsTo = array(
  'TasksPriority' = array(
  'className' = 'TasksPriority',
  'foreignKey' = 'id'
  )
  );}
 
  ?
 
  /app/models/TasksPriority.php
  ?php
  class TasksPriority extends AppModel {
  var $uses=array('TasksPriority','TasksList');
  var $useTable = 'tasks_priorities';
  var $hasMany = array(
  'TasksList' = array(
  'className'= 'TasksList',
  'foreignKey'= 'tasks_priorities_id'
  )
  );}
 
  ?
 
  In my controller I use following to display the result:
 
  $taskslist = $this-TasksList-findAll();
  pr($taskslist);
 
  The array here only prints the data from TasksList and not the
  associated data. I don't know any way I could use to find where I am
  wrong.
 
  I will really appreciate any idea!
 



-- 
Matias Lespiau
http://www.gignus.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: how to update a profile in cakephp

2008-01-30 Thread Matias Lespiau
I think you will have to set your model's id  manually like this:

function edit($id){
   if (empty($this-data)) {
   $this-product-id = $id;
   $this-data = $this-product-read();
   }else{
   $this-product-id = $this-data['product']['id'];
   if($this-product-save($this-data['product'])){

$this-Session-setFlash('Updated Sucessfully');
$this-redirect('/product/account_settings');

}else{
$this-Session-setFlash('Please correct the
 errors');
}
}

  }


That should fix it.

Cheers,

-- 
Matias Lespiau
http://www.gignus.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: Error testing my View Helper with SimpleTest -- class not found

2008-01-29 Thread Matias Lespiau
Sorry I made a mistake, the correct syntax is App::import('Helper', 'Xslt');


That should work.

What's going on here is that Cake hasn't loaded your helper class so you
can't instanciate it.



On 1/28/08, Wayne Fay [EMAIL PROTECTED] wrote:


 That doesn't seem to change anything for me, for whatever reason. I
 don't suppose you have a sample project or something that I could
 download and try?

 Wayne

 On 1/28/08, Matias Lespiau [EMAIL PROTECTED] wrote:
  Before the XsltHelperTest class call App::import('Helper',
 'XsltHelper');
 
  Good luck and happy testing!
 
  --
  Matias Lespiau
  http://www.gignus.com/
 
 
  On Jan 28, 2008 4:46 PM, Wayne Fay [EMAIL PROTECTED] wrote:
  
   So I've created my own View helper (it just dispatches to the XSL
   module), and now I want to test it with SimpleTest etc.
  
   My class is named XsltHelper and has a function docToDoc:
   class XsltHelper extends AppHelper {
  function docToDoc($xml, $xsl) {
  $xslt = new xsltProcessor();
  $xslt-importStyleSheet($xsl);
  $result = $xslt-transformToDoc($xml);
  $xslt = null;
  return $result;
  }
   }
  
   Everything works fine in my views, I've tested it there already.
  
   Now I want to get this helper under test, so I've created a
   xslt.test.php under tests/cases/helpers and it looks like:
  
   class XsltHelperTest extends UnitTestCase {
  var $in = '?xml version=1.0?fooHello XSL/foo';
  var $xsl = '?xml version=1.0? xsl:stylesheet
   xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
   version=1.0xsl:template match=foobarxsl:value-of
   select=.//bar/xsl:template/xsl:stylesheet';
  var $out = '?xml version=1.0 encoding=UTF-8?barHello
  XSL/bar';
  //var $helpers = array('Xslt');
  
  function setUp() {
  $this-Xslt = new XsltHelper();
  }
  
  function testDocToDoc() {
  $res = $this-Xslt-docToDoc($in, $xsl1);
  $this-assertEqual($out1, $res);
  }
  
  function tearDown() {
  unset($this-Xslt);
  }
   }
  
   But I'm getting this error:
   Individual test case: helpers\xslt.test.php
  
   Fatal error: Class 'XsltHelper' not found in
  
  C:\dev\cake\cake_1.2.0.6311-beta\app\tests\cases\helpers\xslt.test.php
   on line 24
  
   Anyone know what I'm doing wrong? I can find very little documentation
   online regarding testing your own Helpers. I tried adding the var
   $helpers line but it didn't do anything for me, so I commented it out.
  
   Thanks!
   Wayne
  
  
 
 
 
  
 

 



-- 
Matias Lespiau
http://www.gignus.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: Extending Email Component

2008-01-29 Thread Matias Lespiau
I would do something like this:

custom_email_component.php in my controllers/components

App::import('Component', 'Email');

class CustomEmailComponent extends EmailComponent {


   function __db() {
  // your code
   }
}

By setting $this-delivery to 'db' you method would be called instead of the
others.

Is that what you need?

This way you can extend the component while keeping the core clean.

Cheers,

-- 
Matias Lespiau
http://www.gignus.com/



On Jan 29, 2008 2:49 PM, Jeraimee [EMAIL PROTECTED] wrote:


 In our project when we need to send email we actually input it into a
 database queue to be sent later via cron (a cake console app). We want
 to keep the functionality of the email component but need to add a
 __db (or whatever you would like to call it) method so we can choose
 between 'mail', 'smtp' and 'db' (or whatever).

 My first plan was to patch email.php so it would first see if $this-
 delivery was defined, if not check parent:: however this can't be
 done (AFAIK) due so the way components are instantiated.

 Does anyone have any suggestions that don't involve me copying
 email.php into my components directory and potentially going out of
 sync with cake?

 


--~--~-~--~~~---~--~~
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: Global View Variable?

2008-01-29 Thread Matias Lespiau
I think you should be able set it in the AppController, something like:

class AppController {

 function beforeFilter() {
   $this-set('roles', array('', 'Administrator', 'Supervisor',
'Moderator', 'Testing Team', ''));
 }

}

What are you trying to achieve? Maybe that would give us more ideas.

Cheers,

-- 
Matias Lespiau
http://www.gignus.com/

On Jan 29, 2008 3:42 PM, Siebren Bakker [EMAIL PROTECTED] wrote:

 I have an array of Strings, that I use in a couple of different places
 throughout my cake-app, in a couple different models, and was wondering if
 there was any way to declare the array such that it would be accessible from
 within any view, instead of having to declare the array for each view that
 uses it?

 i.e., the array('', 'Administrator', 'Supervisor', 'Moderator', 'Testing
 Team', '');


 --
 In the name of Life, Liberty, and the pursuit of my sanity.
 Siebren Bakker(Aevum Decessus)
 -BEGIN GEEK CODE BLOCK-
 Version: 3.12
 GCS d- s+: a19 C UL++ P L++
 !E W++ N(-) o? K? w(+) O? M-- V?
 PS+ PE Y- PGP- t+ 5? X- R tv--
 b++ Di D+ G+ e h! r y-
 --END GEEK CODE BLOCK--
 


--~--~-~--~~~---~--~~
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: Extending Email Component

2008-01-29 Thread Matias Lespiau
Haven't tested it, but in the send function of the EmailComponent I see this
code:

function send()
// lot of code
$__method = '__'.$this-delivery;
return $this-$__method();
}

So I think it should call the db method.

Good luck

-- 
Matias Lespiau
http://www.gignus.com/

On Jan 29, 2008 3:52 PM, Jeraimee [EMAIL PROTECTED] wrote:


 On Jan 29, 12:09 pm, Matias Lespiau [EMAIL PROTECTED] wrote:
  I would do something like this:
  custom_email_component.php in my controllers/components
  App::import('Component', 'Email');
  class CustomEmailComponent extends EmailComponent {
 function __db() {
// your code
 }
  }
  By setting $this-delivery to 'db' you method would be called instead of
 the
  others.

 That was what I was going to do first however I didn't even try it
 after realizing EmailComponent wouldn't call the __db method
 (parent::__db()) due to it's construction.

 I may be wrong in this assumption and I'll do a test after I finish my
 pizza to verify.
 


--~--~-~--~~~---~--~~
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: Yet another Auth and ACL question

2008-01-29 Thread Matias Lespiau
Maybe the Auth $loginAction property is what you're looking for. Set the url
of the controller that handles login (As a string or array).

Cheers,

-- 
Matias Lespiau
http://www.gignus.com/



On Jan 29, 2008 4:10 PM, Braindead [EMAIL PROTECTED] wrote:


 Hello group,

 I'm using Auth and ACL in Cake 1.2. It took quite a long time to get
 it to work, but now everything is working, except one thing:

 When I'm logged in and try to access a controller I don't have access
 to, I'm redirected to the url I came from and get the message that I'm
 not allowed to access the controller. I would expect to be redirected
 to the login page and see the error message.

 Is there a way to achieve this or is this a normal Cake behavior?

 Happy baking
 Markus


 


--~--~-~--~~~---~--~~
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: Making RSS feeds with CakePHP

2008-01-28 Thread Matias Lespiau
Zoe,

If you are following the example given by Nate, I think your problem might
be that you're trying to access the helpers inside the callback function,
and they are out of the scope there.

You should truncate the data before passing it to the RSS function or see
how to pass the helper as a parameter to the function.



-- 
Matias Lespiau
http://www.gignus.com/


On Jan 28, 2008 8:45 AM, MonkeyGirl [EMAIL PROTECTED] wrote:


 Thanks for the links everyone! To answer my own first question, then:

  1. How can I tell if someone's requesting the RSS version of a page or
  the regular HTML version? At the moment, I've got this in my
  controller:
 
if ($this-RequestHandler-__renderType == 'rss')

 I've replaced that with this, which seems right:

 if ($this-RequestHandler-isRss())

 But I'm still not sure how to fix this:

  2. The RSS feed doesn't know about all the helpers I specify in my
  app_controller.php file. How can I tell it about them?

 I'm trying to truncate the content of each item in the RSS feeds,
 which uses the Text helper. It looks like the Rss helper is
 automatically overriding that, and I'm not sure how to include it back
 in again.

 I looked at all the helper related information in all the links you
 provided, but the only helper specific line I could find was about
 $rss-items, pertaining to the RSS helper itself.

 I'm sure I'm just missing one very simple thing at this point but if
 anyone could just directly tell me what it is, it'd really help me
 out!

 Thanks again,
 Zoe.
 


--~--~-~--~~~---~--~~
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: Making RSS feeds with CakePHP

2008-01-28 Thread Matias Lespiau

 You're exactly right, thank you *very* much!


You're welcome =).

-- 
Matias Lespiau
http://www.gignus.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: best practices: dev and production environments

2008-01-28 Thread Matias Lespiau
Hi


 Question: How do you do your testing?

 I should be doing unit testing but I haven't had time to read more
 about how to do it in CakePHP. So I have been testing by simply trying
 (clicking) different features on the website. I know ideally unit
 testing should be part of the development cycle but at this point my
 app has grown so much that I am not sure what the best approach is.
 The problem is that when testing manually I often miss something and a
 bug gets released. Any suggestions?


You could use simpletest web testing capabilities. And create an integration
test. I've written my approach in my blog
http://www.gignus.com/blog/posts/view/13.


 5. Both my production and dev environment point to the same database.
 The advantage is when a new field or table is added due to a new
 feature, the changes done automatically but I often fear I shouldn't
 be touching the production environment until the changes are done.


I wouldn't recommend that, because you must be careful to introduce database
changes that might break production application. Also, for testing purposes,
it's better to start with a clean database on each test.


 Question: how do you manage and deploy DB changes?


I hadn't solved this on linux yet, but if you work with some mysql program
like mysqlfront on win, you can check the logs and save every alteration to
you database, save them to a text file, and run them on production.

Good luck!

-- 
Matias Lespiau
http://www.gignus.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: best practices: dev and production environments

2008-01-28 Thread Matias Lespiau

 There's also DBDesigner4 (from fabFORCE.net) that allows you to visually
 design your (MySQL) database and saves the model as a XML file (which you
 could commit to SVN). From memory, you can just ask it to connect to a
 different DB and it tells you what it would have to change on it (and apply
 changes to it if you wish).


Thanks for the tip, I'll try it out.

-- 
Matias Lespiau
http://www.gignus.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: Error testing my View Helper with SimpleTest -- class not found

2008-01-28 Thread Matias Lespiau
Before the XsltHelperTest class call App::import('Helper', 'XsltHelper');

Good luck and happy testing!

-- 
Matias Lespiau
http://www.gignus.com/

On Jan 28, 2008 4:46 PM, Wayne Fay [EMAIL PROTECTED] wrote:


 So I've created my own View helper (it just dispatches to the XSL
 module), and now I want to test it with SimpleTest etc.

 My class is named XsltHelper and has a function docToDoc:
 class XsltHelper extends AppHelper {
function docToDoc($xml, $xsl) {
$xslt = new xsltProcessor();
$xslt-importStyleSheet($xsl);
$result = $xslt-transformToDoc($xml);
$xslt = null;
return $result;
}
 }

 Everything works fine in my views, I've tested it there already.

 Now I want to get this helper under test, so I've created a
 xslt.test.php under tests/cases/helpers and it looks like:

 class XsltHelperTest extends UnitTestCase {
var $in = '?xml version=1.0?fooHello XSL/foo';
var $xsl = '?xml version=1.0? xsl:stylesheet
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 version=1.0xsl:template match=foobarxsl:value-of
 select=.//bar/xsl:template/xsl:stylesheet';
var $out = '?xml version=1.0 encoding=UTF-8?barHello
 XSL/bar';
//var $helpers = array('Xslt');

function setUp() {
$this-Xslt = new XsltHelper();
}

function testDocToDoc() {
$res = $this-Xslt-docToDoc($in, $xsl1);
$this-assertEqual($out1, $res);
}

function tearDown() {
unset($this-Xslt);
}
 }

 But I'm getting this error:
 Individual test case: helpers\xslt.test.php

 Fatal error: Class 'XsltHelper' not found in
 C:\dev\cake\cake_1.2.0.6311-beta\app\tests\cases\helpers\xslt.test.php
 on line 24

 Anyone know what I'm doing wrong? I can find very little documentation
 online regarding testing your own Helpers. I tried adding the var
 $helpers line but it didn't do anything for me, so I commented it out.

 Thanks!
 Wayne

 


--~--~-~--~~~---~--~~
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: upload photo and files

2008-01-22 Thread Matias Lespiau
Hi,

Have you check your permissions on the upload directory? Does the server
show any error when uploading?
If you can provide us more information we might be able to help.

Good luck,

On Jan 22, 2008 3:05 AM, Nil [EMAIL PROTECTED] wrote:


 Hi
  I m trying to upload the photo. I used the code from
 http://labs.iamkoa.net/2007/10/23/image-upload-component-cakephp/
 this site.
 But my application is work fine on local machine but it is not working
 on server.

 Can you please help me.

 Thanks.

 



-- 
Matias Lespiau
http://www.gignus.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
-~--~~~~--~~--~--~---