Re: How can I get the xml encoding using Xml class?

2009-01-26 Thread Martin Westin

Thanks RoVo,
I was on that path but stopped when my personal needs ended with the
knowledge that all text is converted on parsing.
But if I want to read an xml file and then save it back out again I
would definitely like to k ow the encoding so that the saved file
would have the same encoding as the original.

/Martin


On Jan 22, 10:22 pm, RoVo rol...@service-itzehoe.de wrote:
 Hi Martin,

 you are right! Better to search for the '', not for \n

 My imaginable solution may be like this way - put the attributes to an
 array...

 $this-__header = trim( str_replace( a( ''.'?', '?'.'' ), a('', ''),
 substr(trim($this-__rawData), 0, strpos(trim($this-__rawData),
 '?'.'') )));
 /**
  *  find the attributes and attributes2array
  */
 preg_match_all(/\ (.*)\=\(.*)\/iU, $this-__header, $attrib_arr,
 PREG_SET_ORDER);
 $this-__header_attributes = array();
 foreach ($attrib_arr as $found) {
     if ( (isset($found[1])) AND (isset($found[2])) ) {
         $this-__header_attributes[($found[1])] = $found[2];
     }}

 ...
 debug( $this-__header_attributes );
 ...

 result of $this-__header after your modified str_replace:
 xml version=1.0 encoding=UTF-8

 result: preg_match_all
 Array
 (
     [0] = Array
         (
             [0] =  version=1.0
             [1] = version
             [2] = 1.0
         )

     [1] = Array
         (
             [0] =  encoding=UTF-8
             [1] = encoding
             [2] = UTF-8
         )
 )

 result: $this-__header_attributes
 Array
 (
     [version] = 1.0
     [encoding] = UTF-8
 )

 RoVo (c:
--~--~-~--~~~---~--~~
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: Having trouble with FormHelper radio method

2009-01-26 Thread Martin Westin

Hi Seth,

Check ut this section in the cookbook. I think your problem is that
you specify each radio individually using $form-radio. You might try
$form-input('Field',array('type'='radio','options'=$your_data)) as
it seems to be the promoted way to make a radio group.

http://book.cakephp.org/view/189/Automagic-Form-Elements#options-options-192




On Jan 25, 9:11 pm, seedifferently seedifferen...@gmail.com wrote:
 I am still experiencing this issue in 1.2.1.8004.

 Anyone?

 Seth
--~--~-~--~~~---~--~~
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: Are we using the slowest PHP framework there is?

2009-01-26 Thread ProFire

In my opinion,

Performance is no longer the biggest issue in programming.
Server cost no longer outweigh development cost.
Most companies don't have a huge budget to start a new project.

What my company does is, develop a full-fledge programme first.
Make the money!
If the project fails, FINE! But if it succeeds, move on!

Identify the bottlenecks areas.
Hire Python developers to switch the bottleneck areas from CakePHP to
Python, the fastest programming language in the world.
We won't even bother switching to a faster framework. We just go
straight to the fastest language and start from there.

And there we have, best of both worlds.
--~--~-~--~~~---~--~~
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: change label/input generated code

2009-01-26 Thread Miles J

Perhaps place the $form-input within as an argument for $form-label
and have it not escape?
--~--~-~--~~~---~--~~
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: Are we using the slowest PHP framework there is?

2009-01-26 Thread Martin Westin


Alongside questions about HABTM relationships this is one topic that
never dies. :)

I have said this before. I have no real-life problems with the speed
of CakePHP. I don't know all the other frameworks so there is no way
for me to offer a comparative opinion. But I have applications running
with several million rows per table by now and Cake keeps going like
it is no big thing. I do believe that Cake may have a disadvantage in
the mini-app benchmark but that that turns to an advantage when you
run into a lot of data and general complexity later on.

0.1 or 0.2 sec for a small application is a lot less helpful than 0.6
or 60 sec when you pile on the data.

Also the benchmarks measure heavy traffic. That is less important for
an Application framework than it is for a CMS. That type of benchmark
can never really measure the efficiency of the ORM or any other
internal part of Cake.

CakePHP (and Yii?) is primarily designed to build applications, not
websites. You don't build something like CakePHP to handle the index-
page of cakephp.org. You build it to handle the bakery and the
cookbook and other more complex applications.

That said, If I was a fan of Yii I would also publish all the
benchmarks I could since they showed my framework in a good light.
Problem is... who wants to port the bakery to Yii and codeigniter to
do a benchmark? :)

/Martin


On Jan 26, 9:54 am, ProFire profir...@hotmail.com wrote:
 In my opinion,

 Performance is no longer the biggest issue in programming.
 Server cost no longer outweigh development cost.
 Most companies don't have a huge budget to start a new project.

 What my company does is, develop a full-fledge programme first.
 Make the money!
 If the project fails, FINE! But if it succeeds, move on!

 Identify the bottlenecks areas.
 Hire Python developers to switch the bottleneck areas from CakePHP to
 Python, the fastest programming language in the world.
 We won't even bother switching to a faster framework. We just go
 straight to the fastest language and start from there.

 And there we have, best of both worlds.
--~--~-~--~~~---~--~~
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: Custom data source

2009-01-26 Thread Martin Westin


I would probably not go all the way back to a data source. At least
not at first. I would create a special Model that talked to the web
service. The reason is that I don't really think you will end up
supporting a majority of the data source features so it may be more
work than you want. How would you deal with find queries at the dso
level? Does the api support anything like a query? Will you have any
kind of write-access (save, delete...)? The more of these questions
you can answer yes to the more sense it would make to create a dso.


On Jan 25, 9:39 pm, Josip Dzolonga jdzolo...@gmail.com wrote:
 Hello everyone,

 So I'm designing a web site that has a very specific architecture.
 _Some_ of the data is handled by a Java RESTful web service (there is
 a database as well). There are actually two things stored which I
 would like to have as models:

 1) Users
 2) Documents

 However, there are permissions as well (which I don' t have to
 handle), meaning that not all users have access to all documents. The
 authentication is done with http basic auth, so if a user wants to
 access document XYZ, he performs a get on /documents/XYZ with his user
 and password. So, when a user logs in to the web site, the application
 will have to store the username and password in the session and then
 make requests in the background to the web service with them to access
 documents. What is the best way to implement this using CakePHP? I
 thought of designing a custom data source which will be given the
 username and password once the user logs in. Is this a good approach
 and can you please give any advises on this?

 Thank you in advance,
 Josip
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How to deploy cakephp app on production server?

2009-01-26 Thread Hipnotik

Hi
Could you give me some instructions how to deploy cakephp application
on production server?
I know I have to disable debugging and enable cache engine... but what
else?
Maybe some performance tips?
Is it any way to disable 'describe' command?

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



Re: Performing a Query using a curdate as condition, help asap?

2009-01-26 Thread Martin Westin

There are lots of goodies you can use (for MySQL at least).

Datediff is my preferred comparison since it does not fail on leap-
years and things like that.
DATEDIFF(date1,date2)  0
- true or false

To construct modified versions of today I sometimes use Addate adn
Subdate
ADDDATE(CURDATE(), INTERVAL 4 HOUR)
- 2009-01-26 04:00:00


/Martin



On Jan 26, 12:53 am, Parris presid...@parrisstudios.com wrote:
 Hi Everyone,
 I am just trying to perform a simple query using cakephp. In the
 conditions array I am trying to filter by dates. The results should be
 all 'events' that will be today or greater (in other words, any date
 in the future).

 $this-Event-find('all',array( 'conditions' =array
 ('event_category_id'=$catId,'DATE(Event.event_date)'='getdate
 ()'),'order'=array('Event.event_date ASC','Event.event_time
 ASC') ) ) ;

 That is what i have so far. The first condition is just to filter by
 category. The part I need help with is 'DATE
 (Event.event_date)'='getdate()'). There are no errors. So i guess its
 kind of working. Also how can i adjust 'today' by 4 hours ?

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



Re: Performing a Query using a curdate as condition, help asap?

2009-01-26 Thread RoVo

Hi Parris,

 The results should be all 'events' that will be
 today or greater (in other words, any date
 in the future).
Try it like this:

'conditions'=array(
'Event.event_date = ' = date('Y-m-d')
)


Hope that helps
RoVo


--~--~-~--~~~---~--~~
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: How to deploy cakephp app on production server?

2009-01-26 Thread Martin Westin


The manual entry is short but that is all that is needed for a basic
setup.
Describe commands stop as soon as you go into debug 0.

General performance advice (Not things you do in your app. Things you
do in deployment):
Compiling php and the web server specifically if the added boost is
worth the extra work on updates.
Lookup information about improving the speed of your database server.
You will often gain some speed by using a php accelerator. They all
install a little differently and also require work on each update of
php.
Leaving the safety of Apache for Lighty of one of the other new kinds
can give further improved performance. But these need to be compared
and tested to make sure which is best for you and how much you
actually gain.

In your application I can only suggest that you find a way to really
overload your database with data to find bottlenecks in your code.
With only a few thousand rows in every table any problem areas should
be very obvious. Whenever I don't do this I always have to revisit
code a few weeks (or hours) later and optimize. It is noce to catch it
before going public.




On Jan 26, 10:38 am, Hipnotik pork...@gmail.com wrote:
 Hi
 Could you give me some instructions how to deploy cakephp application
 on production server?
 I know I have to disable debugging and enable cache engine... but what
 else?
 Maybe some performance tips?
 Is it any way to disable 'describe' command?

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



Re: How to deploy cakephp app on production server?

2009-01-26 Thread Hipnotik

Thanks for fast reply!
These informations are very helpful.

Piotr

On Jan 26, 10:53 am, Martin Westin martin.westin...@gmail.com wrote:
 The manual entry is short but that is all that is needed for a basic
 setup.
 Describe commands stop as soon as you go into debug 0.

 General performance advice (Not things you do in your app. Things you
 do in deployment):
 Compiling php and the web server specifically if the added boost is
 worth the extra work on updates.
 Lookup information about improving the speed of your database server.
 You will often gain some speed by using a php accelerator. They all
 install a little differently and also require work on each update of
 php.
 Leaving the safety of Apache for Lighty of one of the other new kinds
 can give further improved performance. But these need to be compared
 and tested to make sure which is best for you and how much you
 actually gain.

 In your application I can only suggest that you find a way to really
 overload your database with data to find bottlenecks in your code.
 With only a few thousand rows in every table any problem areas should
 be very obvious. Whenever I don't do this I always have to revisit
 code a few weeks (or hours) later and optimize. It is noce to catch it
 before going public.

 On Jan 26, 10:38 am, Hipnotik pork...@gmail.com wrote:



  Hi
  Could you give me some instructions how to deploy cakephp application
  on production server?
  I know I have to disable debugging and enable cache engine... but what
  else?
  Maybe some performance tips?
  Is it any way to disable 'describe' command?

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



Re: CakePHP In A Subdirectory?

2009-01-26 Thread RichardAtHome

You also need to delete the contents off the app/tmp directory. Leave
the file structure intact and just remove any files.

This is rapidly becoming my stock answer :-S

On Jan 26, 5:49 am, Paolo Stancato paolodo...@gmail.com wrote:
 Find .htaccess files (there are two)  and add RewriteBase /myapp
 into mod_rewrite section.

 Regards

 2009/1/26 inVINCable invinceable...@gmail.com:



  Hey all,

  Very simply question but cannot seem to find the answer. I have the
  directory structure and everything in tact in the normal way. However,
  on my server I put the entire structure in the /myapp folder in the
  document root.

  Now, everything is all mest up and there is no CSS and files are
  missing and such. Surely cake has a simple variable to reflect these
  changes? Any advice? I have already looked at the book and the bakery
  and have tried things but they have not worked, such as messing with
  the variables in the index.php file.

  I am using version 1.2

  Thank you for any advice/pointers.

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



Re: Performing a Query using a curdate as condition, help asap?

2009-01-26 Thread RichardAtHome

$this-Event-find('all',array(
'conditions' =array(
'event_category_id'=$catId,
'DATE(Event.event_date)  getdate()'
),
'order'=array('Event.event_date ASC',
'Event.event_time ASC'
)
) ) ;

On Jan 26, 9:38 am, Martin Westin martin.westin...@gmail.com wrote:
 There are lots of goodies you can use (for MySQL at least).

 Datediff is my preferred comparison since it does not fail on leap-
 years and things like that.
 DATEDIFF(date1,date2)  0
 - true or false

 To construct modified versions of today I sometimes use Addate adn
 Subdate
 ADDDATE(CURDATE(), INTERVAL 4 HOUR)
 - 2009-01-26 04:00:00

 /Martin

 On Jan 26, 12:53 am, Parris presid...@parrisstudios.com wrote:

  Hi Everyone,
  I am just trying to perform a simple query using cakephp. In the
  conditions array I am trying to filter by dates. The results should be
  all 'events' that will be today or greater (in other words, any date
  in the future).

  $this-Event-find('all',array( 'conditions' =array
  ('event_category_id'=$catId,'DATE(Event.event_date)'='getdate
  ()'),'order'=array('Event.event_date ASC','Event.event_time
  ASC') ) ) ;

  That is what i have so far. The first condition is just to filter by
  category. The part I need help with is 'DATE
  (Event.event_date)'='getdate()'). There are no errors. So i guess its
  kind of working. Also how can i adjust 'today' by 4 hours ?

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



Re: Calling $html-css() from inside an element

2009-01-26 Thread RichardAtHome

Syntax should be:

echo $html-css( 'right_column', array( 'media' = 'screen' ), null,
false );


On Jan 24, 6:45 pm, Gonzalo Servat gser...@gmail.com wrote:
 Hi All,

 I never had the need to do this, but I've come across a situation where it
 comes in handy. I'd like to add a stylesheet for inclusion in head/head
 from an element. This is because the element I'm including is called
 right_column.ctp and the CSS to-be-included modifies a few of the styles
 on the main page to accomodate for it. There are probably better ways of
 doing this, and I'd love to hear your suggestions and ways of doing this,
 but for the time being I'd like to find out why I can't include a stylesheet
 from an element. My code looks like this:

 $html-css( 'right_column', null, array( 'media' = 'screen' ), false );

 I started looking into cake/libs/view/view.php and it looks like the layout
 is rendered before the elements which explains why it doesn't work
 ($this-__scripts is empty at the time that the layout is being rendered).
 Anyone?

 Thanks!
 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Are we using the slowest PHP framework there is?

2009-01-26 Thread Dardo Sordi Bogado

 Problem is... who wants to port the bakery to Yii and codeigniter to
 do a benchmark? :)

Even those apps were ported to
Yii/CodeIgniter/WhateverFasterHelloWorldFramework and it proves to be
faster than Cake, I will still use Cake because it makes my code look
nice, reduces development time and increases developer (me) happiness.

regards,
- Dardo.

--~--~-~--~~~---~--~~
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: Are we using the slowest PHP framework there is?

2009-01-26 Thread Jon Bennett

 Even those apps were ported to
  Yii/CodeIgniter/WhateverFasterHelloWorldFramework and it proves to be
  faster than Cake, I will still use Cake because it makes my code look
  nice, reduces development time and increases developer (me) happiness.

on a current project of mine, a page with a lot of DB calls with
plenty of recursion, takes 0.187s to render, that's plenty quick
enough for me.

j

-- 

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

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



Re: Calling $html-css() from inside an element

2009-01-26 Thread Gonzalo Servat
On Mon, Jan 26, 2009 at 9:24 AM, RichardAtHome richardath...@gmail.comwrote:


 Syntax should be:

 echo $html-css( 'right_column', array( 'media' = 'screen' ), null,
 false );


Not if you're using the last parameter as false. It just adds it to an
array which later gets printed in the $scripts_for_layout section so there's
no need to print it out.

That wasn't the problem though. After speaking with AD7six, basically what
happens is that the head scripts section is already processed by the time it
gets to the elements in the layout so I can't use that array unless I want
to re-work the order in which things are processed in CakePHP (which would
surely break lots of other stuff). What I had to do was create a head helper
(AD7six's suggestion) which I would call to add CSS (from the element) and
later get the CSS (from the layout in the head section).

If anyone wants to see an example of how to include a custom CSS file from
an element, let me know and I'll do a quick blog on it.

- 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



unbind and bind Process..

2009-01-26 Thread Marcelo Iwata
I was having the same problem as this one:

http://groups.google.com/group/cake-php/browse_thread/thread/64c581784c5674cd/fe1ac5f63f84b94f?lnk=gstq=paginator+recursive+sort#fe1ac5f63f84b94f


I have a Library that belongs to a Membership, and a Membership that belongs
to a User and a Project.
So, i was looking for a answear ,and i  decided to force the bind Process.

So, my controller is like this:
...
var $paginate = array('limit' = 15, 'page' = 1, 'recursive'=2);
...
 function showLibraries(){
$this-set(CSS, main);
$this-Library-unbindModel(array('belongsTo' =
array('Membership'),),false);
$this-Library-Membership-unbindModel(array('belongsTo' =
array('User')),false);
$this-Library-Membership-unbindModel(array('belongsTo' =
array('Project')),false);
$this-Library-bindModel(array(array('belongsTo'=
array('Membership'=array(),'User'=array('foreignKey'=false,'conditions'=array('Membership.user_id=User.id'));
$this-set('libraries', $this-paginate('Library'));
}



But, this cannot be done, because the ctp's  variable
$library['Membership']['Project']['name'], cannot be found.
Any ideas?
Thanks in advance.

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



slightly OT: need an unusual find condition (or possible custom query)

2009-01-26 Thread Martin Westin

Hi,
I am in need of an unusual query that I find it hard to search for on
Google or MySQL.com since all the terms I think of are very common
ones. Hopefully someone reading this can guide me in the right
direction.

I have a series of values in an array. I can find out which records
have matching values by passing this array as a condition to get a
WHERE somefield IN (value1,value2) clause.

I can also find which records have non-matching fields by using a
WHERE NOT(...) clause. Finding the orphans in the database so to
speak.

Of-course I want something else. I want to find out which values in my
array do not match a record in the database. Finding the orphans in my
array so to speak. I have not figured out how to do this without using
the IN clause and then comparing the results. Since this is
expensive (looping arrays take time) I really wanted to find an SQL-
way that would be less expensive.

SELECT VALUES IN MY ARRAY THAT DO NOT FIND ANY MATCHING RECORD -
sort of.

Any guidance would be appreciated
/Martin
--~--~-~--~~~---~--~~
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: CakePHP In A Subdirectory?

2009-01-26 Thread inVINCable

Hey,

Ok, I found both of the .htacess files and added RewriteBase /myapp
so my .htacess file looks like:


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


I also deleted the cache (just the files) and now I am getting a 500
Internal Server Error. I have tried this both on my local machine and
a live server and the same thing happens. Anyone know what I might be
doing wrong?



On Jan 25, 9:49 pm, Paolo Stancato paolodo...@gmail.com wrote:
 Find .htaccess files (there are two)  and add RewriteBase /myapp
 into mod_rewrite section.

 Regards

 2009/1/26 inVINCable invinceable...@gmail.com:



  Hey all,

  Very simply question but cannot seem to find the answer. I have the
  directory structure and everything in tact in the normal way. However,
  on my server I put the entire structure in the /myapp folder in the
  document root.

  Now, everything is all mest up and there is no CSS and files are
  missing and such. Surely cake has a simple variable to reflect these
  changes? Any advice? I have already looked at the book and the bakery
  and have tried things but they have not worked, such as messing with
  the variables in the index.php file.

  I am using version 1.2

  Thank you for any advice/pointers.

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



how to generate views for recursive 2 associations?

2009-01-26 Thread die...@be

Hi, I'm try to bake views which also show associated items of the
associated items I'm showing.

The problem is, I can't find any variable in the bake template that
tells me anything about these 2nd level associations.
Eg after setting var $recursive = 2; in the model, or $this-Model-
recursive = 2; in the controller, I do get the data available in the
view, but i want these views be generated.

in the bake template (eg /templates/views/view.ctp ) when I print_r
($associations) I only see info about the first level associations.

Any ideas how to do this?
thanks,
Dieter
--~--~-~--~~~---~--~~
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: Closing $ajax-form()

2009-01-26 Thread Pyrite

So what is the point/usage of $ajax-submit() then if it does not
actually submit the form created with $ajax-form() ?

On Jan 23, 8:05 am, Mono sirmonit...@gmail.com wrote:
 When u use the ajax-form, the only difference with a normal form is
 the first line.

 Normal Form:

 $form-create (...)
   $form-input ()
   $form-input ()
 $form-end ('Send')

 Ajax Form:

 $ajax-form (...)
   $form-input ()
   $form-input ()
 $form-end ('Send')

 On 22 Jan., 22:47, Pyrite thelette...@gmail.com wrote:



  How do you put the close tag in a form created by $ajax-form() ?? Why
  is there not an $ajax-formEnd() similar to the FormHelper's $form-end
  () ?

  Also, when I create a form with $ajax-form(), and I add a submit with
  $ajax-submit(), it does not submit the form. A usage example would be
  great. I can only get it to submit the form if I use $form-end
  ('Submit') instead of $ajax-submit().- Hide quoted text -

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



Re: Closing $ajax-form()

2009-01-26 Thread Graham Weldon



$ajax-submit() creates an ajax submit element.
$form-end('something') creates a submit button, and ends the form.

$ajax-form() starts a form.
Your usage will depends very much on your implementation, and requirements.

The simple reason for there not being an $ajax-formEnd() is because its
super easy to do: $form-end().
Both output /form.

here are some options to illustrate usage:


$form-create();
  $form-inputs();
$form-end('submit');

$ajax-form();
  $form-inputs();
$form-end('submit');

$ajax-form();
  $form-inputs();
  $ajax-submit();
$form-end();



On Mon, 26 Jan 2009 05:55:02 -0800 (PST), Pyrite thelette...@gmail.com
wrote:
 So what is the point/usage of $ajax-submit() then if it does not
 actually submit the form created with $ajax-form() ?
 
 On Jan 23, 8:05 am, Mono sirmonit...@gmail.com wrote:
 When u use the ajax-form, the only difference with a normal form is
 the first line.

 Normal Form:

 $form-create (...)
   $form-input ()
   $form-input ()
 $form-end ('Send')

 Ajax Form:

 $ajax-form (...)
   $form-input ()
   $form-input ()
 $form-end ('Send')

 On 22 Jan., 22:47, Pyrite thelette...@gmail.com wrote:



  How do you put the close tag in a form created by $ajax-form() ?? Why
  is there not an $ajax-formEnd() similar to the FormHelper's
$form-end
  () ?

  Also, when I create a form with $ajax-form(), and I add a submit with
  $ajax-submit(), it does not submit the form. A usage example would be
  great. I can only get it to submit the form if I use $form-end
  ('Submit') instead of $ajax-submit().- Hide quoted text -

 - Show quoted text -
 

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



Re: CakePHP In A Subdirectory?

2009-01-26 Thread RoVo

Hi,

 ..I am getting a 500 Internal Server Error.
Is it me? I think it should look like this?!?

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

Hope that helps
RoVo
--~--~-~--~~~---~--~~
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: CakePHP In A Subdirectory?

2009-01-26 Thread RichardAtHome

Might be worth re-starting the (web) server. It fixed a 500 error I
was getting a while back. Been fine every since (even after uploading
source updates).

On Jan 26, 1:38 pm, inVINCable invinceable...@gmail.com wrote:
 Hey,

 Ok, I found both of the .htacess files and added RewriteBase /myapp
 so my .htacess file looks like:

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

 I also deleted the cache (just the files) and now I am getting a 500
 Internal Server Error. I have tried this both on my local machine and
 a live server and the same thing happens. Anyone know what I might be
 doing wrong?

 On Jan 25, 9:49 pm, Paolo Stancato paolodo...@gmail.com wrote:

  Find .htaccess files (there are two)  and add RewriteBase /myapp
  into mod_rewrite section.

  Regards

  2009/1/26 inVINCable invinceable...@gmail.com:

   Hey all,

   Very simply question but cannot seem to find the answer. I have the
   directory structure and everything in tact in the normal way. However,
   on my server I put the entire structure in the /myapp folder in the
   document root.

   Now, everything is all mest up and there is no CSS and files are
   missing and such. Surely cake has a simple variable to reflect these
   changes? Any advice? I have already looked at the book and the bakery
   and have tried things but they have not worked, such as messing with
   the variables in the index.php file.

   I am using version 1.2

   Thank you for any advice/pointers.

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



Re: Any one looking for a freelance work

2009-01-26 Thread Josey

I might be interested, let me know what the plans are.

On Jan 25, 2:55 am, Novice Programmer novice.prog...@gmail.com
wrote:
 Hello,

 Please get in touch with me if you are looking for a freelance work. I have
 a site based on cakephp and want to add a few features to it.

 --
 Thanks  Regards,
 Novice.
--~--~-~--~~~---~--~~
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: Calling $html-css() from inside an element

2009-01-26 Thread RichardAtHome

Sorry AD7six, just tried it in an element and the code IS injected
into the header:

view.ctp
?php echo $this-element(test) ?

elements\test.ctp
?php echo $html-css(test, array(), null, false) ?

I'm using the latest stable build of Cake



On Jan 26, 11:33 am, Gonzalo Servat gser...@gmail.com wrote:
 On Mon, Jan 26, 2009 at 9:24 AM, RichardAtHome richardath...@gmail.comwrote:



  Syntax should be:

  echo $html-css( 'right_column', array( 'media' = 'screen' ), null,
  false );

 Not if you're using the last parameter as false. It just adds it to an
 array which later gets printed in the $scripts_for_layout section so there's
 no need to print it out.

 That wasn't the problem though. After speaking with AD7six, basically what
 happens is that the head scripts section is already processed by the time it
 gets to the elements in the layout so I can't use that array unless I want
 to re-work the order in which things are processed in CakePHP (which would
 surely break lots of other stuff). What I had to do was create a head helper
 (AD7six's suggestion) which I would call to add CSS (from the element) and
 later get the CSS (from the layout in the head section).

 If anyone wants to see an example of how to include a custom CSS file from
 an element, let me know and I'll do a quick blog on it.

 - 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP In A Subdirectory?

2009-01-26 Thread inVINCable

Ok, going to go ahead and fix some things. I notice there a 3 .htacess
files included in a cake release. One in the top-level directory, one
in the /app folder, and one in app/webroot. Do I need to change all 3
of these?



On Jan 26, 6:09 am, RichardAtHome richardath...@gmail.com wrote:
 Might be worth re-starting the (web) server. It fixed a 500 error I
 was getting a while back. Been fine every since (even after uploading
 source updates).

 On Jan 26, 1:38 pm, inVINCable invinceable...@gmail.com wrote:

  Hey,

  Ok, I found both of the .htacess files and added RewriteBase /myapp
  so my .htacess file looks like:

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

  I also deleted the cache (just the files) and now I am getting a 500
  Internal Server Error. I have tried this both on my local machine and
  a live server and the same thing happens. Anyone know what I might be
  doing wrong?

  On Jan 25, 9:49 pm, Paolo Stancato paolodo...@gmail.com wrote:

   Find .htaccess files (there are two)  and add RewriteBase /myapp
   into mod_rewrite section.

   Regards

   2009/1/26 inVINCable invinceable...@gmail.com:

Hey all,

Very simply question but cannot seem to find the answer. I have the
directory structure and everything in tact in the normal way. However,
on my server I put the entire structure in the /myapp folder in the
document root.

Now, everything is all mest up and there is no CSS and files are
missing and such. Surely cake has a simple variable to reflect these
changes? Any advice? I have already looked at the book and the bakery
and have tried things but they have not worked, such as messing with
the variables in the index.php file.

I am using version 1.2

Thank you for any advice/pointers.

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



Re: CakePHP In A Subdirectory?

2009-01-26 Thread inVINCable

Ok, I notice there are 3 .htacess files included in a cake release.
One in the top-level directory, one in app and one in app/webroot, so
they should all look like this:

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

or just one of them?

On Jan 26, 6:09 am, RichardAtHome richardath...@gmail.com wrote:
 Might be worth re-starting the (web) server. It fixed a 500 error I
 was getting a while back. Been fine every since (even after uploading
 source updates).

 On Jan 26, 1:38 pm, inVINCable invinceable...@gmail.com wrote:

  Hey,

  Ok, I found both of the .htacess files and added RewriteBase /myapp
  so my .htacess file looks like:

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

  I also deleted the cache (just the files) and now I am getting a 500
  Internal Server Error. I have tried this both on my local machine and
  a live server and the same thing happens. Anyone know what I might be
  doing wrong?

  On Jan 25, 9:49 pm, Paolo Stancato paolodo...@gmail.com wrote:

   Find .htaccess files (there are two)  and add RewriteBase /myapp
   into mod_rewrite section.

   Regards

   2009/1/26 inVINCable invinceable...@gmail.com:

Hey all,

Very simply question but cannot seem to find the answer. I have the
directory structure and everything in tact in the normal way. However,
on my server I put the entire structure in the /myapp folder in the
document root.

Now, everything is all mest up and there is no CSS and files are
missing and such. Surely cake has a simple variable to reflect these
changes? Any advice? I have already looked at the book and the bakery
and have tried things but they have not worked, such as messing with
the variables in the index.php file.

I am using version 1.2

Thank you for any advice/pointers.

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



Re: CakePHP In A Subdirectory?

2009-01-26 Thread Chad Casselman
I have always got the desired results with only changing the top level one.

Chad



On Mon, Jan 26, 2009 at 9:21 AM, inVINCable invinceable...@gmail.comwrote:


 Ok, I notice there are 3 .htacess files included in a cake release.
 One in the top-level directory, one in app and one in app/webroot, so
 they should all look like this:

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

 or just one of them?

 On Jan 26, 6:09 am, RichardAtHome richardath...@gmail.com wrote:
  Might be worth re-starting the (web) server. It fixed a 500 error I
  was getting a while back. Been fine every since (even after uploading
  source updates).
 
  On Jan 26, 1:38 pm, inVINCable invinceable...@gmail.com wrote:
 
   Hey,
 
   Ok, I found both of the .htacess files and added RewriteBase /myapp
   so my .htacess file looks like:
 
   IfModule mod_rewrite.c
   RewriteEngine on
   RewriteBase /myapp
   RewriteRule^$webroot/[L]
   RewriteRule(.*) webroot/$1[L]
/IfModule
 
   I also deleted the cache (just the files) and now I am getting a 500
   Internal Server Error. I have tried this both on my local machine and
   a live server and the same thing happens. Anyone know what I might be
   doing wrong?
 
   On Jan 25, 9:49 pm, Paolo Stancato paolodo...@gmail.com wrote:
 
Find .htaccess files (there are two)  and add RewriteBase /myapp
into mod_rewrite section.
 
Regards
 
2009/1/26 inVINCable invinceable...@gmail.com:
 
 Hey all,
 
 Very simply question but cannot seem to find the answer. I have the
 directory structure and everything in tact in the normal way.
 However,
 on my server I put the entire structure in the /myapp folder in the
 document root.
 
 Now, everything is all mest up and there is no CSS and files are
 missing and such. Surely cake has a simple variable to reflect
 these
 changes? Any advice? I have already looked at the book and the
 bakery
 and have tried things but they have not worked, such as messing
 with
 the variables in the index.php file.
 
 I am using version 1.2
 
 Thank you for any advice/pointers.
 
 Regards
 


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



Re: CakePHP sessions

2009-01-26 Thread dchanco...@gmail.com



On Jan 23, 10:53 pm, brian bally.z...@gmail.com wrote:
 Did you look into how the different Security levels affect Cake
 sessions? I'm sure it's in the cookbook. Otherwise, there's always the
 google.

I played with the different setting but the behavior seems more random
than
anything else.

Anybody else has any insight?


 On Fri, Jan 23, 2009 at 10:51 PM, dchanco...@gmail.com

 dchanco...@gmail.com wrote:

  On Jan 23, 3:31 pm, brian bally.z...@gmail.com wrote:
  I believe the Security.level (in core.php) affects how soon Cake sessions 
  last.

  My 'Security.level' is set to 'low' and 'Session.timeout' to '1440'.
  Shouldn't my sessions last 5 days? They don't :-(

  On Fri, Jan 23, 2009 at 2:32 PM, dchanco...@gmail.com

  dchanco...@gmail.com wrote:

   Hi,

   Can someone explain me how sessions work in CakePHP once and for all?

   I'm using CakePHP 1.2.0.7296 RC2 and PHP 5.2.6

   I have the following setting in my core.php file:

   Configure::write('Session.save', 'cake'); // I tried both 'php' and
   'cake' with the same results
   //Configure::write('Session.table', 'cake_sessions');
   //Configure::write('Session.database', 'default');
   Configure::write('Session.cookie', 'CAKEPHP');
   Configure::write('Session.timeout', '1440');
   Configure::write('Session.start', true);
   Configure::write('Session.checkAgent', true);
   Configure::write('Security.level', 'low');

   And the following PHP settings:

   session.cache_expire          7200
   session.cookie_lifetime        0
   session.gc_maxlifetime        432000
   session.use_cookies            On
   session.use_only_cookies    Off

   My expectation is that my sessions should last 1400sec * 300 (for
   'low') or 5 days.
   Yet, without closing my browser, my sessions will become unavailable
   once or
   twice a day. I.e. code that checks for a valid username in the session
   gets
   nothing and 'logs me out'.

   I have had this behavior hapenning in a couple of CakePHP applications
   I
   developed. What am I missing?

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



Re: Calling $html-css() from inside an element

2009-01-26 Thread Gonzalo Servat
On Mon, Jan 26, 2009 at 12:17 PM, RichardAtHome richardath...@gmail.comwrote:


 Sorry AD7six, just tried it in an element and the code IS injected
 into the header:

 view.ctp
 ?php echo $this-element(test) ?

 elements\test.ctp
 ?php echo $html-css(test, array(), null, false) ?

 I'm using the latest stable build of Cake


Try it from a layout.

 - 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP In A Subdirectory?

2009-01-26 Thread leo

Are you sure mod_rewrite is enabled? check by creating a phpinfo file
and accessing it through your browser, then do a find rewrite.
If it is enabled, check in the httpd.conf file that allow_override for
that directory spec is 'all'.

I have only ever changed the top level .htaccess file.


--~--~-~--~~~---~--~~
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: CakePHP In A Subdirectory?

2009-01-26 Thread RoVo

Hi inVINCable,

I have tested my suggestion - see above.
This is the htaccess of the top-level. The others are untouched.

Hope that helps
RoVo
--~--~-~--~~~---~--~~
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: simple and complete file upload behaviour

2009-01-26 Thread Smelly_Eddie

Daniel Hofstetter has a great article on uploading files to a
database.

If the size of your files is limited(pdfs, docs, etc) this can be a
practical approach because managing them is quite easy.
http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/


I wrote a complementary article thaty outlines the MVC way to serve
the files back out, whether in-line or as dowloads.
http://edwardawebb.com/programming/php-programming/cakephp/serving-files-cakephp



On Jan 25, 4:59 am, fain182 fain...@gmail.com wrote:
 someone knows if there is a file upload behaviour, that manage adding,
 editing and deleting of files in a simple way?
 thank you
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Plugin's model methods is missing

2009-01-26 Thread jaro

Hi,

I have an application created last year using the rc2 release. When I
upgraded the core to the stable release, I had a few problems
accessing methods in my plugin's model.

I have an ShoppingCart.OrderProduct model. The OrderProduct model has
a function named was_purchased. It just basically checks if a
certain product was purchased by the given user. In my
AccountController, it is outside my plugin I called it this way

$this-OrderProduct-was_purchased($order_id, $user_id);

The above line gave me the following error:
Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax to use near 'was_purchased' at line 1 [CORE\cake\libs
\model\datasources\dbo_source.php, line 514]
Query: was_purchased

In the previous cake version, it works fine. We are actually using it
in our production. Any idea? I have checked it with google and the
docs but I am probably missing the help I need.

Cheers,
jaro
--~--~-~--~~~---~--~~
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: change label/input generated code

2009-01-26 Thread Matt Curry

Hey Marcelo,
You could just do something simply like:
labelMy label: ?php echo $form-input('MyModel.field', array
('label'= false)); ?/label

Or even better: Make your own helper that extends the Cake FormHelper
and has a method that does this.

-Matt
http://www.pseudocoder.com

On Jan 25, 11:59 am, Marcelo Andrade mfandr...@gmail.com wrote:
 Hi all,

 What's the better way to make the output of this

 echo $form-input('MyModel.field', array('label'= 'My label:'));

 generate labels surrounding the input element like
 this

 labelMy label: input type=text id=MyModelField //label

 instead of label for= version. ???

 Best regards.

 --
 MARCELO DE F. ANDRADE (aka eleKtron)
 Belem, PA, Amazonia, Brazil
 Linux User #221105

 [...@pará ~]# linkshttp://pa.slackwarebrasil.org/

 For Libby's backstory be told on 
 Losthttp://www.petitiononline.com/libby423/petition.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Plugin's model methods is missing

2009-01-26 Thread Martin Westin

Hi Jaro,

I am pretty sure you have missed the plugin name when targeting the
Model. I have had a number of hard to track bugs that were related
to the naming of classes in plugins.

If you do debug($this-OrderProduct) You should see OrderProduct
Object... but you will probably see ShoppingCartAppModel Object...
or something. If so, then you have some problem with targeting the
class correctly.


Check that it like this in your controller:
var $uses = array('ShoppingCart.OrderProduct');

Same thing for Model associations. For example:
var $belongsTo = array(
'SomeOtherModel',
'OrderProduct'=array(
'className' = 'ShoppingCart.OrderProduct',
'counterCache' = true
)
);

Notice how the plugin name needs to be present in the className value
but should not be there in the key for the association.



On Jan 26, 3:50 pm, jaro november.di...@gmail.com wrote:
 Hi,

 I have an application created last year using the rc2 release. When I
 upgraded the core to the stable release, I had a few problems
 accessing methods in my plugin's model.

 I have an ShoppingCart.OrderProduct model. The OrderProduct model has
 a function named was_purchased. It just basically checks if a
 certain product was purchased by the given user. In my
 AccountController, it is outside my plugin I called it this way

 $this-OrderProduct-was_purchased($order_id, $user_id);

 The above line gave me the following error:
 Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
 check the manual that corresponds to your MySQL server version for the
 right syntax to use near 'was_purchased' at line 1 [CORE\cake\libs
 \model\datasources\dbo_source.php, line 514]
 Query: was_purchased

 In the previous cake version, it works fine. We are actually using it
 in our production. Any idea? I have checked it with google and the
 docs but I am probably missing the help I need.

 Cheers,
 jaro
--~--~-~--~~~---~--~~
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: Plugin's model methods is missing

2009-01-26 Thread RoVo

Hi jaro,

 ..an application created last year using the rc2 release.
I have several plugins in use - no changes needed over the versions.

Please look, if you use things like this:
$this-execute(...);

better:
$this-query(...);

Hope that helps
RoVo
--~--~-~--~~~---~--~~
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: Plugin's model methods is missing

2009-01-26 Thread Martin Westin


Oh, and don't think that it is enough to only check the relevant
places. If you have a model loaded that has an error in the
association this can affect your controller's direct relation to
OrderProduct. This is due to the fact that cake keeps global
references to the Models and the one loaded first takes precedence. If
a bad version is called up first then anything after that makes no
diference.

So check every reference to that model while you are at it.

/martin

On Jan 26, 4:13 pm, Martin Westin martin.westin...@gmail.com wrote:
 Hi Jaro,

 I am pretty sure you have missed the plugin name when targeting the
 Model. I have had a number of hard to track bugs that were related
 to the naming of classes in plugins.

 If you do debug($this-OrderProduct) You should see OrderProduct
 Object... but you will probably see ShoppingCartAppModel Object...
 or something. If so, then you have some problem with targeting the
 class correctly.

 Check that it like this in your controller:
 var $uses = array('ShoppingCart.OrderProduct');

 Same thing for Model associations. For example:
 var $belongsTo = array(
     'SomeOtherModel',
     'OrderProduct'=array(
         'className' = 'ShoppingCart.OrderProduct',
         'counterCache' = true
     )
 );

 Notice how the plugin name needs to be present in the className value
 but should not be there in the key for the association.

 On Jan 26, 3:50 pm, jaro november.di...@gmail.com wrote:

  Hi,

  I have an application created last year using the rc2 release. When I
  upgraded the core to the stable release, I had a few problems
  accessing methods in my plugin's model.

  I have an ShoppingCart.OrderProduct model. The OrderProduct model has
  a function named was_purchased. It just basically checks if a
  certain product was purchased by the given user. In my
  AccountController, it is outside my plugin I called it this way

  $this-OrderProduct-was_purchased($order_id, $user_id);

  The above line gave me the following error:
  Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
  check the manual that corresponds to your MySQL server version for the
  right syntax to use near 'was_purchased' at line 1 [CORE\cake\libs
  \model\datasources\dbo_source.php, line 514]
  Query: was_purchased

  In the previous cake version, it works fine. We are actually using it
  in our production. Any idea? I have checked it with google and the
  docs but I am probably missing the help I need.

  Cheers,
  jaro
--~--~-~--~~~---~--~~
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: CakePHP sessions

2009-01-26 Thread Martin Westin


There are a two known things I remember reading about:
Ajax (or rapid-fire fingers) conflicting with high security levels.
Setting security to medium or lower should fix that.
There is also the possibility that your host does a bit of clean-up
in php's sessions dir. Using cake sessions should fix that... I think.

I had these random logouts and it turned out to be a problem with the
security level being to high (if you call that a problem). Displaying
a form and having some ajax on the page can make the temporary
security hash in the form become old and then you are logged out for
being a hacker. :)



On Jan 26, 3:25 pm, dchanco...@gmail.com dchanco...@gmail.com
wrote:
 On Jan 23, 10:53 pm, brian bally.z...@gmail.com wrote:

  Did you look into how the different Security levels affect Cake
  sessions? I'm sure it's in the cookbook. Otherwise, there's always the
  google.

 I played with the different setting but the behavior seems more random
 than
 anything else.

 Anybody else has any insight?

  On Fri, Jan 23, 2009 at 10:51 PM, dchanco...@gmail.com

  dchanco...@gmail.com wrote:

   On Jan 23, 3:31 pm, brian bally.z...@gmail.com wrote:
   I believe the Security.level (in core.php) affects how soon Cake 
   sessions last.

   My 'Security.level' is set to 'low' and 'Session.timeout' to '1440'.
   Shouldn't my sessions last 5 days? They don't :-(

   On Fri, Jan 23, 2009 at 2:32 PM, dchanco...@gmail.com

   dchanco...@gmail.com wrote:

Hi,

Can someone explain me how sessions work in CakePHP once and for all?

I'm using CakePHP 1.2.0.7296 RC2 and PHP 5.2.6

I have the following setting in my core.php file:

Configure::write('Session.save', 'cake'); // I tried both 'php' and
'cake' with the same results
//Configure::write('Session.table', 'cake_sessions');
//Configure::write('Session.database', 'default');
Configure::write('Session.cookie', 'CAKEPHP');
Configure::write('Session.timeout', '1440');
Configure::write('Session.start', true);
Configure::write('Session.checkAgent', true);
Configure::write('Security.level', 'low');

And the following PHP settings:

session.cache_expire          7200
session.cookie_lifetime        0
session.gc_maxlifetime        432000
session.use_cookies            On
session.use_only_cookies    Off

My expectation is that my sessions should last 1400sec * 300 (for
'low') or 5 days.
Yet, without closing my browser, my sessions will become unavailable
once or
twice a day. I.e. code that checks for a valid username in the session
gets
nothing and 'logs me out'.

I have had this behavior hapenning in a couple of CakePHP applications
I
developed. What am I missing?

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



Rendering non-HTML: templates vs. elements

2009-01-26 Thread BenL

My app uses ical-like events and I'd like to make these events
available for subscription from Google Calendar, Apple iCal, etc. The
guide at http://www.365webapplications.com/2009/01/09/cakephp-calendar/
helped me set up iCalcreator as a Helper.

However I'm confused on use of a view template vs. element: from the
Cake doc, I would have expected to use a template that defines the
overall layout (in this case, it would be empty as iCalcreator's
render takes care of everything); then the view would create an
iCalcreator object from the data provided by the controller and render
it to $content_for_layout.

However, the 365webapplications approach invokes the controller action
via a requestAction in an element, the element then creates the
iCalcreator object renders it. No template is used. When I do this, I
find that the controller action gets called twice, and seems to get
cut off prematurely:

i.e. my controller and element (simplified):

controllers/events_controller.php:
?
class EventsController extends AppController {

function ical() {

$this-helpers[] = 'ICal';  // pull in the i_cal helper
$this-Event-recursive = 0;// don't need associated data

$events = $this-Event-find('all');

// called via a requestAction?
if (isset($this-params['requested']))  {
echo controllers/events_controller: requestedp;
return $events;
}

echo controllers/events_controller, setting eventsp;
$this-set('events', $events);
echo controllers/events_controller, donep;
}
}
?

views/elements/events.ctp
?php
echo views/elements/events.ctp 1p;
$events = $this-requestAction('events/ical');
echo views/elements/events.ctp 2p;

$iCal-create();

echo views/elements/events.ctp 3p;
foreach($events as $e)
{
$iCal-addEvent(
$e['Event']['datestart'],
$e['Event']['dateend'],
$e['Event']['summary'],
$e['Event']['description']
);
}
$iCal-render();
echo pviews/elements/events.ctp 4p;
?

views/events/ical.ctp:
?php
echo views/events/ical.ctp startp;
//echo $this-element('events', array('cache'='+1 hour'));
echo $this-element('events');
echo views/events/ical.ctp endp;
?


Now, when I call the action, I get:

controllers/events_controller, setting events

controllers/events_controller, done

views/events/ical.ctp start

views/elements/events.ctp 1

controllers/events_controller: requested

views/elements/events.ctp 2

views/elements/events.ctp 3

then some warnings about cannot modify header - which is fine as
I'm just debugging now, and the output of iCal-render
BEGIN:VCALENDAR METHOD:PUBLISH ... :VEVENT END:VCALENDAR


and that's it: the line in the element after the render doesn't get
called, nor does the line after the 'echo $this-element('events');'
in the view

Is the above the best way to output non-HTML?

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



Model Relationships Help

2009-01-26 Thread cds

I'm building an internal project management system with companies,
projects, tasks, reference items, file attachments, comments (for
collaboration w/ client), and some other things.

Attachments, Reference Items, Comments should be able to map to a
general project as a whole, a specific task, or just be general that
are available to all projects and tasks. Is a HABTM relationship
appropriate here? My reaction is use has many but that only works
for projects and tasks but not the general requirement.

What are your $0.02?

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



Auth Issues - Session Comes And Goes

2009-01-26 Thread lawwton

All:

I am having some weird issues using Auth and after some investigation
with little results I've decided to post some questions since I am
sure I must be missing something; but I have not been able to find out
what it is.

The issue I have is the following:

For some reason after generating 3 ajax requests and also doing this
after having successfully logged in, my session information seems to
loose the user information I had received and stored automagically in
Auth-user(). This sporadically changes, meaning that in some cases I
can see it for one controller. Then I don't see it after login back in
and re-running the 3 ajax requests for the different controllers.
Again I will see the session info (user) for a different controller
this time

Essentially what I am doing is that after I login I load up some
JavaScripts Objects that I will use for my front-end (GUI) interface.
I do this by sending 3 ajax requests for example and holding on to the
information received from them.

To add to the confusion after not properly seeing the correct user
session information set by Auth-user(). I can then continuously call
the controller/action from my browser and this time I will get the
session information every time regardless of which controller I use.

I have no idea why is behaving like that. Can someone please let me
know what the possible issue is. The main functions for the 3
controllers are shown below.

Thanks in advance.


In my AppController I have the following:

  var $components = array('Auth', 'Session', 'RequestHandler');

public function beforeFilter() {
$this-Auth-loginAction = array('controller' = 'portal', 
'action'
= 'login');
$this-Auth-loginRedirect = array('controller' = 'portal',
'action' = 'main');
$this-Auth-logoutRedirect = array('controller' = 'portal',
'action' = 'index');
$this-Auth-autoRedirect = false;
} // End of beforeFilter()

Then I have 3 controllers to which I send ajax requests via POST.

Function from Controller 1:

public function getGroups() {

$this-layout = 'ajax';
$aTariffGroup = array();
$this-log(TARIFFGROUP, LOG_DEBUG);
$this-log($_SESSION, LOG_DEBUG);

if ( $this-RequestHandler-isAjax() ) {

if ( $this-User-Group-getGroupName($this-Auth-user
('group_id')) != 'superusers' ) {
$aTariffGroup = 
$this-CcTariffgroup-getGroups($this-Auth-user
('tariff_id'));
} else {
$aTariffGroup = 
$this-CcTariffgroup-getGroups();
}

$jTariffGroup = Set::extract($aTariffGroup, 
'{n}.cc_tariffgroup');
$this-set('j_groups', $jTariffGroup);
}

} // End of getGroups()

Function from Controller 2:

public function getTrunkGroups() {

$this-log(TRUNKSSS, LOG_DEBUG);
$this-log($_SESSION, LOG_DEBUG);
$this-layout = 'ajax';

if ( $this-RequestHandler-isAjax() ) {

$iTotalProperty = $this-CcTrunk-find('count');
$aTrunks = $this-CcTrunk-find('all');
$jTrunks = Set::extract($aTrunks, '{n}.CcTrunk');

$this-set('total', $iTotalProperty);
$this-set('trunkgroups', $jTrunks);

}

} // End of getTrunkGroups()

Function from Controller 3:

public function getGroups() {

$this-log(GROUPSS, LOG_DEBUG);
$this-log($_SESSION, LOG_DEBUG);

$this-layout = 'ajax';

if ( $this-RequestHandler-isAjax() ) {

$i_count = $this-Group-find('count');
$a_groups = $this-Group-find('all');
$j_groups = Set::extract($a_groups, '{n}.Group');

$this-set('j_groups', $j_groups);
$this-set('i_total', $i_count);

}

} // End of getGroups()

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



Auth Issues - Session Comes And Goes

2009-01-26 Thread lawwton

All:

I am having some weird issues using Auth and after some investigation
with little results I've decided to post some questions since I am
sure I must be missing something; but I have not been able to find out
what it is.

The issue I have is the following:

For some reason after generating 3 ajax requests and also doing this
after having successfully logged in, my session information seems to
loose the user information I had received and stored automagically in
Auth-user(). This sporadically changes, meaning that in some cases I
can see it for one controller. Then I don't see it after login back in
and re-running the 3 ajax requests for the different controllers.
Again I will see the session info (user) for a different controller
this time

Essentially what I am doing is that after I login I load up some
JavaScripts Objects that I will use for my front-end (GUI) interface.
I do this by sending 3 ajax requests for example and holding on to the
information received from them.

To add to the confusion after not properly seeing the correct user
session information set by Auth-user(). I can then continuously call
the controller/action from my browser and this time I will get the
session information every time regardless of which controller I use.

I have no idea why is behaving like that. Can someone please let me
know what the possible issue is. The main functions for the 3
controllers are shown below.

Thanks in advance.


In my AppController I have the following:

  var $components = array('Auth', 'Session', 'RequestHandler');

public function beforeFilter() {
$this-Auth-loginAction = array('controller' = 'portal', 
'action'
= 'login');
$this-Auth-loginRedirect = array('controller' = 'portal',
'action' = 'main');
$this-Auth-logoutRedirect = array('controller' = 'portal',
'action' = 'index');
$this-Auth-autoRedirect = false;
} // End of beforeFilter()

Then I have 3 controllers to which I send ajax requests via POST.

Function from Controller 1:

public function getGroups() {

$this-layout = 'ajax';
$aTariffGroup = array();
$this-log(TARIFFGROUP, LOG_DEBUG);
$this-log($_SESSION, LOG_DEBUG);

if ( $this-RequestHandler-isAjax() ) {

if ( $this-User-Group-getGroupName($this-Auth-user
('group_id')) != 'superusers' ) {
$aTariffGroup = 
$this-CcTariffgroup-getGroups($this-Auth-user
('tariff_id'));
} else {
$aTariffGroup = 
$this-CcTariffgroup-getGroups();
}

$jTariffGroup = Set::extract($aTariffGroup, 
'{n}.cc_tariffgroup');
$this-set('j_groups', $jTariffGroup);
}

} // End of getGroups()

Function from Controller 2:

public function getTrunkGroups() {

$this-log(TRUNKSSS, LOG_DEBUG);
$this-log($_SESSION, LOG_DEBUG);
$this-layout = 'ajax';

if ( $this-RequestHandler-isAjax() ) {

$iTotalProperty = $this-CcTrunk-find('count');
$aTrunks = $this-CcTrunk-find('all');
$jTrunks = Set::extract($aTrunks, '{n}.CcTrunk');

$this-set('total', $iTotalProperty);
$this-set('trunkgroups', $jTrunks);

}

} // End of getTrunkGroups()

Function from Controller 3:

public function getGroups() {

$this-log(GROUPSS, LOG_DEBUG);
$this-log($_SESSION, LOG_DEBUG);

$this-layout = 'ajax';

if ( $this-RequestHandler-isAjax() ) {

$i_count = $this-Group-find('count');
$a_groups = $this-Group-find('all');
$j_groups = Set::extract($a_groups, '{n}.Group');

$this-set('j_groups', $j_groups);
$this-set('i_total', $i_count);

}

} // End of getGroups()

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



Issues with AuthComponent Using Ajax

2009-01-26 Thread lawwton

All:

I am having some weird issues using Auth and after some investigation
with little results I've decided to post some questions since I am
sure I must be missing something; but I have not been able to find out
what it is.

The issue I have is the following:

For some reason after generating 3 ajax requests and also doing this
after having successfully logged in, my session information seems to
loose the user information I had received and stored automagically in
Auth-user(). This sporadically changes, meaning that in some cases I
can see it for one controller. Then I don't see it after login back in
and re-running the 3 ajax requests for the different controllers.
Again I will see the session info (user) for a different controller
this time

Essentially what I am doing is that after I login I load up some
JavaScripts Objects that I will use for my front-end (GUI) interface.
I do this by sending 3 ajax requests for example and holding on to the
information received from them.

To add to the confusion after not properly seeing the correct user
session information set by Auth-user(). I can then continuously call
the controller/action from my browser and this time I will get the
session information every time regardless of which controller I use.

I have no idea why is behaving like that. Can someone please let me
know what the possible issue is. The main functions for the 3
controllers are shown below.

Thanks in advance.


In my AppController I have the following:

  var $components = array('Auth', 'Session', 'RequestHandler');

public function beforeFilter() {
$this-Auth-loginAction = array('controller' = 'portal', 
'action'
= 'login');
$this-Auth-loginRedirect = array('controller' = 'portal',
'action' = 'main');
$this-Auth-logoutRedirect = array('controller' = 'portal',
'action' = 'index');
$this-Auth-autoRedirect = false;
} // End of beforeFilter()

Then I have 3 controllers to which I send ajax requests via POST.

Function from Controller 1:

public function getGroups() {

$this-layout = 'ajax';
$aTariffGroup = array();
$this-log(TARIFFGROUP, LOG_DEBUG);
$this-log($_SESSION, LOG_DEBUG);

if ( $this-RequestHandler-isAjax() ) {

if ( $this-User-Group-getGroupName($this-Auth-user
('group_id')) != 'superusers' ) {
$aTariffGroup = 
$this-CcTariffgroup-getGroups($this-Auth-user
('tariff_id'));
} else {
$aTariffGroup = 
$this-CcTariffgroup-getGroups();
}

$jTariffGroup = Set::extract($aTariffGroup, 
'{n}.cc_tariffgroup');
$this-set('j_groups', $jTariffGroup);
}

} // End of getGroups()

Function from Controller 2:

public function getTrunkGroups() {

$this-log(TRUNKSSS, LOG_DEBUG);
$this-log($_SESSION, LOG_DEBUG);
$this-layout = 'ajax';

if ( $this-RequestHandler-isAjax() ) {

$iTotalProperty = $this-CcTrunk-find('count');
$aTrunks = $this-CcTrunk-find('all');
$jTrunks = Set::extract($aTrunks, '{n}.CcTrunk');

$this-set('total', $iTotalProperty);
$this-set('trunkgroups', $jTrunks);

}

} // End of getTrunkGroups()

Function from Controller 3:

public function getGroups() {

$this-log(GROUPSS, LOG_DEBUG);
$this-log($_SESSION, LOG_DEBUG);

$this-layout = 'ajax';

if ( $this-RequestHandler-isAjax() ) {

$i_count = $this-Group-find('count');
$a_groups = $this-Group-find('all');
$j_groups = Set::extract($a_groups, '{n}.Group');

$this-set('j_groups', $j_groups);
$this-set('i_total', $i_count);

}

} // End of getGroups()

--~--~-~--~~~---~--~~
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: SaveAll + one-to-many

2009-01-26 Thread Jelmer

Hi Joshua,

If you have a $data array containing data for a record in A and 0 or
more records in B, you can use saveAll.

So, if your $data is something like:

array(
  [A] = array(
[id] = 12,
[otherdata] = 'some string'
),

 [B] = array(
[0] = array(..),
[1] = array(..)
 )
);

you can call model A in your a-controller:

A-saveAll($data,array('atomic' = true, 'validate' = 'first'));

This will save all the data in the A-record and associated B-records.
But take care:

- This will only work if you have set up the relationship. So in A
there must be something like:
 var $hasMany = array('B' = array('dependent' = true))
  and in B:
 var $belongsTo = 'A'

  Check the meaning of these options here:
http://book.cakephp.org/view/78/Associations-Linking-Models-Together

- The 'atomic' option only works if you can use transactions, like in
mysql InnoDB (not the default myIsam) tables.

- Tip: put this before the line where you want to use saveAll, to see
if the $data is ok:
 pr($data); exit();


This will save A + B. The only thing it will not do is remove the
records in B that no longer belong to A. This is something I will post
an item about, right now.

Jelmer

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



Shouldn't saveAll remove associated records as well?

2009-01-26 Thread Jelmer

Hi all,

I use saveAll to save a 'wordset' and it's associated words. In fact,
when reading the record (recursively), I create an extra field in the
wordSet model that contains the associated words, seperated by a
newline, for easy editing. When saving the wordSet, I recreate the
[Word] array for the associated words by looking them up (to make sure
they keep their old ids) and putting them in the $data['Word'] array.

Then I call saveAll, using atomic = true and validate = first. All
works fine. New words are added, existing words are saved under the
same id (some other stuff can change at that time). But... words that
are *removed* from the wordset are not deleted in the Word table.

I think that there should be an option in saveAll that would do just
this: remove any associated records in the associated hasMany table
that (1) have the same foreign key value as the edited main record and
(2) do not exist in the array for the associated sub records.

I even think that if the relation is defined as 'exclusive' AND
'dependent', this should be done automatically, to avoid orphan
records...

My relationships are defined as follows:

Class WordSet extends AppModel {
var $transactional = true;
var $cacheQueries = true;
var $order = 'WordSet.modified desc';

var $hasMany = array(
'Word' = array(
'exclusive' = true,
'dependent' = true)
);
...
}

class Word extends AppModel {
var $cacheQueries = true;
var $belongsTo = 'WordSet';
var $order = 'Word.word_set_id asc, Word.woord asc';
...
}


Any thoughts?

Jelmer

--~--~-~--~~~---~--~~
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: Gziping JS and CSS files using .htaccess

2009-01-26 Thread Leonardo K
This work for me:

Add this on .htaccess file

IfModule mod_deflate.c
AddOutputFilterByType DEFLATE application/x-javascript text/css
text/javascript text/html
/IfModule

On Sun, Jan 25, 2009 at 18:16, Sam Sherlock sam.sherl...@gmail.com wrote:

 try
 http://marcgrabanski.com/pages/code/asset-mapper

 2009/1/25 Sridhar Kuppalli sridhar.kuppa...@gmail.com

 This is not working. :(
 Is there any other method?

 Regards
 Sridhar K N

 On Sat, Jan 24, 2009 at 2:36 PM, _k10_ ketan.s...@gmail.com wrote:


 Hi,

 This helper might interest you. -
 http://bakery.cakephp.org/articles/view/minify-helper-for-cakephp
 (includes gziping of js and css assets)

 _k10_
 http:///www.propertyjungle.in

 On Jan 24, 1:27 pm, Sridhar Kuppalli sridhar.kuppa...@gmail.com
 wrote:
  Hi All,
  I am starting a new project by using CakePHP. In my apache based
 hosting i
  don't have access to modify httpd.conf file.
  I want to gzip all the css and js files going out of my server. Is
 there any
  method i configure this with .htacess file?
  Is anybody implemented this method?
 
  Thanks  Regards
  Sridhar Kuppalli







 


--~--~-~--~~~---~--~~
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: Any one looking for a freelance work

2009-01-26 Thread vezz

Let me know if it is still available ;)

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



Help w/ DebugKit - no toolbar

2009-01-26 Thread BenL

I'm attempting to use DebugKit per http://thechaw.com/debug_kit/wiki,
with cake_1.2.1.8004. I've downloaded debug_kit from
http://github.com/cakephp/debug_kit/tree/master and placed it into my
app/plugins directory.

After an initial hiccup with file permissions, I've hit a stumbling
block in that I don't have the toolbar on my DebugKit-enabled page. My
controller:

?
class EventsController extends AppController {
var $scaffold;
var $components = array('DebugKit.Toolbar');
?

http://.../events/ returns the same content regardless of the
$components line.

I have the default debug level, 2 (i.e. I can see the SQL log), I'm
using Firefox 3 w/ Firebug and FirePHP installed.

What am I missing?

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



How to expend core lib classes?

2009-01-26 Thread Mandos

I want to expend Inflector class (with this same name) or create new
in directory app/libs. How I can access to this class (App::Import
with parameters ?).

Maybe I can modify App::Import method that it would check first in app/
libs second in cake/libs but still need to extend App class.  I don't
want touch cake directory 'couse I have svn extrernals and want to
update from CakePHP svn.

M.M

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



Help - Acl controlled Application

2009-01-26 Thread foldiman

I'm working thru the Simple Acl controlled Application in the
cookbook and cannot get past the 10.2.4 Acts As a Requester step.
Everything is working up to this point, baking the files, initializing
the Dd Acl, tables, etc. I'm on a Mac and can view the app in progress
at http://localhost/tusers/

Before this step, I can see the users and groups scaffolded views at
http://localhost/tusers/users/
http://localhost/tusers/groups/

However, when I add the lines $belongsTo and $actsAs to the users and
groups models (step 10.2.4), I get the following errors when trying to
access the above pages.

Error: The requested address '/users' was not found on this server.
Error: The requested address '/groups' was not found on this server.

So now I'm stuck. Any help would be greatly appreciated.

Thanks.


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



Re: Which editor for Mac OS X?

2009-01-26 Thread rgreenphotodesign

I get inordinate bloat in the project explorer

What do you mean by this? If you create your project correctly (I just
use general project then switch to the php perspective), you should
only have one .project file that's in your project explorer. When you
use the other project types like Java and even PHP project it will
create a folder structure it thinks you should use. Maybe that's what
you're referring to? Give the general project setup a try. As well, if
you're using SVN there will be all the needed files for that. I
usually perform an Export out of SVN to clean all that up before
putting the files on my production server.



On Jan 25, 11:04 am, rogwei rog...@comcast.net wrote:
 Maybe I'm missing something about Eclipse, but when I create a project
 for CakePHP (which seems to be a requirement in this discussion) I get
 inordinate bloat in the project explorer. Is there a workaround for
 this? How do people tolerate such a mess, given that one of the basic
 things you use an IDE for is project management? I would love to know,
 because otherwise, I think Eclipse is a fairly attractive alternative
 for the other noted features.

 On Jan 25, 7:34 am, rgreenphotodesign rgr...@rgreenphotography.com
 wrote:

  Eclipse is nice because it's the same on all OS. If you use Windows at
  work and Mac at home, it still works pretty much the same. That and
  I've been using it since version 1 and I'm kind of used to it.

  I've tried CODA and it's pretty cool. I like the CSS editior which is
  something most pure IDEs lack and well as the terminal window options.
  I'm still trying to decide if it's worth the 100 or if I'm OK using
  Eclipse and CSS editors that came with Adobe Dreamweaver, since I
  already own it as a part of the suite I use.

  On Jan 25, 7:45 am, Janoma jan...@gmail.com wrote:

   I'd go for Smultron, though I don't think the newest versions work on
   non-intel macs.

   On Jan 23, 11:01 am, leo ponton@gmail.com wrote:

Having spent months trying to find an adequate editor for Windows, I
eventually settled on Komodo. Now I'm working on a Mac and Komodo is
available, but version 5 is so slow it's unusable. I reverted to v4,
but while it is a little quicker it is also a little unstable. It is
still slow enough  to be irritating - 2 seconds to switch tabs;
sometimes it doesn't load the plugins, sometimes it will not maximise
properly.

Okay, I'm not using a cutting edge Intel Mac, I'm on a G4 / Leopard,
but it's still a reasonably powerful machine (it'll run Photoshop and
Illustrator simultaneously without grinding to a halt).

Can anybody suggest a non-java based editor (I do not like Eclipse or
NetBeans or anything Java come to that)? I've tried Xcode, but it
seems really clunky and not at all geared to PHP. It needs to have
project handling like Komodo, code intelligence and above all, it must
be free.

Maybe a Macport of Bluefish - anybody tried that?
--~--~-~--~~~---~--~~
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: Are we using the slowest PHP framework there is?

2009-01-26 Thread chanon

I'll probably stick to CakePHP because I love it's design and all the
help it gives. I just took a look at Yii and tried to find a helper
that can do xxx days ago style date formatting and it doesn't have
one. So I can imagine it could be missing lots of small touches like
this that make CakePHP a joy to use.

But anyhow, performance from 1.1 = 1.2 instead of getting better has
gotten 2-5 times worse. Hopefully 1.3 won't continue this trend. As I
said, I think instead of rushing to add more features to create a
potentially even slower 1.3, maybe it is a good time to optimize what
is already there.
--~--~-~--~~~---~--~~
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: how to generate views for recursive 2 associations?

2009-01-26 Thread RoVo

Hi Dieter,

an example. We have 3 models (HABTM):
Posts - PostsTag - Tag

If I bake only Posts and Tag (model, controller and views), I get a
results like yours . NO related Tags

NOW I bake the PostsTag-model with belongsTo Post and belongsTo Tag.
If I bake the Post-controller and views again...
UUPS!?!
Related Tags are in the view.ctp :)

Tested with 1.2.1.8004

Hope that helps
RoVo


--~--~-~--~~~---~--~~
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: simple and complete file upload behaviour

2009-01-26 Thread Edward A. Webb
please reply to the group and not me individually.

Thanks.

On Mon, Jan 26, 2009 at 10:32 AM, Future22 curtiszj...@gmail.com wrote:

 Looks good Smelly_Eddie, but what about store files on the server (ex:
 pictures, etc.) instead of the database?
 Thanks!

 On Jan 26, 9:41 am, Smelly_Eddie ollit...@gmail.com wrote:
  Daniel Hofstetter has a great article on uploading files to a
  database.
 
  If the size of your files is limited(pdfs, docs, etc) this can be a
  practical approach because managing them is quite easy.
 http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/
 
  I wrote a complementary article thaty outlines the MVC way to serve
  the files back out, whether in-line or as dowloads.
 http://edwardawebb.com/programming/php-programming/cakephp/serving-fi...
 
  On Jan 25, 4:59 am, fain182 fain...@gmail.com wrote:
 
 
 
   someone knows if there is a file upload behaviour, that manage adding,
   editing and deleting of files in a simple way?
   thank you- Hide quoted text -
 
  - Show quoted text -




-- 
Eddie A. Webb

--~--~-~--~~~---~--~~
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: Help w/ DebugKit - no toolbar

2009-01-26 Thread Samuel DeVore

I have seen this with pages (or templates) that have requestAction
used in them.  I'm not sure if it the result of clearing of the output
buffer in requestAction or something else.

Sam D

On Mon, Jan 26, 2009 at 6:24 AM, BenL benjamin.d@gmail.com wrote:

 I'm attempting to use DebugKit per http://thechaw.com/debug_kit/wiki,
 with cake_1.2.1.8004. I've downloaded debug_kit from
 http://github.com/cakephp/debug_kit/tree/master and placed it into my
 app/plugins directory.

 After an initial hiccup with file permissions, I've hit a stumbling
 block in that I don't have the toolbar on my DebugKit-enabled page. My
 controller:

 ?
 class EventsController extends AppController {
var $scaffold;
var $components = array('DebugKit.Toolbar');
 ?

 http://.../events/ returns the same content regardless of the
 $components line.

 I have the default debug level, 2 (i.e. I can see the SQL log), I'm
 using Firefox 3 w/ Firebug and FirePHP installed.

 What am I missing?

 


--~--~-~--~~~---~--~~
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: Help w/ DebugKit - no toolbar

2009-01-26 Thread RoVo

Hi BenL,

please check the debug-level
in your /app/config/core.php:

Configure::write('debug', 1);

It should be 1 or higher to see the toolbar

Hope that helps
RoVo
--~--~-~--~~~---~--~~
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: CakePHP In A Subdirectory?

2009-01-26 Thread inVINCable

RoVo:

Tested your solution, still no go. This time, no 500 error, but no CSS
or anything :/

I tried doing phpinfo() from the index.php file and nothing was
displayed and on my localserver i checked and mod_rewrite is on.



On Jan 26, 6:35 am, RoVo rol...@service-itzehoe.de wrote:
 Hi inVINCable,

 I have tested my suggestion - see above.
 This is the htaccess of the top-level. The others are untouched.

 Hope that helps
 RoVo
--~--~-~--~~~---~--~~
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: Auth Component not hashing password

2009-01-26 Thread Ivan

Is there any way to get the Auth component to hash the confirm
password input as well? I think that if the password's being hashed
for security reasons, then it's inconsistent not to be able to set the
option of hashing some other password type input. (I know it can
always be hashed with $this-Auth-password(), but I wonder if it
could be set to have it done automagically, in cakephp terms).

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



What is automated and what is not?

2009-01-26 Thread Delirium tremens

I am going to add remember me and activate account features to my
login system. Why is it not built in CakePHP? Are remember me and
activate account not common enough? What is automated and what is not?
Why?
--~--~-~--~~~---~--~~
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: What is automated and what is not?

2009-01-26 Thread Dardo Sordi Bogado

 I am going to add remember me and activate account features to my
 login system. Why is it not built in CakePHP? Are remember me and
 activate account not common enough? What is automated and what is not?
 Why?

Perhaps it is not common enough, only in the last app I've built there
was a requirement of activating accounts and I've never needed
remember me feature... Anyway they are easy to build with cake.

Remember me tutorial:

http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/

And for activating accounts, I'm using a similar approach to this one:

http://bakery.cakephp.org/articles/view/ticket-component-resetting-user-passwords

Regards,
- Dardo.

 


--~--~-~--~~~---~--~~
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: simple and complete file upload behaviour

2009-01-26 Thread Future22

Looks good Smelly_Eddie, but what about storing files on the server
(ex: pictures, etc.) instead of the database?
Thanks!

On Jan 26, 9:41 am, Smelly_Eddie ollit...@gmail.com wrote:
 Daniel Hofstetter has a great article on uploading files to a
 database.

 If the size of your files is limited(pdfs, docs, etc) this can be a
 practical approach because managing them is quite 
 easy.http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/

 I wrote a complementary article thaty outlines the MVC way to serve
 the files back out, whether in-line or as 
 dowloads.http://edwardawebb.com/programming/php-programming/cakephp/serving-fi...

 On Jan 25, 4:59 am, fain182 fain...@gmail.com wrote:



  someone knows if there is a file upload behaviour, that manage adding,
  editing and deleting of files in a simple way?
  thank you- Hide quoted text -

 - Show quoted text -

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



Re: Multiple Uploads with MeioUpload

2009-01-26 Thread gerhardsletten

Are using MeioUpload on my last project to as Article has many
Uploads. When editing an article you can upload one and one image.
Your will find source here:
http://code.google.com/p/gerhardsletten/source/browse/trunk/cakephp/surdeig/models/upload.php?r=6

If you need your app to upload all in one bunsh, I guess you can use
the $model-saveAll() and add several uploadsfields in an array.
Search in this group for save multiple or saveall



--~--~-~--~~~---~--~~
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: twitter users?

2009-01-26 Thread gerhardsletten

http://www.twitter.com/gerhardsletten

A salty mix of cake, ez publish, triathlon, food and live. Code stuff
mostly in english, but some norwegian now and than

On Jan 25, 5:33 pm, Marcelo Andrade mfandr...@gmail.com wrote:
 http://twitter.com/mfandrade

 Mainly in portuguese.

 --
 MARCELO DE F. ANDRADE (aka eleKtron)
 Belem, PA, Amazonia, Brazil
 Linux User #221105

 [...@pará ~]# linkshttp://pa.slackwarebrasil.org/

 For Libby's backstory be told on 
 Losthttp://www.petitiononline.com/libby423/petition.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: change label/input generated code

2009-01-26 Thread brian

Your first suggestion is what I went with when I wanted to do the
same. I figure there's no great need to have Cake output a label. It's
convenient but, to get the markup I wanted, it made more sense to go
around it.

As for extending the helper, I tried that, too, at the time. But I
never could quite figure out how HtmlHelper was doing things.

On Mon, Jan 26, 2009 at 10:00 AM, Matt Curry m...@mcurry.net wrote:

 Hey Marcelo,
 You could just do something simply like:
 labelMy label: ?php echo $form-input('MyModel.field', array
 ('label'= false)); ?/label

 Or even better: Make your own helper that extends the Cake FormHelper
 and has a method that does this.

 -Matt
 http://www.pseudocoder.com

 On Jan 25, 11:59 am, Marcelo Andrade mfandr...@gmail.com wrote:
 Hi all,

 What's the better way to make the output of this

 echo $form-input('MyModel.field', array('label'= 'My label:'));

 generate labels surrounding the input element like
 this

 labelMy label: input type=text id=MyModelField //label

 instead of label for= version. ???

 Best regards.

 --
 MARCELO DE F. ANDRADE (aka eleKtron)
 Belem, PA, Amazonia, Brazil
 Linux User #221105

 [...@pará ~]# linkshttp://pa.slackwarebrasil.org/

 For Libby's backstory be told on 
 Losthttp://www.petitiononline.com/libby423/petition.html
 


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



Re: unbind and bind Process..

2009-01-26 Thread brian

You're setting a var named, libraries, not library.

On Mon, Jan 26, 2009 at 7:51 AM, Marcelo Iwata marcelo011...@gmail.com wrote:
 I was having the same problem as this one:

 http://groups.google.com/group/cake-php/browse_thread/thread/64c581784c5674cd/fe1ac5f63f84b94f?lnk=gstq=paginator+recursive+sort#fe1ac5f63f84b94f


 I have a Library that belongs to a Membership, and a Membership that belongs
 to a User and a Project.
 So, i was looking for a answear ,and i  decided to force the bind Process.

 So, my controller is like this:
 ...
 var $paginate = array('limit' = 15, 'page' = 1, 'recursive'=2);
 ...
  function showLibraries(){
 $this-set(CSS, main);
 $this-Library-unbindModel(array('belongsTo' =
 array('Membership'),),false);
 $this-Library-Membership-unbindModel(array('belongsTo' =
 array('User')),false);
 $this-Library-Membership-unbindModel(array('belongsTo' =
 array('Project')),false);
 $this-Library-bindModel(array(array('belongsTo'=
 array('Membership'=array(),'User'=array('foreignKey'=false,'conditions'=array('Membership.user_id=User.id'));
 $this-set('libraries', $this-paginate('Library'));
 }



 But, this cannot be done, because the ctp's  variable
 $library['Membership']['Project']['name'], cannot be found.
 Any ideas?
 Thanks in advance.



 


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



Re: Shouldn't saveAll remove associated records as well?

2009-01-26 Thread Esoteric

As far as I know not in the setup you have going ... if you where
using a HABTM with unique = true, then yes that is what would happen.

-Erik

On Jan 26, 6:10 am, Jelmer goo...@spininhetweb.nl wrote:
 Hi all,

 I use saveAll to save a 'wordset' and it's associated words. In fact,
 when reading the record (recursively), I create an extra field in the
 wordSet model that contains the associated words, seperated by a
 newline, for easy editing. When saving the wordSet, I recreate the
 [Word] array for the associated words by looking them up (to make sure
 they keep their old ids) and putting them in the $data['Word'] array.

 Then I call saveAll, using atomic = true and validate = first. All
 works fine. New words are added, existing words are saved under the
 same id (some other stuff can change at that time). But... words that
 are *removed* from the wordset are not deleted in the Word table.

 I think that there should be an option in saveAll that would do just
 this: remove any associated records in the associated hasMany table
 that (1) have the same foreign key value as the edited main record and
 (2) do not exist in the array for the associated sub records.

 I even think that if the relation is defined as 'exclusive' AND
 'dependent', this should be done automatically, to avoid orphan
 records...

 My relationships are defined as follows:

 Class WordSet extends AppModel {
         var $transactional = true;
         var $cacheQueries = true;
         var $order = 'WordSet.modified desc';

         var $hasMany = array(
                 'Word' = array(
                         'exclusive' = true,
                         'dependent' = true)
                 );
 ...

 }

 class Word extends AppModel {
         var $cacheQueries = true;
         var $belongsTo = 'WordSet';
         var $order = 'Word.word_set_id asc, Word.woord asc';
 ...

 }

 Any thoughts?

 Jelmer
--~--~-~--~~~---~--~~
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: CakePHP In A Subdirectory?

2009-01-26 Thread Paolo Stancato

Sometimes I have problems because I forget to set AllowOverride to All
in vhost configuration... maybe it can help. Sometimes s still a pain
to prepare the enviroment to start developing :S

Cheers

2009/1/26 inVINCable invinceable...@gmail.com:

 RoVo:

 Tested your solution, still no go. This time, no 500 error, but no CSS
 or anything :/

 I tried doing phpinfo() from the index.php file and nothing was
 displayed and on my localserver i checked and mod_rewrite is on.



 On Jan 26, 6:35 am, RoVo rol...@service-itzehoe.de wrote:
 Hi inVINCable,

 I have tested my suggestion - see above.
 This is the htaccess of the top-level. The others are untouched.

 Hope that helps
 RoVo
 


--~--~-~--~~~---~--~~
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: slightly OT: need an unusual find condition (or possible custom query)

2009-01-26 Thread brian

I think you'll need to loop through the array with find('count').

On Mon, Jan 26, 2009 at 8:35 AM, Martin Westin
martin.westin...@gmail.com wrote:

 Hi,
 I am in need of an unusual query that I find it hard to search for on
 Google or MySQL.com since all the terms I think of are very common
 ones. Hopefully someone reading this can guide me in the right
 direction.

 I have a series of values in an array. I can find out which records
 have matching values by passing this array as a condition to get a
 WHERE somefield IN (value1,value2) clause.

 I can also find which records have non-matching fields by using a
 WHERE NOT(...) clause. Finding the orphans in the database so to
 speak.

 Of-course I want something else. I want to find out which values in my
 array do not match a record in the database. Finding the orphans in my
 array so to speak. I have not figured out how to do this without using
 the IN clause and then comparing the results. Since this is
 expensive (looping arrays take time) I really wanted to find an SQL-
 way that would be less expensive.

 SELECT VALUES IN MY ARRAY THAT DO NOT FIND ANY MATCHING RECORD -
 sort of.

 Any guidance would be appreciated
 /Martin
 


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



cached views don't retain document mime type (xml, json, etc.)

2009-01-26 Thread skylar

Hi,

I'm working on a site using CakePHP that has various feeds in JSON and
XML. I tried caching some of those feeds today using controller-level
view caching and ran into an annoying problem - cached views don't
seem to retain the mime type of the document. That is, in most cases,
a cached view (not elements) will be served up as text/html by
CakePHP, not the type of the original document.

To recreate this, simply try offering a XML or JSON based view in a
controller, cache it, then load it twice. (using parseExtensions()
might also help) The first request works correctly (uncached request),
but the second request will come back as text/html (except for an edge
case around XML).

The problem seems to be at line 508 of cake/libs/view/view.php. (I'm
using 1.2.0.7962)  This is where the view class outputs a cached view
file, if valid.  The only check here for alternative document mime-
types is this confusing check for a layout named 'xml':

   if ($this-layout === 'xml') {
 header('Content-type: text/xml');
   }

The cache file doesn't have any properties that retain the extension
or type that would have been used by RequestHandler (or other code) to
find the right content type. However, $this-here does capture the
extension implicitly.

It seems the proper thing for the caching mechanism to do is to store
the content type as a variable in the view cache file (eg, $this-ext
or $this-content_type) so that the proper header can be recreated
with the cache request.  However, I don't know much about the CakePHP
internals so I'll defer primarily to explaining the situation in hopes
of filing a good bug and rallying a fix.  This seems like a major
oversight in the caching system as feeds (ajax, json, xml) are
becoming an increasingly critical part of any modern web application.

Has anyone noticed this before? Known workaround (without modifying
cake lib code)? Is a bug already filed on this that I couldn't find?
Anything else I'm missing here?

Thanks,
skylar
--~--~-~--~~~---~--~~
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: slightly OT: need an unusual find condition (or possible custom query)

2009-01-26 Thread AD7six



On Jan 26, 2:35 pm, Martin Westin martin.westin...@gmail.com wrote:
 Hi,
 I am in need of an unusual query that I find it hard to search for on
 Google or MySQL.com since all the terms I think of are very common
 ones. Hopefully someone reading this can guide me in the right
 direction.

 I have a series of values in an array. I can find out which records
 have matching values by passing this array as a condition to get a
 WHERE somefield IN (value1,value2) clause.

 I can also find which records have non-matching fields by using a
 WHERE NOT(...) clause. Finding the orphans in the database so to
 speak.

 Of-course I want something else. I want to find out which values in my
 array do not match a record in the database. Finding the orphans in my
 array so to speak. I have not figured out how to do this without using
 the IN clause and then comparing the results. Since this is
 expensive (looping arrays take time) I really wanted to find an SQL-
 way that would be less expensive.

 SELECT VALUES IN MY ARRAY THAT DO NOT FIND ANY MATCHING RECORD -
 sort of.

 Any guidance would be appreciated
 /Martin

There's probably a more elegant way, This'd work:

DROP TABLE `tmp`;
 CREATE TABLE `tmp` (
`id` INT( 11 ) NULL
) ENGINE = MEMORY;
INSERT INTO `tmp` (
`id`
)
VALUES (1),(2),(3),(4),(5); # The values you want to search for

select `tmp`.`id` from `mytable` RIGHT JOIN `tmp` on
`mytable`.`somefield` = `tmp`.`id` WHERE `mytable`.`somefiled` IS
NULL;

Anything returned is a `mytable`.`somefield` that doesn't exist.

AD

--~--~-~--~~~---~--~~
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: Shouldn't saveAll remove associated records as well?

2009-01-26 Thread AD7six



On Jan 26, 12:10 pm, Jelmer goo...@spininhetweb.nl wrote:
 Hi all,

 I use saveAll to save a 'wordset' and it's associated words. In fact,
 when reading the record (recursively), I create an extra field in the
 wordSet model that contains the associated words, seperated by a
 newline, for easy editing. When saving the wordSet, I recreate the
 [Word] array for the associated words by looking them up (to make sure
 they keep their old ids) and putting them in the $data['Word'] array.

 Then I call saveAll, using atomic = true and validate = first. All
 works fine. New words are added, existing words are saved under the
 same id (some other stuff can change at that time). But... words that
 are *removed* from the wordset are not deleted in the Word table.

 I think that there should be an option in saveAll that would do just
 this: remove any associated records in the associated hasMany table
 that (1) have the same foreign key value as the edited main record and
 (2) do not exist in the array for the associated sub records.

 I even think that if the relation is defined as 'exclusive' AND
 'dependent', this should be done automatically, to avoid orphan
 records...

 My relationships are defined as follows:

 Class WordSet extends AppModel {
         var $transactional = true;
         var $cacheQueries = true;
         var $order = 'WordSet.modified desc';

         var $hasMany = array(
                 'Word' = array(
                         'exclusive' = true,
                         'dependent' = true)
                 );
 ...

 }

 class Word extends AppModel {
         var $cacheQueries = true;
         var $belongsTo = 'WordSet';
         var $order = 'Word.word_set_id asc, Word.woord asc';
 ...

 }

 Any thoughts?

Isn't an alarm bell ringing that you're calling a method called
saveAll and wanting it to delete?

AD
--~--~-~--~~~---~--~~
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: cached views don't retain document mime type (xml, json, etc.)

2009-01-26 Thread AD7six



On Jan 26, 7:38 pm, skylar s...@larw.com wrote:
 Hi,

 I'm working on a site using CakePHP that has various feeds in JSON and
 XML. I tried caching some of those feeds today using controller-level
 view caching and ran into an annoying problem - cached views don't
 seem to retain the mime type of the document. That is, in most cases,
 a cached view (not elements) will be served up as text/html by
 CakePHP, not the type of the original document.

 To recreate this, simply try offering a XML or JSON based view in a
 controller, cache it, then load it twice. (using parseExtensions()
 might also help) The first request works correctly (uncached request),
 but the second request will come back as text/html (except for an edge
 case around XML).

 The problem seems to be at line 508 of cake/libs/view/view.php. (I'm
 using 1.2.0.7962)  This is where the view class outputs a cached view
 file, if valid.  The only check here for alternative document mime-
 types is this confusing check for a layout named 'xml':

    if ($this-layout === 'xml') {
      header('Content-type: text/xml');
    }

 The cache file doesn't have any properties that retain the extension
 or type that would have been used by RequestHandler (or other code) to
 find the right content type. However, $this-here does capture the
 extension implicitly.

 It seems the proper thing for the caching mechanism to do is to store
 the content type as a variable in the view cache file (eg, $this-ext
 or $this-content_type) so that the proper header can be recreated
 with the cache request.  However, I don't know much about the CakePHP
 internals so I'll defer primarily to explaining the situation in hopes
 of filing a good bug and rallying a fix.  This seems like a major
 oversight in the caching system as feeds (ajax, json, xml) are
 becoming an increasingly critical part of any modern web application.

 Has anyone noticed this before? Known workaround (without modifying
 cake lib code)? Is a bug already filed on this that I couldn't find?
 Anything else I'm missing here?

That's how the book handles it:
http://thechaw.com/cakebook/source/views/layouts/rss/default.ctp

hth,

AD
--~--~-~--~~~---~--~~
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: international characters in db

2009-01-26 Thread kicaj

I had problem still...

This is my export db:

CREATE TABLE IF NOT EXISTS `categories` (
  `name` varchar(255) collate utf8_unicode_ci NOT NULL
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

INSERT INTO `categories` (`name`) VALUES
( 'ąćęłńóśżź'), // must by: ąćęłóń...
('ąćęłńóśżź'),
( 'ąćęłńóśżź'),


Anyone know How I can repaire?


On 25 Sty, 19:23, brian bally.z...@gmail.com wrote:
 Check the character encoding in your browser when you have phpmyadmin
 open. This is a notorious issue with that application. The fix is to
 set the encoding in the config file. Sorry, I can't be more specific
 as I don't have a copy handy right now.

 On Sun, Jan 25, 2009 at 7:11 AM, kicaj ki...@kdev.pl wrote:

  Hi

  I set in database.php encoding to utf8, my table and fields set to
  utf8-unicode-ci, and when i adding record to db, a see in my
  phpmyadmin bushes, why?

  ...but in on the site all it's okey:)

  Sorry, for my english:)
--~--~-~--~~~---~--~~
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: Multiple Uploads with MeioUpload

2009-01-26 Thread Arak Tai'Roth

I already have the code and everything working to upload one image,
that is not the issue at hand.

I want to be able to upload multiple images with MeioUpload. I wish to
use this method because it can automatically create thumbnails for me,
and there is very minimal amount of code that I need to use to make it
work.

I am open to other methods so long as they can upload thumbnails as
well, and aren't that code intensive.

On Jan 26, 11:40 am, gerhardsletten gerhardslet...@gmail.com wrote:
 Are using MeioUpload on my last project to as Article has many
 Uploads. When editing an article you can upload one and one image.
 Your will find source 
 here:http://code.google.com/p/gerhardsletten/source/browse/trunk/cakephp/s...

 If you need your app to upload all in one bunsh, I guess you can use
 the $model-saveAll() and add several uploadsfields in an array.
 Search in this group for save multiple or saveall
--~--~-~--~~~---~--~~
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: File Upload Limit?

2009-01-26 Thread Lamonte
Okay so the file is 9mb in size.  I try to upload the pdf file in firefox it
sends me back to the upload page.  When uploading smaller files like 1mb it
works fine.  Any solutions?

On Sun, Jan 25, 2009 at 8:56 AM, Smelly_Eddie ollit...@gmail.com wrote:


  What exactly is 'dont work out well'?

 By default Apache does not limit size, and you would see a 403 or 413
 error if that was at fault, but by default does cap script execution
 to 300 seconds.

 To expand on Jon's comment;
 MOre likely is PHP configuration.

 To check the limits on php use phpinfo() in a script and check the
 output for these values

 upload_max_filesize- max file size

  max_execution_time- max time the parser will deal with a script

 max_input_time   - max time a script may deal with POST, GET or file
 uploads.

 post_max_size  - Sets max size of post data allowed. This setting
 also affects file upload.



 On Jan 25, 1:51 am, Jon Bennett jmbenn...@gmail.com wrote:
   It allows me to upload smaller pdf files with no problem, but huge
 pdf's
   dont work out well.  Could this be a server issue or what?  What could
 I do
   to try debugging this issue?
 
  What browser/OS are they using? I've had big issues with Safari on OSX
  with uploads timing out and just failing, it's a known bug. In my
  experience anything  100kb will fail,very annoying, wasted a _long_
  time trying to make my server work! FireFox etc all fine though.
 
  http://www.google.co.uk/search?q=safari%20large%20uploads%20bug
 
  Failing that, check your php config allow uploads at that size and
  have a time limit that won't cut off midway through.
 
  Cheers,
 
  Jon
 
  --
 
  jon bennett
  w:http://www.jben.net/
  iChat (AIM): jbendotnet Skype: jon-bennett
 



-- 
For all your Programming and Technology Information Visit
www.BinaryCrunch.com

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



Re: cached views don't retain document mime type (xml, json, etc.)

2009-01-26 Thread skylar

That's interesting.  It suggests this might only be a major issue when
caching is used in conjunction with parseExtensions() (which, though a
bit of magic, automatically inserts the proper Content-type header for
you).  It seems a bit hackish to have to explicitly not cache these
headers in your views.

I'll post a bug...

skylar

On Jan 26, 10:59 am, AD7six andydawso...@gmail.com wrote:
 On Jan 26, 7:38 pm, skylar s...@larw.com wrote:



  Hi,

  I'm working on a site using CakePHP that has various feeds in JSON and
  XML. I tried caching some of those feeds today using controller-level
  view caching and ran into an annoying problem - cached views don't
  seem to retain the mime type of the document. That is, in most cases,
  a cached view (not elements) will be served up as text/html by
  CakePHP, not the type of the original document.

  To recreate this, simply try offering a XML or JSON based view in a
  controller, cache it, then load it twice. (using parseExtensions()
  might also help) The first request works correctly (uncached request),
  but the second request will come back as text/html (except for an edge
  case around XML).

  The problem seems to be at line 508 of cake/libs/view/view.php. (I'm
  using 1.2.0.7962)  This is where the view class outputs a cached view
  file, if valid.  The only check here for alternative document mime-
  types is this confusing check for a layout named 'xml':

     if ($this-layout === 'xml') {
       header('Content-type: text/xml');
     }

  The cache file doesn't have any properties that retain the extension
  or type that would have been used by RequestHandler (or other code) to
  find the right content type. However, $this-here does capture the
  extension implicitly.

  It seems the proper thing for the caching mechanism to do is to store
  the content type as a variable in the view cache file (eg, $this-ext
  or $this-content_type) so that the proper header can be recreated
  with the cache request.  However, I don't know much about the CakePHP
  internals so I'll defer primarily to explaining the situation in hopes
  of filing a good bug and rallying a fix.  This seems like a major
  oversight in the caching system as feeds (ajax, json, xml) are
  becoming an increasingly critical part of any modern web application.

  Has anyone noticed this before? Known workaround (without modifying
  cake lib code)? Is a bug already filed on this that I couldn't find?
  Anything else I'm missing here?

 That's how the book handles 
 it:http://thechaw.com/cakebook/source/views/layouts/rss/default.ctp

 hth,

 AD
--~--~-~--~~~---~--~~
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: File Upload Limit?

2009-01-26 Thread brian

What are your php.ini settings? Did you check those?

On Mon, Jan 26, 2009 at 3:01 PM, Lamonte sche...@gmail.com wrote:
 Okay so the file is 9mb in size.  I try to upload the pdf file in firefox it
 sends me back to the upload page.  When uploading smaller files like 1mb it
 works fine.  Any solutions?

 On Sun, Jan 25, 2009 at 8:56 AM, Smelly_Eddie ollit...@gmail.com wrote:

  What exactly is 'dont work out well'?

 By default Apache does not limit size, and you would see a 403 or 413
 error if that was at fault, but by default does cap script execution
 to 300 seconds.

 To expand on Jon's comment;
 MOre likely is PHP configuration.

 To check the limits on php use phpinfo() in a script and check the
 output for these values

 upload_max_filesize- max file size

  max_execution_time- max time the parser will deal with a script

 max_input_time   - max time a script may deal with POST, GET or file
 uploads.

 post_max_size  - Sets max size of post data allowed. This setting
 also affects file upload.



 On Jan 25, 1:51 am, Jon Bennett jmbenn...@gmail.com wrote:
   It allows me to upload smaller pdf files with no problem, but huge
   pdf's
   dont work out well.  Could this be a server issue or what?  What could
   I do
   to try debugging this issue?
 
  What browser/OS are they using? I've had big issues with Safari on OSX
  with uploads timing out and just failing, it's a known bug. In my
  experience anything  100kb will fail,very annoying, wasted a _long_
  time trying to make my server work! FireFox etc all fine though.
 
  http://www.google.co.uk/search?q=safari%20large%20uploads%20bug
 
  Failing that, check your php config allow uploads at that size and
  have a time limit that won't cut off midway through.
 
  Cheers,
 
  Jon
 
  --
 
  jon bennett
  w:http://www.jben.net/
  iChat (AIM): jbendotnet Skype: jon-bennett




 --
 For all your Programming and Technology Information Visit
 www.BinaryCrunch.com

 


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



Re: Auth Issues - Session Comes And Goes

2009-01-26 Thread Alfredo Quiroga-Villamil

I think I've figured out what was happening.

If Security.Level is set to high, then cakephp will re-generate the
session id for every request. This seems to cause issues when you have
an application sending multiple ajax requests; for example during
heavy ajax gui initialization. By setting it to medium the issue was
resolved.

Hope this helps someone in the future as it wasn't apparent to me
right away. I am going to def. spend a bit of time reading over the
core.php file.

Regards,

Alfredo

On Mon, Jan 26, 2009 at 12:31 AM, lawwton laww...@gmail.com wrote:

 All:

 I am having some weird issues using Auth and after some investigation
 with little results I've decided to post some questions since I am
 sure I must be missing something; but I have not been able to find out
 what it is.

 The issue I have is the following:

 For some reason after generating 3 ajax requests and also doing this
 after having successfully logged in, my session information seems to
 loose the user information I had received and stored automagically in
 Auth-user(). This sporadically changes, meaning that in some cases I
 can see it for one controller. Then I don't see it after login back in
 and re-running the 3 ajax requests for the different controllers.
 Again I will see the session info (user) for a different controller
 this time

 Essentially what I am doing is that after I login I load up some
 JavaScripts Objects that I will use for my front-end (GUI) interface.
 I do this by sending 3 ajax requests for example and holding on to the
 information received from them.

 To add to the confusion after not properly seeing the correct user
 session information set by Auth-user(). I can then continuously call
 the controller/action from my browser and this time I will get the
 session information every time regardless of which controller I use.

 I have no idea why is behaving like that. Can someone please let me
 know what the possible issue is. The main functions for the 3
 controllers are shown below.

 Thanks in advance.


 In my AppController I have the following:

  var $components = array('Auth', 'Session', 'RequestHandler');

public function beforeFilter() {
$this-Auth-loginAction = array('controller' = 'portal', 
 'action'
 = 'login');
$this-Auth-loginRedirect = array('controller' = 'portal',
 'action' = 'main');
$this-Auth-logoutRedirect = array('controller' = 'portal',
 'action' = 'index');
$this-Auth-autoRedirect = false;
} // End of beforeFilter()

 Then I have 3 controllers to which I send ajax requests via POST.

 Function from Controller 1:

public function getGroups() {

$this-layout = 'ajax';
$aTariffGroup = array();
$this-log(TARIFFGROUP, LOG_DEBUG);
$this-log($_SESSION, LOG_DEBUG);

if ( $this-RequestHandler-isAjax() ) {

if ( $this-User-Group-getGroupName($this-Auth-user
 ('group_id')) != 'superusers' ) {
$aTariffGroup = 
 $this-CcTariffgroup-getGroups($this-Auth-user
 ('tariff_id'));
} else {
$aTariffGroup = 
 $this-CcTariffgroup-getGroups();
}

$jTariffGroup = Set::extract($aTariffGroup, 
 '{n}.cc_tariffgroup');
$this-set('j_groups', $jTariffGroup);
}

} // End of getGroups()

 Function from Controller 2:

public function getTrunkGroups() {

$this-log(TRUNKSSS, LOG_DEBUG);
$this-log($_SESSION, LOG_DEBUG);
$this-layout = 'ajax';

if ( $this-RequestHandler-isAjax() ) {

$iTotalProperty = $this-CcTrunk-find('count');
$aTrunks = $this-CcTrunk-find('all');
$jTrunks = Set::extract($aTrunks, '{n}.CcTrunk');

$this-set('total', $iTotalProperty);
$this-set('trunkgroups', $jTrunks);

}

} // End of getTrunkGroups()

 Function from Controller 3:

public function getGroups() {

$this-log(GROUPSS, LOG_DEBUG);
$this-log($_SESSION, LOG_DEBUG);

$this-layout = 'ajax';

if ( $this-RequestHandler-isAjax() ) {

$i_count = $this-Group-find('count');
$a_groups = $this-Group-find('all');
$j_groups = Set::extract($a_groups, '{n}.Group');

$this-set('j_groups', $j_groups);
$this-set('i_total', $i_count);

}

} // End of getGroups()

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To 

Re: File Upload Limit?

2009-01-26 Thread Lamonte
upload_max_filesize2M2Mmax_execution_time3030 max_input_nesting_level6464
max_input_time6060
Hmm

On Mon, Jan 26, 2009 at 2:13 PM, brian bally.z...@gmail.com wrote:


 What are your php.ini settings? Did you check those?

 On Mon, Jan 26, 2009 at 3:01 PM, Lamonte sche...@gmail.com wrote:
  Okay so the file is 9mb in size.  I try to upload the pdf file in firefox
 it
  sends me back to the upload page.  When uploading smaller files like 1mb
 it
  works fine.  Any solutions?
 
  On Sun, Jan 25, 2009 at 8:56 AM, Smelly_Eddie ollit...@gmail.com
 wrote:
 
   What exactly is 'dont work out well'?
 
  By default Apache does not limit size, and you would see a 403 or 413
  error if that was at fault, but by default does cap script execution
  to 300 seconds.
 
  To expand on Jon's comment;
  MOre likely is PHP configuration.
 
  To check the limits on php use phpinfo() in a script and check the
  output for these values
 
  upload_max_filesize- max file size
 
   max_execution_time- max time the parser will deal with a script
 
  max_input_time   - max time a script may deal with POST, GET or file
  uploads.
 
  post_max_size  - Sets max size of post data allowed. This setting
  also affects file upload.
 
 
 
  On Jan 25, 1:51 am, Jon Bennett jmbenn...@gmail.com wrote:
It allows me to upload smaller pdf files with no problem, but huge
pdf's
dont work out well.  Could this be a server issue or what?  What
 could
I do
to try debugging this issue?
  
   What browser/OS are they using? I've had big issues with Safari on OSX
   with uploads timing out and just failing, it's a known bug. In my
   experience anything  100kb will fail,very annoying, wasted a _long_
   time trying to make my server work! FireFox etc all fine though.
  
   http://www.google.co.uk/search?q=safari%20large%20uploads%20bug
  
   Failing that, check your php config allow uploads at that size and
   have a time limit that won't cut off midway through.
  
   Cheers,
  
   Jon
  
   --
  
   jon bennett
   w:http://www.jben.net/
   iChat (AIM): jbendotnet Skype: jon-bennett
 
 
 
 
  --
  For all your Programming and Technology Information Visit
  www.BinaryCrunch.com
 
  
 

 



-- 
For all your Programming and Technology Information Visit
www.BinaryCrunch.com

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



Re: Rendering non-HTML: templates vs. elements

2009-01-26 Thread Ben

I think I've figured it out:

1) the requestAction call in the page element is not neccessary - the
data is already available from the first pass through the controller
2) the reason my code was not completing was that the iCalcreator's
returnCalendar() method ends in die() (why would this be a good
thing?)

Once I: removed the requestAction call in the element file; rewrote
the calendar rendering helper to use iCalcreator::createCalendar which
doesn't die at the end; and set the layout in my controller ($this-
layout = ical;); then all seems well.


On Jan 26, 2:52 pm, BenL benjamin.d@gmail.com wrote:
 My app uses ical-like events and I'd like to make these events
 available for subscription from Google Calendar, Apple iCal, etc. The
 guide athttp://www.365webapplications.com/2009/01/09/cakephp-calendar/
 helped me set up iCalcreator as a Helper.

 However I'm confused on use of a view template vs. element: from the
 Cake doc, I would have expected to use a template that defines the
 overall layout (in this case, it would be empty as iCalcreator's
 render takes care of everything); then the view would create an
 iCalcreator object from the data provided by the controller and render
 it to $content_for_layout.

 However, the 365webapplications approach invokes the controller action
 via a requestAction in an element, the element then creates the
 iCalcreator object renders it. No template is used. When I do this, I
 find that the controller action gets called twice, and seems to get
 cut off prematurely:

 i.e. my controller and element (simplified):

 controllers/events_controller.php:
 ?
 class EventsController extends AppController {

     function ical() {

         $this-helpers[] = 'ICal';  // pull in the i_cal helper
         $this-Event-recursive = 0;    // don't need associated data

         $events = $this-Event-find('all');

         // called via a requestAction?
         if (isset($this-params['requested']))  {
             echo controllers/events_controller: requestedp;
             return $events;
         }

         echo controllers/events_controller, setting eventsp;
         $this-set('events', $events);
         echo controllers/events_controller, donep;
     }}

 ?

 views/elements/events.ctp
 ?php
     echo views/elements/events.ctp 1p;
     $events = $this-requestAction('events/ical');
     echo views/elements/events.ctp 2p;

     $iCal-create();

     echo views/elements/events.ctp 3p;
     foreach($events as $e)
     {
         $iCal-addEvent(
             $e['Event']['datestart'],
             $e['Event']['dateend'],
             $e['Event']['summary'],
             $e['Event']['description']
         );
     }
     $iCal-render();
     echo pviews/elements/events.ctp 4p;
 ?

 views/events/ical.ctp:
 ?php
 echo views/events/ical.ctp startp;
 //echo $this-element('events', array('cache'='+1 hour'));
 echo $this-element('events');
 echo views/events/ical.ctp endp;
 ?

 Now, when I call the action, I get:

 controllers/events_controller, setting events

 controllers/events_controller, done

 views/events/ical.ctp start

 views/elements/events.ctp 1

 controllers/events_controller: requested

 views/elements/events.ctp 2

 views/elements/events.ctp 3

 then some warnings about cannot modify header - which is fine as
 I'm just debugging now, and the output of iCal-render
 BEGIN:VCALENDAR METHOD:PUBLISH ... :VEVENT END:VCALENDAR

 and that's it: the line in the element after the render doesn't get
 called, nor does the line after the 'echo $this-element('events');'
 in the view

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



Re: Help w/ DebugKit - no toolbar

2009-01-26 Thread Ben

I don't have any requestAction calls, and my debug level is 2.

$ grep -r requestAction app
$ grep -r Configure::write('debug', app/config/
app/config/core.php:Configure::write('debug', 2);

I'll keep at it...

On Jan 27, 3:00 am, Samuel DeVore sdev...@gmail.com wrote:
 I have seen this with pages (or templates) that have requestAction
 used in them.  I'm not sure if it the result of clearing of the output
 buffer in requestAction or something else.

 Sam D

 On Mon, Jan 26, 2009 at 6:24 AM, BenL benjamin.d@gmail.com wrote:

  I'm attempting to use DebugKit perhttp://thechaw.com/debug_kit/wiki,
  with cake_1.2.1.8004. I've downloaded debug_kit from
 http://github.com/cakephp/debug_kit/tree/masterand placed it into my
  app/plugins directory.

  After an initial hiccup with file permissions, I've hit a stumbling
  block in that I don't have the toolbar on my DebugKit-enabled page. My
  controller:

  ?
  class EventsController extends AppController {
     var $scaffold;
     var $components = array('DebugKit.Toolbar');
  ?

 http://.../events/returns the same content regardless of the
  $components line.

  I have the default debug level, 2 (i.e. I can see the SQL log), I'm
  using Firefox 3 w/ Firebug and FirePHP installed.

  What am I missing?
--~--~-~--~~~---~--~~
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: File Upload Limit?

2009-01-26 Thread Jon Bennett

 upload_max_filesize2M2M

there's ya problem then! can't upload a 9mb file if the limit is set
at 2M. Do you have permission to change it? if not, looks like a
switch of host is required.

j

-- 

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

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



Re: Help w/ DebugKit - no toolbar

2009-01-26 Thread mark_story

You are using a scaffold.  This is not going to work as far as I
know.  At least I never tried to use debugKit with a scaffold.
Scaffolds require their own view class and it is highly probably that
the view class from the scaffold is replacing the debug view.  Which
will result in no toolbar.

-Mark

On Jan 26, 4:06 pm, Ben benjamin.d@gmail.com wrote:
 I don't have any requestAction calls, and my debug level is 2.

 $ grep -r requestAction app
 $ grep -r Configure::write('debug', app/config/
 app/config/core.php:    Configure::write('debug', 2);

 I'll keep at it...

 On Jan 27, 3:00 am, Samuel DeVore sdev...@gmail.com wrote:

  I have seen this with pages (or templates) that have requestAction
  used in them.  I'm not sure if it the result of clearing of the output
  buffer in requestAction or something else.

  Sam D

  On Mon, Jan 26, 2009 at 6:24 AM, BenL benjamin.d@gmail.com wrote:

   I'm attempting to use DebugKit perhttp://thechaw.com/debug_kit/wiki,
   with cake_1.2.1.8004. I've downloaded debug_kit from
  http://github.com/cakephp/debug_kit/tree/masterandplaced it into my
   app/plugins directory.

   After an initial hiccup with file permissions, I've hit a stumbling
   block in that I don't have the toolbar on my DebugKit-enabled page. My
   controller:

   ?
   class EventsController extends AppController {
      var $scaffold;
      var $components = array('DebugKit.Toolbar');
   ?

  http://.../events/returnsthe same content regardless of the
   $components line.

   I have the default debug level, 2 (i.e. I can see the SQL log), I'm
   using Firefox 3 w/ Firebug and FirePHP installed.

   What am I missing?
--~--~-~--~~~---~--~~
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: What is automated and what is not?

2009-01-26 Thread mark_story

This is not an appropriate function for a framework.  Implementing
these types of features at the framework level leads to excessive
bloat.  All the tools you need are already in core.  You just have to
put them together :)  There are  number of tutorials and sample
applications around if you look for / ask for them

-Mark

On Jan 26, 12:01 pm, Delirium tremens pedbe...@gmail.com wrote:
 I am going to add remember me and activate account features to my
 login system. Why is it not built in CakePHP? Are remember me and
 activate account not common enough? What is automated and what is not?
 Why?
--~--~-~--~~~---~--~~
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: File Upload Limit?

2009-01-26 Thread Lamonte
yeah I own a vps

On Mon, Jan 26, 2009 at 3:23 PM, Jon Bennett jmbenn...@gmail.com wrote:


  upload_max_filesize2M2M

 there's ya problem then! can't upload a 9mb file if the limit is set
 at 2M. Do you have permission to change it? if not, looks like a
 switch of host is required.

 j

 --

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

 



-- 
For all your Programming and Technology Information Visit
www.BinaryCrunch.com

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



Using jQuery

2009-01-26 Thread WidePixels

Is there something special I need or am missing with using jQuery? I
have the jquery.php im my views/helpers but no matter what i try to
create i get is not a function or syntax error in !DOCTYPE

I have downloaded demos of jquery apps, tested fine running them in a
normal php page. Copy the HTML code into my view, add the scripts used
in the demo to ?php $javascript-link(array('jquery.easing.1.3'),
false); ?

Added the javascript that is in the demo to my view.

I checked using FireBug and I can see the scripts in the HEAD
correctly, but nothing happens.

What am I doing wrong? Missing?

Basically i am trying to build the accordian as seen on
http://bassistance.de/jquery-plugins/jquery-plugin-accordion/


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



Re: Using jQuery

2009-01-26 Thread brian

Are you using $(document).ready()? Is jQuery loading *before* any of
your own code that uses it?

What, exactly, are the errors you're seeing?

On Mon, Jan 26, 2009 at 6:08 PM, WidePixels d...@widepixels.com wrote:

 Is there something special I need or am missing with using jQuery? I
 have the jquery.php im my views/helpers but no matter what i try to
 create i get is not a function or syntax error in !DOCTYPE

 I have downloaded demos of jquery apps, tested fine running them in a
 normal php page. Copy the HTML code into my view, add the scripts used
 in the demo to ?php $javascript-link(array('jquery.easing.1.3'),
 false); ?

 Added the javascript that is in the demo to my view.

 I checked using FireBug and I can see the scripts in the HEAD
 correctly, but nothing happens.

 What am I doing wrong? Missing?

 Basically i am trying to build the accordian as seen on
 http://bassistance.de/jquery-plugins/jquery-plugin-accordion/


 Thanks,
 Dave
 


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



set(compact('whatever'))

2009-01-26 Thread brian

I'm putting together a component to move a bunch of logic out of one
of my controllers. The component has a method whose sole purpose is to
set a number of vars for a view that's tightly-coupled to the
component. I wanted to do it this way because there are several places
where these are required to be set, though the values come from
different places. This way, I can pass the values t the component and
have it set everything the way it requires.

Anyway, my component method looks something like:

public function setStuff($foo, $bar, $something_else)
{
  $this-controller-set(compact('foo', 'bar', 'something_else'));
}

The component also has this startup method:

function startup($controller)
{
$this-controller = $controller;
}

(and, of course, a $controller member var)

Unfortunately, this doesn't appear to be working--I'm getting
undefined vars in the view. Is there any reason why I couldn't set
view vars from the component like this? I know the vars are available
in the symbol table, of course, though I did put a debug(compact(...))
in there, just to be sure.

--~--~-~--~~~---~--~~
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: Plugin's model methods is missing

2009-01-26 Thread jaro


On Jan 26, 11:20 pm, Martin Westin martin.westin...@gmail.com wrote:
 Oh, and don't think that it is enough to only check the relevant
 places. If you have a model loaded that has an error in the
 association this can affect your controller's direct relation to
 OrderProduct.

thanks RoVo and Martin for the help. I double checked the naming in my
controller but did not thought that I should also add one in the
plugin's models. When I did, it worked.

thanks again!

jaro
--~--~-~--~~~---~--~~
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: Help w/ DebugKit - no toolbar

2009-01-26 Thread Ben

 You are using a scaffold.  ... the view class from the scaffold is replacing 
 the debug view

Ah, indeed - I'm still fiddling with that part of my app's schema, and
am very new to Cake/PHP/web apps, so am relying heavily on
scaffolding. I have tried the debugkit component in a bake-created
controller (no scaffolding) and the debugkit toolbar stuff is showing
up, but inline on the page (after my content but before the SQL log).

(sorry for cross-posting this on your blog, I need to practice more
patience :-)

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



Re: set(compact('whatever'))

2009-01-26 Thread brian

So I just got a clue and stuck this right after my call to the component:

die(debug($this-viewVars));

It turns out that Cake sets loose Inflector upon the var names! What
kind of inane feature is that?!? And no flag to keep it from doing
so!

I think I'm going to have to break down and alter Cake core for this.
Please, someone talk me down from the ledge and explain to me why this
isn't a bug and I really should appreciate it.

On Mon, Jan 26, 2009 at 6:54 PM, brian bally.z...@gmail.com wrote:
 I'm putting together a component to move a bunch of logic out of one
 of my controllers. The component has a method whose sole purpose is to
 set a number of vars for a view that's tightly-coupled to the
 component. I wanted to do it this way because there are several places
 where these are required to be set, though the values come from
 different places. This way, I can pass the values t the component and
 have it set everything the way it requires.

 Anyway, my component method looks something like:

 public function setStuff($foo, $bar, $something_else)
 {
  $this-controller-set(compact('foo', 'bar', 'something_else'));
 }

 The component also has this startup method:

 function startup($controller)
 {
$this-controller = $controller;
 }

 (and, of course, a $controller member var)

 Unfortunately, this doesn't appear to be working--I'm getting
 undefined vars in the view. Is there any reason why I couldn't set
 view vars from the component like this? I know the vars are available
 in the symbol table, of course, though I did put a debug(compact(...))
 in there, just to be sure.


--~--~-~--~~~---~--~~
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: XAMMP for Windows with cakePHP

2009-01-26 Thread Sharmo

Hi All,

Thank you for your feedback. It took quite some time for this message
of mine to be displayed in this forum. I have installed WAMP and
removed XAMPP since I posted this a number of days ago.

My apologies for the inconvenience.

Regards

Peter


On Jan 20, 1:41 pm, Jorge Horacio Cué Cantú jorge@gmail.com
wrote:
 Hello,

 Depending on your operating system, for example for Linux:

 sudo mkdir /opt/lampp/htdocs/myproject
 sudo cp -r ~/myproject/* /opt/lampp/htdocs/myproject
 sudo chown -R nobody:nobody /opt/lampp/htdocs/myproject

 Where myproject is the directory for your project.

 Do not copy cake directly under htdocs/ because it breaks lampp
 installation.

 Or if you are using Windows

 Just make a directory under C;\xampp\htdocs and copy all your code under it.

 Either case usehttp://localhost/myprojectto access your application.

 Regards

 2009/1/18 Sharmo pe...@ozhonours.com



  I am not sure if my first post worked. I am therefore posting again.

  I am using XAMPP for Windows as my localhost server.

  When I try tho view my application after baking it. There is no CSS
  or images being renered.

  I have tred the forums at both XAMPP and PHPVideotutorials without
  success.

  Please help.

  Regards

  Peter

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



Problem to use Ajax layout.

2009-01-26 Thread Mahesh Sutar

I am using ajax in ctp page to populate table.
number of rows I am reading from text box and passing to view action

I am able to get table structure, but Its overlapping on footer which
is present in default layout.

Any one has solution for this?

Thanks in advance.

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



Re: XAMMP for Windows with cakePHP

2009-01-26 Thread powtac

I created a step-by-step installation tutorial for windows XP and
cakephp, its in german, but maybe it helps: http://www.kolchose.org/bc0711/

On 19 Jan., 02:12, Sharmo pe...@ozhonours.com wrote:
 I am not sure if my first post worked. I am therefore posting again.

 I am using XAMPP for Windows as my localhost server.

 When I try tho view my application after baking it. There is no CSS
 or images being renered.

 I have tred the forums at both XAMPP and PHPVideotutorials without
 success.

 Please help.

 Regards

 Peter
--~--~-~--~~~---~--~~
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: set(compact('whatever'))

2009-01-26 Thread brian

I was ruminating over the code while having dinner just now and
remembered something. I realised that set() does provide a way to
avoid Inflector having its way with one's var names:

00640 foreach ($data as $name = $value) {
00641 if ($name === 'title') {
00642 $this-pageTitle = $value;
00643 } else {
00644 if ($two === null  is_array($one)) {
00645 $this-viewVars[Inflector::variable($name)] = $value;
00646 } else {
00647 $this-viewVars[$name] = $value;
00648 }
00649 }
00650 }

I just needed to pass false as the second param. 3 cheers for
undocumented features!

On Mon, Jan 26, 2009 at 7:09 PM, brian bally.z...@gmail.com wrote:
 So I just got a clue and stuck this right after my call to the component:

 die(debug($this-viewVars));

 It turns out that Cake sets loose Inflector upon the var names! What
 kind of inane feature is that?!? And no flag to keep it from doing
 so!

 I think I'm going to have to break down and alter Cake core for this.
 Please, someone talk me down from the ledge and explain to me why this
 isn't a bug and I really should appreciate it.

 On Mon, Jan 26, 2009 at 6:54 PM, brian bally.z...@gmail.com wrote:
 I'm putting together a component to move a bunch of logic out of one
 of my controllers. The component has a method whose sole purpose is to
 set a number of vars for a view that's tightly-coupled to the
 component. I wanted to do it this way because there are several places
 where these are required to be set, though the values come from
 different places. This way, I can pass the values t the component and
 have it set everything the way it requires.

 Anyway, my component method looks something like:

 public function setStuff($foo, $bar, $something_else)
 {
  $this-controller-set(compact('foo', 'bar', 'something_else'));
 }

 The component also has this startup method:

 function startup($controller)
 {
$this-controller = $controller;
 }

 (and, of course, a $controller member var)

 Unfortunately, this doesn't appear to be working--I'm getting
 undefined vars in the view. Is there any reason why I couldn't set
 view vars from the component like this? I know the vars are available
 in the symbol table, of course, though I did put a debug(compact(...))
 in there, just to be sure.



--~--~-~--~~~---~--~~
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: Help w/ DebugKit - no toolbar

2009-01-26 Thread Ben

I've found if I explicitly include the debug_toolbar CSS to views/
layouts/default.ctp, and make a symlink from webroot/css/
debug_toolbar.css to
../../plugins/debug_kit/vendors/css/debug_toolbar.css, the toolbar is
rendered as a toolbar at the top of the page. i.e.

html
head
titleMy App/title
?=$html-css('cake.generic');?
?=$html-css('debug_toolbar');?
/head
...

Are those two steps as expected?

Now on to getting FireCake working :-)

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



Problem with routing using Javascript's location.href

2009-01-26 Thread MichTex

I have been working for a number of months on an application using
CakePHP, and have for the most part found it to be a very congenial
development environment. However, for the last few weeks I've been
struggling with what looks to be some peculiar CakePHP behavior.
Basically, I am trying to implement keyboard shortcuts (hotkeys) using
simple Javascript event handling to capture keycodes, and then, via
the browser's location.href property, route the user to the
appropriate page. This approach works great most of the time. However,
there are a couple of users for whom this approach causes the browser
to route them to the login page rather than the desired page. I have
rummaged through hundreds of postings here in the CakePHP Google
group, and done dozens of Google searches through CakePHP
documentation and numerous relevant blogs, but so far have turned up
no clues to what the problem is.

Let me expand on the details a little bit:

-The application I am working on mostly provides a few basic screens
which present blocks of text followed either by simple forms, or by
sets of link-type or button-type navigation choices. This part of the
system works very well.

-Recently, the product director wanted me to add hotkeys to speed up
navigation. For example, in cases where the navigation consists of a
short list of choices, he wants the user to be able to type a single
digit associated with each choice. Thus, if there were 5 navigation
choices, numbered 1 to 5, the user could either use the mouse to click
on any of the 5 links for those choices, or type the individual digits
1 to 5 on the keyboard to select the corresponding link. In another
case, there is an informational screen with a big Next button at the
bottom. The product director wants the user to be able to go to the
next page either by clicking on the Next button with the mouse, or by
typing either the letter 'n' or a carriage return.

-In order to implement the hotkey idea, I wrote some CakePHP code to
generate simple Javascript to capture keycodes from keypress events,
and then execute for particular characters a Javascript line of the
form

  location.href = 'http://mysite.com/controller/action/arg';

which would cause the browser to switch to the specified page. [I used
the Event class from the Prototype Javascript library together with
CakePHP's Javascript Helper. I've attached an example of the kind of
Javascript that gets generated to the end of this posting.]

-When I wrote the hotkey-handling code several weeks ago, it appeared
to work fine. In fact, it continues to work perfectly for me. Here's
where it gets weird, though. About 90% of the time, when the product
director himself tries a hotkey, he ends up on a login screen, as if
he had been logged out. However, if he hits the back button, and then
uses the mouse to make a choice on the screen he had been on, that
works fine. So, he had not in fact been logged out.

-The product director has so far tried this with 3 different browsers
(IE, Firefox and Chrome) on 5 different machines in 2 different
locations, and gotten the same bad behavior in roughly the same 90/10
bad/good behavior split. There are two other people involved with this
project, as well. For one of them, like me, the hotkeys have never
failed, while for the other user hotkey navigation has almost always
worked, but has in fact failed a few times.

So, can anyone provide some insight into this situation? Is there any
reason why routing to a CakePHP page using Javascript's location.href
should always work for some users, most of the time for other users,
and rarely for yet others? Is there an alternative way to route to a
CakePHP page from Javascript? Or is there some other way to implement
a hotkey capability?

Thanks in advance for any help or advice you can give.

BillCavnar
-
Example of the generated Javascript code for handling hotkeys:

script type=text/javascript src=/js/prototype.js/script
script type=text/javascript
//![CDATA[
Event.observe(window, 'load', function() {
  Event.observe(document, 'keypress', function(e){
var code;
if (!e) {
  var e = window.event;
}
if (e.keyCode) {
  code = e.keyCode;
} else if (e.which) {
  code = e.which;
}
var character = String.fromCharCode(code);
switch(character) {
  case '1':
location.href = 'http://http://mysite.com/worksheet/
show_answer/1';
break;
  case '2':
location.href = 'http://http://mysite.com/worksheet/
show_answer/2';
break;
  case '3':
location.href = 'http://http://mysite.com/worksheet/
show_answer/3';
break;
  case '4':
location.href = 'http://http://mysite.com/worksheet/
show_answer/4';
break;
  case '5':
location.href = 'http://http://mysite.com/worksheet/
show_answer/5';
break;
}
  });
});

//]]
/script


--~--~-~--~~~---~--~~
You 

  1   2   >