Re: Definir quais campos devem ser retornados

2007-05-29 Thread RoadHouse Blues

o cake tem suporte a sql tb se tudo mais falhar...

mas eu acho que esse campo ja esta no seu resultado nao? da um dump do
resultado proce ver melhor...

On 5/23/07, hostdesigner [EMAIL PROTECTED] wrote:

 findAll()

 Tenho alguns relacionamentos onde eu preciso apenas do id e do
 nomeCategoria e sempre está retornando todos os dados o que poderia
 gerar uma certa lentidão dependendo da quantidade de informações.

 Falopa!



 On 23 maio, 18:52, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:
  qual função vc tá usando?
  o primeiro parametro da função read() é os campos...


 


--~--~-~--~~~---~--~~
Recebeu esta mensagem porque se subscreveu no Grupo Cake PHP Português do 
Google Groups.
 Para postar neste grupo, envie email para cake-php-pt@googlegroups.com
 Para cancelar a sua inscrição deste grupo envie um email para [EMAIL PROTECTED]
 Para mais opções, visite este grupo em 
http://groups.google.com/group/cake-php-pt?hl=pt-PT
-~--~~~~--~~--~--~---



Re: Executar o método em todas as páginas

2007-05-29 Thread RoadHouse Blues

voce pode usar dois layouts diferentes ne? um com o menu e outro sem

e nos seus controllers voce seta qual layout usar... acho que é so
setar a variavel $layout  no controller...


(eu acho que eu ando dando respostas muito vagas por aqui ne? hehehhe)

On 5/23/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 coloque no App_controller


 


--~--~-~--~~~---~--~~
Recebeu esta mensagem porque se subscreveu no Grupo Cake PHP Português do 
Google Groups.
 Para postar neste grupo, envie email para cake-php-pt@googlegroups.com
 Para cancelar a sua inscrição deste grupo envie um email para [EMAIL PROTECTED]
 Para mais opções, visite este grupo em 
http://groups.google.com/group/cake-php-pt?hl=pt-PT
-~--~~~~--~~--~--~---



Re: Problemas com sessions

2007-05-29 Thread RoadHouse Blues

que esquisito...

nao sei o que pode ser...

pode ser algum erro da query ou algo assim eu juro que ja tive esse
erro mas nao lembro porque (maldito seja eu que nao ponho nada no
historico da lista)

On 5/21/07, hostdesigner [EMAIL PROTECTED] wrote:

 No Homes_controller existe somente isso

 ?PHP
 class HomesController extends AppController {

 var $name = Homes;

 var $uses = array('Produto', 'Config');

 function index(){
 // GROUP BY Produto.nomeProduto ORDER BY Produto.nomeProduto 
 ASC
 $this - set(dadosHomeProduto, $this - Produto -
 findAll(Produto.nome_produto != '' LIMIT 4));//

 // LISTA AS CONFIGURAÇÕES
 //$this - Config - Config.nomeConfig = 'listaProduto' AND
 Config.config LIKE 'palavra:%'
 //$this - set(dadosHome, $this - Config - findAll(GROUP 
 BY
 Config.nomeConfig ORDER BY Config.nomeConfig ASC));
 $this - set(dadosHome, $this - Config - findAll(ORDER BY
 Config.nomeConfig ASC));

 }

 }
 ?




 On 20 maio, 01:52, RoadHouse Blues [EMAIL PROTECTED] wrote:
  vc ja viu o que acontece na linha 1 do homes_controller.php?
 
  On 5/19/07, hostdesigner [EMAIL PROTECTED] wrote:
 
 
 
   ï¿
   Warning: session_start() [function.session-start]: Cannot send session
   cache limiter - headers already sent (output started at D:\DW\xampp
   \htdocs\barato\app\controllers\homes_controller.php:1) in D:\DW\xampp
   \htdocs\barato\cake\libs\session.php on line 154
 
   Warning: Cannot modify header information - headers already sent by
   (output started at D:\DW\xampp\htdocs\barato\app\controllers
   \homes_controller.php:1) in D:\DW\xampp\htdocs\barato\cake\libs
   \session.php on line 155
 
   Este erro sempre aparece quando navego por páginas dentro do site e
   depois retorno pra home, o extranho é que eu não criei session alguma.
 
   Alguém sabe por que isso ocorre ou como evitar este problema?
 
   Falopa!


 


--~--~-~--~~~---~--~~
Recebeu esta mensagem porque se subscreveu no Grupo Cake PHP Português do 
Google Groups.
 Para postar neste grupo, envie email para cake-php-pt@googlegroups.com
 Para cancelar a sua inscrição deste grupo envie um email para [EMAIL PROTECTED]
 Para mais opções, visite este grupo em 
http://groups.google.com/group/cake-php-pt?hl=pt-PT
-~--~~~~--~~--~--~---



Re: CakePHP php5?

2007-05-29 Thread haj

PHP4 support is one of the most important features and advantages and
selling point of cakePHP. This is not for some CS student's research
homework. Work in the field and realise a significance of PHP4
support.

On May 28, 11:16 am, R. Rajesh Jeba Anbiah
[EMAIL PROTECTED] wrote:
 On May 28, 7:08 pm, nate [EMAIL PROTECTED] wrote:

  What do you mean by museum versions?  You mean that PHP4 is old, or
  that nobody uses it?  Oh wait, over 90% of public webservers still use
  it.  Nevermind

IMHO, it's always better to move upward. If you gonna support PHP
 FI, 3, etc, there is no end. For the host, it's not their will, but
 some people prefer the PHP 4 like they did prefer 3 when 4 came and
 etc. There is no end...

 --
   ?php echo 'Just another PHP saint'; ?
 Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/


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



Re: Displaying the array

2007-05-29 Thread [EMAIL PROTECTED]

what do you have now for looping over the $users?



On May 28, 10:07 pm, hashkash [EMAIL PROTECTED] wrote:
 Here is the array I obtain after a findByUsername().
 $recursive=1, foreign key for equipment is owner i.e i wopuld like to
 see only the owners equipment.
 I want to print the Equipment part in the form of a table.Im unable to
 figure out how.
 Hoping for some help!
 Thanks!

 Array
 (
 [User] = Array
 (
 [id] = 1
 [username] = hashkash
 [password] = 7d7982cc30b26508c71c10836ec12840
 [email] = [EMAIL PROTECTED]
 [first_name] = Kashyap
 [last_name] = Thimmaraju
 [last_login] = 2007-05-29 04:18:36
 [owner] = 1
 [incharge] = 1
 )

 [Equipment] = Array
 (
 [0] = Array
 (
 [eqno] = 1234
 [slno] =
 [description] =
 [specification] =
 [owner] = hashkash
 [incharge] = kashyap
 [type] = computer
 [dop] = 2007-05-22 09:38:32
 [dow] = -00-00 00:00:00
 [w_incharge] =
 [w_phone] = 0
 [w_addr] =
 )

 [1] = Array
 (
 [eqno] = 98765
 [slno] = 12387
 [description] = lfjksd
 [specification] = uiofs
 [owner] = hashkash
 [incharge] = preeti
 [type] = comp
 [dop] = 2005-11-15 11:14:00
 [dow] = 2006-01-17 14:15:00
 [w_incharge] = murajkldf
 [w_phone] = 1237843
 [w_addr] = jklfdsnmvcl
 )

 )

 )


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



Re: CakePHP php5?

2007-05-29 Thread R. Rajesh Jeba Anbiah

On May 29, 11:22 am, haj [EMAIL PROTECTED] wrote:
 PHP4 support is one of the most important features and advantages and
 selling point of cakePHP.

That guy needs PHP4, this host needs PHP4, but no one is saying
that I need a PHP4 support. This is the same scenario happened when
PHP4 is released.  It's always better to move upwards whether it's PHP
or CakePHP (how many people are going to stick to 1.1 for instance?)

 This is not for some CS student's research
 homework. Work in the field and realise a significance of PHP4
 support.

   Ok.

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



Re: Unobtrusive JavaScript validations

2007-05-29 Thread R. Rajesh Jeba Anbiah

On May 29, 9:03 am, Travis Cline [EMAIL PROTECTED] wrote:
 On May 28, 8:07 am, R.RajeshJebaAnbiah
  snip
 I'm a +1 for obtaining unobtrusive JS validation that falls back onto
 the defined validation constraints in the models.

   Thanks for your support:)

 It appears your patch covers a bit more than just serving up the
 relevant JSON.
 Maybe reducing it and cleaning it up would be beneficial.

   Yep, I did patch other things too. But, for JSON dumping it's
extremely easy.

 Also, consider the user-callbacks that can be used for more advanced
 validation -- they can't exactly be described directly in JSON...
 Because of this, It's potential that at least part of the validation
 will have to be done with XHR.
   snip

   I still believe that JSON dumping is enough as the whole validation
rules defined in PHP will going to be available to the client.

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



Re: so many queries--intentional??

2007-05-29 Thread R. Rajesh Jeba Anbiah

On May 28, 6:29 pm, Chris Hartjes [EMAIL PROTECTED] wrote:
 On 5/28/07, R.RajeshJebaAnbiah[EMAIL PROTECTED] wrote:
  I'm getting so many queries in index action of controller, say for a
  typical blog project with categories, comments and tags, I'm getting
  so many queries in blogs/index which is having
  $this-Blog-recursive = 0;
  $this-set('blogs', $this-paginate());

 This is normal behaviour, and is required for Cake's Models to do
 their associative data mapping magic.
  snip

   FWIW, I do not question the need to run the queries. But, my
question is that why it can't be optimized. With the better join
query, we can have a single query that serves the purpose, instead of
about 60 queries.

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



Re: CakePHP php5?

2007-05-29 Thread Felix Geisendörfer

 That guy needs PHP4, this host needs PHP4, but no one is saying
 that I need a PHP4 support. This is the same scenario happened when
 PHP4 is released.  It's always better to move upwards whether it's PHP
 or CakePHP (how many people are going to stick to 1.1 for instance?)
You *really* need to listen to the other folks. I'm working on one of 
the biggest cake apps around (300db tables, ~70 controllers, etc.). And 
guess what? It's 1.1. The reason for this is that the project was 
started about ~6 month ago when 1.2 was not where it's now and the team 
decided it would not be worth to the pain to constantly stay in sync 
with HEAD and deal with early adopter issues. And now guess further. 
This application won't magically convert itself to 1.2 and that is not 
because we don't want it to, but because we'll have to refactor 
thousands and thousand lines of code done in ~5000 svn commits. So yes, 
people will stick to CakePHP 1.1, PHP4 (the project I mentioned is php5) 
and other old technologies and will highly appreciate any support going 
into them. Now of course when you are starting a new project and it's 
not all that big I'm somebody who also favors the usage of cutting edge 
technology. But get real, for a really big app you need to rely on 
technologies that are somewhat proven to work depending on the 
environment you are working in. Of course, as a startup made up of a 
couple guys living on Pizza, Coke and Hope you can make the craziest 
choices and go with a Lisp-Haskell-HomebrewDB-Hybrid application or 
whatever. That's because you'll either fail or be lucky enough to 
discover a powerful combination that exceeds your wildest expectations. 
But please give the rest of a world a brief moment to catch up with you 
and don't make their life harder then necessary by promoting a no-legacy 
support doctrine.

Thanks a lot, Felix
--
http://www.thinkingphp.org
http://www.fg-webdesign.de


R. Rajesh Jeba Anbiah wrote:
 On May 29, 11:22 am, haj [EMAIL PROTECTED] wrote:
   
 PHP4 support is one of the most important features and advantages and
 selling point of cakePHP.
 

 That guy needs PHP4, this host needs PHP4, but no one is saying
 that I need a PHP4 support. This is the same scenario happened when
 PHP4 is released.  It's always better to move upwards whether it's PHP
 or CakePHP (how many people are going to stick to 1.1 for instance?)

   
 This is not for some CS student's research
 homework. Work in the field and realise a significance of PHP4
 support.
 

Ok.

 --
   ?php echo 'Just another PHP saint'; ?
 Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


 

   

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



Re: so many queries--intentional??

2007-05-29 Thread AD7six



On 29 mayo, 09:10, R. Rajesh Jeba Anbiah
[EMAIL PROTECTED] wrote:
 On May 28, 6:29 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On 5/28/07, 
 R.RajeshJebaAnbiah[EMAIL PROTECTED] wrote:
   I'm getting so many queries in index action of controller, say for a
   typical blog project with categories, comments and tags, I'm getting
   so many queries in blogs/index which is having
   $this-Blog-recursive = 0;
   $this-set('blogs', $this-paginate());

  This is normal behaviour, and is required for Cake's Models to do
  their associative data mapping magic.

   snip

FWIW, I do not question the need to run the queries. But, my
 question is that why it can't be optimized. With the better join
 query, we can have a single query that serves the purpose, instead of
 about 60 queries.

Consider what would happen if you had some of your blogs are
associated with a large number (relative to your limit) of tags/
categories/comments. You can't apply a limit to the number of
associated items, but also you can't even know how many results from
your primary table will be returned.

hth,

AD


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



Re: so many queries--intentional??

2007-05-29 Thread wluigi

The most important is that you only ask for what you need and make a
good use of $conditions,$fields,$recursive,$limit and bindModel()
unbindModel();

On May 29, 9:32 am, AD7six [EMAIL PROTECTED] wrote:
 On 29 mayo, 09:10, R. Rajesh Jeba Anbiah



 [EMAIL PROTECTED] wrote:
  On May 28, 6:29 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On 5/28/07, 
  R.RajeshJebaAnbiah[EMAIL PROTECTED] wrote:
I'm getting so many queries in index action of controller, say for a
typical blog project with categories, comments and tags, I'm getting
so many queries in blogs/index which is having
$this-Blog-recursive = 0;
$this-set('blogs', $this-paginate());

   This is normal behaviour, and is required for Cake's Models to do
   their associative data mapping magic.

snip

 FWIW, I do not question the need to run the queries. But, my
  question is that why it can't be optimized. With the better join
  query, we can have a single query that serves the purpose, instead of
  about 60 queries.

 Consider what would happen if you had some of your blogs are
 associated with a large number (relative to your limit) of tags/
 categories/comments. You can't apply a limit to the number of
 associated items, but also you can't even know how many results from
 your primary table will be returned.

 hth,

 AD


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



Country

2007-05-29 Thread cake_learner

I want to populate a select tag with country names.  The names are in
the database.  The code i have written is:

models: client.php

?php
class Client extends AppModel
{
   var $name='Client';
}
?

models: country.php
?php
class Country extends AppModel
{
   var $name='Country';

}
?

controllers:

?php
class ClientsController extends AppController
{
var $name = 'Clients';

var $uses = array('Clients', 'Country');

   function index() {

   if (!empty($this-data))
{
if ($this-Client-save($this-data))
{
$this-flash('Your post has been saved.','/clients/
register2');
}
}

   }

   function register2()
   {
 // echo $this-Country; getting error:
   }

}
?


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



Re: so many queries--intentional??

2007-05-29 Thread R. Rajesh Jeba Anbiah

On May 29, 12:32 pm, AD7six [EMAIL PROTECTED] wrote:
 On 29 mayo, 09:10, R. Rajesh Jeba Anbiah
   snip
 FWIW, I do not question the need to run the queries. But, my
  question is that why it can't be optimized. With the better join
  query, we can have a single query that serves the purpose, instead of
  about 60 queries.

 Consider what would happen if you had some of your blogs are
 associated with a large number (relative to your limit) of tags/
 categories/comments. You can't apply a limit to the number of
 associated items, but also you can't even know how many results from
 your primary table will be returned.

Thanks for your explanation. But, it's getting crazy; 50-100 queries
(unbind isn't helpful as I need the relevant data) often force me to
handcode the queries.

I still believe, something can be done here.

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


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



Re: Country

2007-05-29 Thread majna


$data = $this-Country-generateList(); # (countries table have name
and id fields)
$this-set('country', $data).
pr($data);


On May 29, 10:06 am, cake_learner [EMAIL PROTECTED] wrote:
 I want to populate a select tag with country names.  The names are in
 the database.  The code i have written is:

 models: client.php

 ?php
 class Client extends AppModel
 {
var $name='Client';}

 ?

 models: country.php
 ?php
 class Country extends AppModel
 {
var $name='Country';

 }

 ?

 controllers:

 ?php
 class ClientsController extends AppController
 {
 var $name = 'Clients';

 var $uses = array('Clients', 'Country');

function index() {

if (!empty($this-data))
 {
 if ($this-Client-save($this-data))
 {
 $this-flash('Your post has been saved.','/clients/
 register2');
 }
 }

}

function register2()
{
  // echo $this-Country; getting error:
}

 }

 ?


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



Re: so many queries--intentional??

2007-05-29 Thread AD7six



On 29 mayo, 10:46, R. Rajesh Jeba Anbiah
[EMAIL PROTECTED] wrote:
 On May 29, 12:32 pm, AD7six [EMAIL PROTECTED] wrote:

  On 29 mayo, 09:10, R. Rajesh Jeba Anbiah
snip
  FWIW, I do not question the need to run the queries. But, my
   question is that why it can't be optimized. With the better join
   query, we can have a single query that serves the purpose, instead of
   about 60 queries.

  Consider what would happen if you had some of your blogs are
  associated with a large number (relative to your limit) of tags/
  categories/comments. You can't apply a limit to the number of
  associated items, but also you can't even know how many results from
  your primary table will be returned.

 Thanks for your explanation. But, it's getting crazy; 50-100 queries
 (unbind isn't helpful as I need the relevant data) often force me to
 handcode the queries.

Does this ticket apply https://trac.cakephp.org/ticket/2448 ? If so
perhaps at some point your queries will be reduced.

In the absence of any details, if each query gives you info that isn't
already duplicated and you _need_ it, I think that's simply the way it
(has to?) works.

hth,

AD


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



Re: Country

2007-05-29 Thread Floyd

Hi cake_learner,

I suggest you test the Country Select List Helper [1]. I think it is
approximately what you are seeking.

Greetings from Catalonia.

[1] http://bakery.cakephp.org/articles/view/country-select-list-helper


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



Re: Country

2007-05-29 Thread shiva m
Thanx for replying.

I tried,

 $data = $this-Country-findAll();
print_r($data);

all the countrynames are being displayed.

if i try,
 $this-set('country', $data). pr($data);

only blank array is displayed.

further i want to know how to display it in the views.






On 5/29/07, majna [EMAIL PROTECTED] wrote:



 $data = $this-Country-generateList(); # (countries table have name
 and id fields)
 $this-set('country', $data).
 pr($data);


 On May 29, 10:06 am, cake_learner [EMAIL PROTECTED] wrote:
  I want to populate a select tag with country names.  The names are in
  the database.  The code i have written is:
 
  models: client.php
 
  ?php
  class Client extends AppModel
  {
 var $name='Client';}
 
  ?
 
  models: country.php
  ?php
  class Country extends AppModel
  {
 var $name='Country';
 
  }
 
  ?
 
  controllers:
 
  ?php
  class ClientsController extends AppController
  {
  var $name = 'Clients';
 
  var $uses = array('Clients', 'Country');
 
 function index() {
 
 if (!empty($this-data))
  {
  if ($this-Client-save($this-data))
  {
  $this-flash('Your post has been saved.','/clients/
  register2');
  }
  }
 
 }
 
 function register2()
 {
   // echo $this-Country; getting error:
 }
 
  }
 
  ?


 


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



Re: Country

2007-05-29 Thread Tobias Parent


 if i try,
  $this-set('country', $data). pr($data);
  
 only blank array is displayed.
  
 further i want to know how to display it in the views.
  
Nearly there:

// Set the country array to something the view can access. IN YOUR 
CONTROLLER:
$this-set('country',$data);

// IN YOUR VIEW:
?php echo $country['Country']['id']; ?

?php debug($country); ?
(this assumes you've got debug on, which is anybody's guess).

Regards!
 -Toby

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



Re: manage different applications on same cake installation

2007-05-29 Thread Siegfried Hirsch
2007/5/29, rtanz [EMAIL PROTECTED]:

 so how should they be organised, for example in the views folder i
 require and index.html for both projects so they cannot coexist
 together unless i change one of the filenames which i would not like
 to do. Can i separate them neatly into folders? and how can i achieve
 that thanks
Read: http://manual.cakephp.org/chapter/installing
the part Production setup
I have just done that and have the applications in different subdomains and
the /cake/ is only installed once. You just have to set the following
DEFINES



/app/webroot/index.php (partial, comments removed)
if (!defined('ROOT'))
{
define('ROOT', dirname(dirname(dirname(__FILE__;
}

if (!defined('APP_DIR'))
{
define ('APP_DIR', basename(dirname(dirname(__FILE__;
}

if (!defined('CAKE_CORE_INCLUDE_PATH'))
{
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}

in your /app/webroot/index.php, which you have for every of your apps.

-- 
Siegfried Hirsch
hhS - Welserstr. 1 - 81373 München - (089) 5484 3564 - skype:shirsch
http://gadgetgui.de / http://www.rss-blogger.de
http://www.newsbee.de NewsBee 2 - customized RSS solutions

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



Re: manage different applications on same cake installation

2007-05-29 Thread rtanz

ok thanks

On May 29, 12:30 pm, Siegfried Hirsch [EMAIL PROTECTED]
wrote:
 2007/5/29, rtanz [EMAIL PROTECTED]:

  so how should they be organised, for example in the views folder i
  require and index.html for both projects so they cannot coexist
  together unless i change one of the filenames which i would not like
  to do. Can i separate them neatly into folders? and how can i achieve
  that thanks

 Read:http://manual.cakephp.org/chapter/installing
 the part Production setup
 I have just done that and have the applications in different subdomains and
 the /cake/ is only installed once. You just have to set the following
 DEFINES

 /app/webroot/index.php (partial, comments removed)
 if (!defined('ROOT'))
 {
 define('ROOT', dirname(dirname(dirname(__FILE__;

 }

 if (!defined('APP_DIR'))
 {
 define ('APP_DIR', basename(dirname(dirname(__FILE__;

 }

 if (!defined('CAKE_CORE_INCLUDE_PATH'))
 {
 define('CAKE_CORE_INCLUDE_PATH', ROOT);

 }

 in your /app/webroot/index.php, which you have for every of your apps.

 --
 Siegfried Hirsch
 hhS - Welserstr. 1 - 81373 München - (089) 5484 3564 - 
 skype:shirschhttp://gadgetgui.de/http://www.rss-blogger.dehttp://www.newsbee.deNewsBee
  2 - customized RSS solutions


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



Re: manage different applications on same cake installation

2007-05-29 Thread rtanz

so from the manual i understand that i should make the whole domain at
as a single cakephp application. Now if I also have other non cakephp
applications running on my server these should also go into the /
path_to_cake_nstall/app/webroot folder without being affected right?

thanks


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



Re: manage different applications on same cake installation

2007-05-29 Thread AD7six



On 29 mayo, 14:01, rtanz [EMAIL PROTECTED] wrote:
 so from the manual i understand that i should make the whole domain at
 as a single cakephp application. Now if I also have other non cakephp
 applications running on my server these should also go into the /
 path_to_cake_nstall/app/webroot folder without being affected right?

 thanks

If you are using a dev style install, and want 2 applications side by
side, it's about this simple:

extract cake to your server,
copy the app folder
paste the copy of the app folder alongside it's original and rename it
(to say foo).
go to the url /foo.

It's a much better idea to use a production style setup - some reading
which may be of interest: http://www.noswad.me.uk/MiBlog/ProductionSetup

hth,

AD


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



move private subversion repository to CakeForge

2007-05-29 Thread mac joost

Hi,

I created a project on CakeForge for a product I developed in my own
subversion repository. Now I would like to move my own repository into
CakeForge keeping all revisions (using svnadmin dump  DUMPFILE and
svnadmin load  DUMPFILE).

svnadmin load does not work on remote repositories and I can't seem to
login to CakeForge using ssh.

Is there a solution to this?

Thanks!


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



Validation $this-invalidate doesnt work....

2007-05-29 Thread Eppo

The following:
Cant figure out why validation not working...

This is what i have;
In my model 'User':
?php
class User extends AppModel{
var $name = 'User';
var $useTable = 'clients';

var $validate = array(
'name' = array(array('rule' = array('minLength', 
3),'message'='No
name')));

function beforeValidate(){
if(!isset($this-data['User']['gender'])){
$this-invalidate('gender', 'No gender selected');
return false;
}
return true;
}
?

In my view:
?php echo $html-radio('User/gender', array('m', 'v'), '?');?
?php echo $html-tagErrorMsg('User/gender', 'No gender
selected'); ?

But no errors are displayed
When I do this in my controller: pr($this); There is an array :
[validationErrors] = Array(
[gender] = No gender selected
)


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



Re: CakePHP php5?

2007-05-29 Thread Sliv

Also, think of down the road; 1.2 apps currently being developed will
at some point feel like 1.1 apps that are being developed right now,
as the new bleeding edge cake will probably be 2.x... Legacy Support
or backwards-compatibility or whatever term you choose to use, is
without a doubt huge and very significant.  From another perspective,
there's another reason why a lot of web hosts still offer 4 that maybe
wasn't mentioned here:  app support.  A lot of people have big apps
written in php4 that are not easily moved to 5 and won't go with a web
host that doesn't support 4.  I get the notion of moving forward,
but I think the point Nate, Felix and others are trying to make is
that supporting php 4 is not stunting CakePHP's ability to perform,
or to be scalable, or whatever

On May 29, 3:22 am, Felix Geisendörfer [EMAIL PROTECTED] wrote:
  That guy needs PHP4, this host needs PHP4, but no one is saying
  that I need a PHP4 support. This is the same scenario happened when
  PHP4 is released.  It's always better to move upwards whether it's PHP
  or CakePHP (how many people are going to stick to 1.1 for instance?)

 You *really* need to listen to the other folks. I'm working on one of
 the biggest cake apps around (300db tables, ~70 controllers, etc.). And
 guess what? It's 1.1. The reason for this is that the project was
 started about ~6 month ago when 1.2 was not where it's now and the team
 decided it would not be worth to the pain to constantly stay in sync
 with HEAD and deal with early adopter issues. And now guess further.
 This application won't magically convert itself to 1.2 and that is not
 because we don't want it to, but because we'll have to refactor
 thousands and thousand lines of code done in ~5000 svn commits. So yes,
 people will stick to CakePHP 1.1, PHP4 (the project I mentioned is php5)
 and other old technologies and will highly appreciate any support going
 into them. Now of course when you are starting a new project and it's
 not all that big I'm somebody who also favors the usage of cutting edge
 technology. But get real, for a really big app you need to rely on
 technologies that are somewhat proven to work depending on the
 environment you are working in. Of course, as a startup made up of a
 couple guys living on Pizza, Coke and Hope you can make the craziest
 choices and go with a Lisp-Haskell-HomebrewDB-Hybrid application or
 whatever. That's because you'll either fail or be lucky enough to
 discover a powerful combination that exceeds your wildest expectations.
 But please give the rest of a world a brief moment to catch up with you
 and don't make their life harder then necessary by promoting a no-legacy
 support doctrine.

 Thanks a lot, Felix
 --http://www.thinkingphp.orghttp://www.fg-webdesign.de

 R. Rajesh Jeba Anbiah wrote:

  On May 29, 11:22 am, haj [EMAIL PROTECTED] wrote:

  PHP4 support is one of the most important features and advantages and
  selling point of cakePHP.

  That guy needs PHP4, this host needs PHP4, but no one is saying
  that I need a PHP4 support. This is the same scenario happened when
  PHP4 is released.  It's always better to move upwards whether it's PHP
  or CakePHP (how many people are going to stick to 1.1 for instance?)

  This is not for some CS student's research
  homework. Work in the field and realise a significance of PHP4
  support.

 Ok.

  --
?php echo 'Just another PHP saint'; ?
  Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/


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



Re: CakePHP php5?

2007-05-29 Thread Chris Hartjes

On 5/29/07, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote:
 That guy needs PHP4, this host needs PHP4, but no one is saying
 that I need a PHP4 support. This is the same scenario happened when
 PHP4 is released.  It's always better to move upwards whether it's PHP
 or CakePHP (how many people are going to stick to 1.1 for instance?)


Again, you're missing the point.  CakePHP runs just fine on PHP 5.
There is nothing stopping you from using PHP 5's new stuff with
CakePHP.  Sadly, many people are reluctant to upgrade to PHP 4 for
reasons to do with hosting (scared to switch) or comfort level (scared
that they won't understand PHP 5).  My boss feels that CakePHP suffers
because it has to support PHP 4 and that somehow it can't compete
against Zend Framework because it's PHP 5 only.  This is, of course, a
load of shit.

So, I put the following to you:  provide an example of where CakePHP
is being held back by having to support PHP 4 or shut the hell up
about it.  Documented proof would be nice, not just personal opinion.

Even if all you do is move your existing app to PHP 5, you will see a
benefit in performance.  It has been my own personal experience that
the only apps that might have to be tweaked to run under PHP are those
doing weird stuff with PHP 4's object model.  I run WordPress for my
blogs, which is supposedly a PHP 4 only application, with PHP 5.
Haven't run into any problems yet.

-- 
Chris Hartjes

My motto for 2007:  Just build it, damnit!

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



The Slimfast Challange (or help me slim down my controller)

2007-05-29 Thread Tane Piper

Hey folks,

I have several functions in my controllers that are breaking the DRY
convention - at the moment, in each one that needs to check the users
level does so at the top of the method.  Here is an example:

function index($post_index_limit='1',$post_index_order='DESC',
$post_index_cachetime = '1 hour')
{
$level_check = $this-othAuth-group('level');
if (!empty($level_check))
{
$level = $level_check;
} else {
$level = 0;
}

// Overide paginate limit, may need to change
$this-cacheAction = $post_index_cachetime;
$this-passedArgs['limit'] = $post_index_limit;
$this-passedArgs['order'] = array('Post.post_date' =
$post_index_order, 'Post.created' = $post_index_order);
$this-set('posts', $this-paginate(null, 
array('Post.published'=1,
'Post.frontpage' = 1 ,'Post.access_level' = '= ' . $level )));
}

What I have tried to far is to move the level check into the model,
and return the value of level, then in my controller I tried this:

$this-set('posts', $this-paginate(null, array('Post.published'=1,
'Post.frontpage' = 1 ,'Post.access_level' = '= ' .
$this-Post-checklevel() )));

But then I get the error that the group method is not accessable - so
a controller seems to not be accessable from a model.

Can anyone see a way I can move this code into my app model (or app
controller - which I also couldn't get to work).  I think once I get
this the first time, it should help me slim down a lot of my code.

Thanks,
Tane

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



How to enable a CSV webservice?

2007-05-29 Thread Howard Glynn
I have successfully used the XML webservice to export my records in
that form as well as a regular html view just by varying the url

The manual describes webservices as rss, xml, rest, soap, xmlrpc
(Section 4 Advanced routing http://manual.cakephp.org/chapter/configuration)

I know CSV is not strictly a webservice, but I would dearly love to add it
to this list as the consumers on my app expect to be able to paste into
a spreadsheet, and this would be very convenient in terms of consistency

Can anyone point me in the right direction of how I do this?

I tried following the pattern for xml (items/xml/view.thtml,
layouts/xml/default.thtml etc)
but each time I try to go to a URL like http:///csv/items/view/1234
... I get an error about a missing CSV controller. I suspect I just need to
update some file
or configuration or route to sort this out

Am I missing something obvious?
Howard

-- 
--
Howard Glynn [ [EMAIL PROTECTED] ]
Edinburgh, UK

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



Re: How to enable a CSV webservice?

2007-05-29 Thread Chris Hartjes

On 5/29/07, Howard Glynn [EMAIL PROTECTED] wrote:
 Am I missing something obvious?

Well, given that CSV isn't a standard web service, you are missing the
obvious. :)

You'll have to create a csv controller that passes the data to your
csv template.  Should be very simple.  Of course, I can say that
because I don't have to write it. :)

-- 
Chris Hartjes

My motto for 2007:  Just build it, damnit!

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Upload a File with CakePHP 1.2.0.5137alpha

2007-05-29 Thread [EMAIL PROTECTED]

Hi to everybody!
I want to upload a file that I choose from a field of a form. How can
I do this action?
With the previous stable Version of Cake I do this, with the aid of
this extension: http://www.reversefolds.com/articles/show/filehandler
With this new version the controller always say to me that I don't
give to it the file.

In particular I want to upload an image.

Help me, please :D

Thanks

Ps. Sorry for my bad English!


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



Upload a File with CakePHP 1.2.0.5137alpha

2007-05-29 Thread Andrea

Hi to everybody!
I want to upload a file that I choose from a field of a form. How can
I do this action?
With the previous stable Version of Cake I do this, with the aid of
this extension: http://www.reversefolds.com/articles/show/filehandler
With this new version the controller always say to me that I don't
give to it the file.

In particular I want to upload an image.

Help me, please :D

Thanks

Ps. Sorry for my bad English!


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



Re: CakePHP - Multiple database connection, NOT working

2007-05-29 Thread [EMAIL PROTECTED]

eeroxasjr:

I am currently using multiple databases, and initially had some
troubles.  In addition to what Samuel said, I also explicitly added
the  persistent = false element to the array that isn't there
initially.  After adding this, it worked fine for me.

On May 28, 11:02 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 Good Morning!

 I can't seem to find a solution for this bug...

 I've got a 'Fatal error: Cannot redeclare class dbosource in /home/
 imperium/devel/chowking/cake/libs/model/datasources/dbo_source.php on
 line 38' error...

 I'm accessing a Model in a different database, and this is what I get.

 Hope anyone could help me...

 :((


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



Re: How to enable a CSV webservice?

2007-05-29 Thread Tane Piper

Hello fellow Embra Cake developer :)

I'm not 100% sure, but if your not tied to CVS, check out Trac for
running a backend SVN server.  There is an XML-RPC plugin for it that
allows you to make calls to it.

I'm not sure on the source side, but it definetly let's you make calls
to the ticket tracker - adding/viewing/editing tickets.  That's how
Mylar for Eclipse works, and it ties in nicely.

Tane
http://webrocket.wordpress.com


On 5/29/07, Howard Glynn [EMAIL PROTECTED] wrote:
 I have successfully used the XML webservice to export my records in
 that form as well as a regular html view just by varying the url

 The manual describes webservices as rss, xml, rest, soap, xmlrpc
 (Section 4 Advanced routing http://manual.cakephp.org/chapter/configuration)

 I know CSV is not strictly a webservice, but I would dearly love to add it
 to this list as the consumers on my app expect to be able to paste into
 a spreadsheet, and this would be very convenient in terms of consistency

 Can anyone point me in the right direction of how I do this?

 I tried following the pattern for xml (items/xml/view.thtml,
 layouts/xml/default.thtml etc)
 but each time I try to go to a URL like http:///csv/items/view/1234
 ... I get an error about a missing CSV controller. I suspect I just need to
 update some file
 or configuration or route to sort this out

 Am I missing something obvious?
 Howard

 --
 --
 Howard Glynn [ [EMAIL PROTECTED] ]
 Edinburgh, UK

 


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



Re: How to enable a CSV webservice?

2007-05-29 Thread kionae

This may or may not help. it's not exactly what you want to do, but I
don't have much use for CSV.  I needed to be able to allow site
managers to generate and download an excel spreasheet of user records
from the database.

In the controller:

function excel() {
$this-layout = 'excelfile';
$data = $this-Alum-findAll('', array('first_name', 'last_name',
'email'), 'last_name ASC');
$this-set('data', $data);
}


The excel.thtml view:

?php
foreach($data as $record) {
echo $record['Alum']['first_name'].\t;
echo $record['Alum']['last_name'].\t;
echo $record['Alum']['email'].\n;
header(Content-type: application/msexcel);
header(Content-Disposition: attachment;
filename=all_alumni_names.xls);
}
?


The excel layout file:

?php echo $content_for_layout ?


This allows them to download a .xsl file by clicking a link that calls
the excel function.





On May 29, 11:15 am, Howard Glynn [EMAIL PROTECTED] wrote:
 I have successfully used the XML webservice to export my records in
 that form as well as a regular html view just by varying the url

 The manual describes webservices as rss, xml, rest, soap, xmlrpc
 (Section 4 Advanced routinghttp://manual.cakephp.org/chapter/configuration)

 I know CSV is not strictly a webservice, but I would dearly love to add it
 to this list as the consumers on my app expect to be able to paste into
 a spreadsheet, and this would be very convenient in terms of consistency

 Can anyone point me in the right direction of how I do this?

 I tried following the pattern for xml (items/xml/view.thtml,
 layouts/xml/default.thtml etc)
 but each time I try to go to a URL likehttp:///csv/items/view/1234
 ... I get an error about a missing CSV controller. I suspect I just need to
 update some file
 or configuration or route to sort this out

 Am I missing something obvious?
 Howard

 --
 --
 Howard Glynn [ [EMAIL PROTECTED] ]
 Edinburgh, UK


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



Re: using create in cake 1.2

2007-05-29 Thread Samuel DeVore
create - creates a new instance of the model, this is especially helpful if
you are wanting to 'insert' more then one entry at a time, like looping
though a form that allows one to add more then one user at a time (for
example)  It is also useful to clear the information from a model  like if
you do a read earlier in the method code you might want to 'reset' it before
you 'save' your new data (like you might read the information from one user
because you use it in a 'child' user  (I do this when I have to do a
ModelName-find() to get an id for an existing record)

When in doubt and you are inserting, I would say use create, it can't hurt
and it can only help


On 5/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


 What is the reason for using create in cake 1.2
 I am using cake 1.2 because it seems to have a lot of extra
 functionality, however i am making an application with information i
 learned from tutorials taht were for 1.1.
 I have updated my forms to use FormHelper instead of the html helper
 methods.  And i read someone say that the new cake uses create. I
 would guess that creates the object first or something.  for instance,
 i have some code:

 if ($this-User-save($this-data['User']))
 {
 $this-flash('Your user information has
 been updated.','/users');
 }
 }

 would i do a create and then a save? It seems to work as is, but i'm
 wondering what the reason for using create before save would be.
 Thanks in advance.


 



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

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

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

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



Re: The Slimfast Challange (or help me slim down my controller)

2007-05-29 Thread Walker Hamilton

function beforeFilter()
{
   $level_check = $this-othAuth-group('level');
if (!empty($level_check))
{
$this-level = $level_check;
} else {
$this-level = 0;
}
}

then in your functions just grab $this-level when you need to.


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



Re: How to enable a CSV webservice?

2007-05-29 Thread Tane Piper

Do'h ignore that last message - I read CSV as CVS :)

Yea, I agree with chris - this doesn't sound like a service, you could
probably create a component/helper that can do the work for you.  I'd
say read the file one line at a time, explode each comma seperated
value into an array and save it to the db.

I was actually looking at this today as part of something else I
wanted to do (use XSL-FO to covert xsl and csv files to PDF on
upload).

There might even be a class on PHPclasses.com that you could put in
your vendor dir, could save on a lot of code.

Tane


On 5/29/07, Tane Piper [EMAIL PROTECTED] wrote:
 Hello fellow Embra Cake developer :)

 I'm not 100% sure, but if your not tied to CVS, check out Trac for
 running a backend SVN server.  There is an XML-RPC plugin for it that
 allows you to make calls to it.

 I'm not sure on the source side, but it definetly let's you make calls
 to the ticket tracker - adding/viewing/editing tickets.  That's how
 Mylar for Eclipse works, and it ties in nicely.

 Tane
 http://webrocket.wordpress.com


 On 5/29/07, Howard Glynn [EMAIL PROTECTED] wrote:
  I have successfully used the XML webservice to export my records in
  that form as well as a regular html view just by varying the url
 
  The manual describes webservices as rss, xml, rest, soap, xmlrpc
  (Section 4 Advanced routing
 http://manual.cakephp.org/chapter/configuration)
 
  I know CSV is not strictly a webservice, but I would dearly love to add it
  to this list as the consumers on my app expect to be able to paste into
  a spreadsheet, and this would be very convenient in terms of consistency
 
  Can anyone point me in the right direction of how I do this?
 
  I tried following the pattern for xml (items/xml/view.thtml,
  layouts/xml/default.thtml etc)
  but each time I try to go to a URL like http:///csv/items/view/1234
  ... I get an error about a missing CSV controller. I suspect I just need
 to
  update some file
  or configuration or route to sort this out
 
  Am I missing something obvious?
  Howard
 
  --
  --
  Howard Glynn [ [EMAIL PROTECTED] ]
  Edinburgh, UK
 
   
 


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



using simplepie as a helper

2007-05-29 Thread sixlaneve

Just wondering, is there any way to use simplepie as a helper?

basically

in a page I have multiple feeds to parse, I thought it could be easier
to use a helper.


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



Re: using simplepie as a helper

2007-05-29 Thread Tane Piper

If simplepie is a Class, you could include it in your vendor
directory, and then write a helper for it:

Function myfunc()
{
vendor('simplepie');
$spie = new simplepie;

$spie-function('foo','bar');
}

Tane


On 5/29/07, sixlaneve [EMAIL PROTECTED] wrote:

 Just wondering, is there any way to use simplepie as a helper?

 basically

 in a page I have multiple feeds to parse, I thought it could be easier
 to use a helper.


 


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



using select tag

2007-05-29 Thread hashkash

Hi!
I need to populate my drop down list with only owners and only
incharge users from my users table.
The Users table
username,password,first_name,owner,incharge,etc.
where owner and incharge are boolean fields to render the user as an
owner or incharge or both.
How do i populate the dropdown list based on this condition?i.e using
the selectTag


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



Re: using select tag

2007-05-29 Thread Walker Hamilton

look into using the form-input function. (
http://api.cakephp.org/1.2/class_form_helper.html#83ef190e216e07fb0a77acc9014bb90d
)

'type'='select'
'options'=$optionsArr

then in your controller make optionsArr using generateList (
http://api.cakephp.org/1.2/class_model.html#27ff9de8aaff38950bee5f4ffb22b4d1
)

Google search  API lookup are your friends!


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



Re: using select tag

2007-05-29 Thread hashkash

hey!
thanks alot for the help,will try it out once i get back to work tom.
But im guessing this solves my problem.
Thanks mate!
Cheers!
Kashyap

On May 30, 12:44 am, Walker Hamilton [EMAIL PROTECTED] wrote:
 look into using the form-input function. 
 (http://api.cakephp.org/1.2/class_form_helper.html#83ef190e216e07fb0a7...
 )

 'type'='select'
 'options'=$optionsArr

 then in your controller make optionsArr using generateList 
 (http://api.cakephp.org/1.2/class_model.html#27ff9de8aaff38950bee5f4ff...
 )

 Google search  API lookup are your friends!


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



Re: How to enable a CSV webservice?

2007-05-29 Thread Howard Glynn
Slightly bad karma to reply to one's own post so soon, but after continuing
to investigate,
I'd like to provide a solution for the mail archives. I just didn't fully
understand the route handling up until this point, but the light is starting
to go on for me. I have subsequently found 2 ways it can be done:

1) Less agreeable way: change the cake distro libs/router.php around line
147, adding:

  $this-connect('/csv/:controller/:action/*',
array('webservices' = 'Csv'));

2) More agreeable, add to the application app/config/routes.php

$Route-connect('/csv/:controller/:action/*', array('webservices' =
'Csv'));

I am well aware that CSV is not a webservice as such but I want the CSV
output availability to be consistent with the XML approach.

Cheers, Howard

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



noob: Sorting results from 15min blog tutorial

2007-05-29 Thread loopymonkey

I've tried a few basic tutorials for cakephp but all the tutorials
create results that are out of order.  I'm still learning but thought
someone could point me in the right direction as far as learning what
code I can add in order to make the posts index list things by date
correctly.  I would like to have most recent at top.

http://manual.cakephp.org/appendix/blog_tutorial
was the tutorial i tried that presets results unsorted.

thanks for your time!


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



navigation

2007-05-29 Thread [EMAIL PROTECTED]

I have a website and i want to use a specific navigation menu but i
want the links to depend on the state.. Basically there are 1 of the
different navigation menus i want to render,
1. no user logged in
2. regular user logged in
3. admin user logged in

Currently i have  a user model and the appropriate controllers and
views. I figured out how to enforce authentication and what not on the
pages, however i am unsure what a good way of supplying the navigation
menu would be for each.

Any ideas? I was thinking some kind of a ocmponent or something but
i'm not sure how to use those..

Thanks


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



Re: Validation $this-invalidate doesnt work....

2007-05-29 Thread [EMAIL PROTECTED]

I had the same problem. You must be using cake 1.2. It looks like 1.2
doesnt use html helper for forms anymore. Use formHelper class
For information look at the following link:

http://bakery.cakephp.org/articles/view/multiple-rules-of-validation-per-field-in-cakephp-1-2

and for in depth look at the functions and what not to validate with
look here:
http://cakebaker.42dh.com/2007/01/03/validation-with-cakephp-12/



On May 29, 6:14 am, Eppo [EMAIL PROTECTED] wrote:
 The following:
 Cant figure out why validation not working...

 This is what i have;
 In my model 'User':
 ?php
 class User extends AppModel{
 var $name = 'User';
 var $useTable = 'clients';

 var $validate = array(
 'name' = array(array('rule' = array('minLength', 
 3),'message'='No
 name')));

 function beforeValidate(){
 if(!isset($this-data['User']['gender'])){
 $this-invalidate('gender', 'No gender selected');
 return false;
 }
 return true;index
 }
 ?

 In my view:
 ?php echo $html-radio('User/gender', array('m', 'v'), '?');?
 ?php echo $html-tagErrorMsg('User/gender', 'No gender
 selected'); ?

 But no errors are displayed
 When I do this in my controller: pr($this); There is an array :
 [validationErrors] = Array(
 [gender] = No gender selected
 )


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



Re: How to enable a CSV webservice?

2007-05-29 Thread Chris Hartjes

On 5/29/07, Howard Glynn [EMAIL PROTECTED] wrote:
 I am well aware that CSV is not a webservice as such but I want the CSV
 output availability to be consistent with the XML approach.

 Cheers, Howard

You are overcomplicating what appears to me (at least) a simple
solution.  Why can't you just create a csv controller with actions
that read in the data, format it into CSV and then spit it out via a
view.  Am I missing something?

You're doing all this nonsense with routes, etc, to gain what exactly?

-- 
Chris Hartjes

My motto for 2007:  Just build it, damnit!

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Re: How to enable a CSV webservice?

2007-05-29 Thread Tane Piper

/me bangs himself over the head several times and decides he should
stop answering emails on his blackberry or really read emails through
first before deciding to answer

I actually do have some code lying about that outputs to CSV from a
database - although I've not used it in cake yet, its just an old
class I wrote which could be plugged in as a vendor.  But at the
moment I'm hurtling down the M8 on a bus so I won't have access to it
until later.

Tane

On 5/29/07, Tane Piper [EMAIL PROTECTED] wrote:
 Do'h ignore that last message - I read CSV as CVS :)

 Yea, I agree with chris - this doesn't sound like a service, you could
 probably create a component/helper that can do the work for you.  I'd
 say read the file one line at a time, explode each comma seperated
 value into an array and save it to the db.

 I was actually looking at this today as part of something else I
 wanted to do (use XSL-FO to covert xsl and csv files to PDF on
 upload).

 There might even be a class on PHPclasses.com that you could put in
 your vendor dir, could save on a lot of code.

 Tane


 On 5/29/07, Tane Piper [EMAIL PROTECTED] wrote:
  Hello fellow Embra Cake developer :)
 
  I'm not 100% sure, but if your not tied to CVS, check out Trac for
  running a backend SVN server.  There is an XML-RPC plugin for it that
  allows you to make calls to it.
 
  I'm not sure on the source side, but it definetly let's you make calls
  to the ticket tracker - adding/viewing/editing tickets.  That's how
  Mylar for Eclipse works, and it ties in nicely.
 
  Tane
  http://webrocket.wordpress.com
 
 
  On 5/29/07, Howard Glynn [EMAIL PROTECTED] wrote:
   I have successfully used the XML webservice to export my records in
   that form as well as a regular html view just by varying the url
  
   The manual describes webservices as rss, xml, rest, soap, xmlrpc
   (Section 4 Advanced routing
  http://manual.cakephp.org/chapter/configuration)
  
   I know CSV is not strictly a webservice, but I would dearly love to add
 it
   to this list as the consumers on my app expect to be able to paste into
   a spreadsheet, and this would be very convenient in terms of consistency
  
   Can anyone point me in the right direction of how I do this?
  
   I tried following the pattern for xml (items/xml/view.thtml,
   layouts/xml/default.thtml etc)
   but each time I try to go to a URL like http:///csv/items/view/1234
   ... I get an error about a missing CSV controller. I suspect I just need
  to
   update some file
   or configuration or route to sort this out
  
   Am I missing something obvious?
   Howard
  
   --
   --
   Howard Glynn [ [EMAIL PROTECTED] ]
   Edinburgh, UK
  
 
  
 


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



Re: noob: Sorting results from 15min blog tutorial

2007-05-29 Thread DJ Spark

by changing this:

function index()
{
  $this-set('posts', $this-Post-findAll());
}

to this:

function index()
{
  $this-set('posts', $this-Post-findAll(null, null,
'Post.modified DESC'));
}

You'll find all these options in the manual, Models chapter
http://manual.cakephp.org/chapter/models
'Retrieving Your Data'

  Easy, isn't it ?
  Spark

On 5/29/07, loopymonkey [EMAIL PROTECTED] wrote:

 I've tried a few basic tutorials for cakephp but all the tutorials
 create results that are out of order.  I'm still learning but thought
 someone could point me in the right direction as far as learning what
 code I can add in order to make the posts index list things by date
 correctly.  I would like to have most recent at top.

 http://manual.cakephp.org/appendix/blog_tutorial
 was the tutorial i tried that presets results unsorted.

 thanks for your time!


 



-- 
[livesets] http://djspark.com.br/
[web] http://synapsisdi.com.br

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



Re: navigation

2007-05-29 Thread Tane Piper

If you use a similar idea to othAuth, and put users into groups - you
could show a menu either based on the users group, or the access
level.

Some psudocode would be like:

if ($this-User-level = 0)
{
output ('login')
} else if ($this-User-level = 100) {
   output (' regular menu')
} else if ($this-User-level = 200) {
   output ('admin menu')
}

Tane

On 5/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 I have a website and i want to use a specific navigation menu but i
 want the links to depend on the state.. Basically there are 1 of the
 different navigation menus i want to render,
 1. no user logged in
 2. regular user logged in
 3. admin user logged in

 Currently i have  a user model and the appropriate controllers and
 views. I figured out how to enforce authentication and what not on the
 pages, however i am unsure what a good way of supplying the navigation
 menu would be for each.

 Any ideas? I was thinking some kind of a ocmponent or something but
 i'm not sure how to use those..

 Thanks


 


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



Re: How to enable a CSV webservice?

2007-05-29 Thread Gonzalo Servat
On 5/29/07, Howard Glynn [EMAIL PROTECTED] wrote:

 Slightly bad karma to reply to one's own post so soon, but after
 continuing to investigate,
 I'd like to provide a solution for the mail archives. I just didn't fully
 understand the route handling up until this point, but the light is starting
 to go on for me. I have subsequently found 2 ways it can be done:

 1) Less agreeable way: change the cake distro libs/router.php around line
 147, adding:

   $this-connect('/csv/:controller/:action/*',
 array('webservices' = 'Csv'));

 2) More agreeable, add to the application app/config/routes.php

 $Route-connect('/csv/:controller/:action/*', array('webservices'
 = 'Csv'));

 I am well aware that CSV is not a webservice as such but I want the CSV
 output availability to be consistent with the XML approach.


Is your requirement strictly CSV or can it be an actual Excel file? I found
this article recently at bakery.cakephp.org (which I plan on using) to
create an XLS file from database records:

http://bakery.cakephp.org/articles/view/generate-excel-spreadsheets-from-your-database

If it's strictly CSV what you need, then it won't help, but I think what
klonae said is probably the simplest way.

klonae: just wondering, shouldn't the header() calls be made just before the
foreach begins?

- Gonzalo

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



GoDaddy Subdomain Woes

2007-05-29 Thread Ronald Chaplin
OK. Here's my issue if anyone can help.
I have created a subdomain, adcamp that relates to the url
adcamp.midnightfury.info.
The host is GoDaddy. I have pointed the root directory to
/adcamp/app/webroot and the full directory structure is
/home/content/d/e/t/dethriderr/html/adcamp/app/webroot.
If you view the source of adcamp.midnightfury.info the css tag is
href=/app/webroot/css/default.css .
I am using the default core files for 1.12 and have only adjusted the core
file to disable mod_rewrite.
I am using echo $html-css('default'); in my default layout.
Also, ?php echo $this-webroot . 'favicon.ico';? equates to
href=/app/webroot/favicon.ico .Any suggestions?

-- 
Thanks,
Ron Chaplin
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
T73 Software  Design
www.t73-softdesign.com
We'll make all of your wildest
e-Commerce dreams come true!

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



Re: The Slimfast Challange (or help me slim down my controller)

2007-05-29 Thread Christopher E. Franklin, Sr.

The best place to put this, I find, is in a copy of
app_controller.php.  You place the copy into your app folder and add
your beforeFilters() etc.  This way you don't have to write that
function in every single controller.

Throw this into it and see how it does for you:

class AppController extends Controller {
//public $ext = .php;
//public $helpers = array('Html', 'Javascript', 'Ajax');

function beforeFilter()
{
   $level_check = $this-othAuth-group('level');
if (!empty($level_check))
{
$this-level = $level_check;
} else {
$this-level = 0;
}

}
}

Now, everytime a controller tries to run a filter  this function is
called, no matter what controller it is.  If you want to limit the
controllers that call this, name it another function and you will have
to call it manually from the controller that you want to use it.

On May 29, 11:27 am, Walker Hamilton [EMAIL PROTECTED] wrote:
 function beforeFilter()
 {
$level_check = $this-othAuth-group('level');
 if (!empty($level_check))
 {
 $this-level = $level_check;
 } else {
 $this-level = 0;
 }

 }

 then in your functions just grab $this-level when you need to.


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



Debugging Cake app via DBG or Zend Debugger

2007-05-29 Thread Ming

Hi there,

I wonder if anybody here can do me a favor by sharing his/her
experience in debugging a Cake app by DBG (if you are using PhpED) or
Zend Debugger ( if you are using Zend Studio or PDT).

I have troubles in debugging, esp, breakpoints I set seem not work
properly. I am not sure if it because of mod_rewrite setting or
something else. While trying to debug only the app, I always 'dive'
into the framework's codes

Thanks,


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



Re: Debugging Cake app via DBG or Zend Debugger

2007-05-29 Thread Chris Hartjes

On 5/29/07, Ming [EMAIL PROTECTED] wrote:

 Hi there,

 I wonder if anybody here can do me a favor by sharing his/her
 experience in debugging a Cake app by DBG (if you are using PhpED) or
 Zend Debugger ( if you are using Zend Studio or PDT).


I've used Komodo and XDebug to take a look at what's going on and
didn't have any problems setting breakpoints etc.  Maybe you should
ask this question on a Zend Studio mailing list?

-- 
Chris Hartjes

My motto for 2007:  Just build it, damnit!

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Sessions Issue

2007-05-29 Thread Ketan Patel

I am using CakePHP 1.2.0.5146. I am trying to write a session variable
using
$this-Session-write('alpha',15);
in users_controller.php for add action as follows:
function add() {
$success = false;

if(!empty($this-data)) {
$this-cleanUpFields();

$user_input = $this-data['User']['verify'];
echo 'User input is : '.$user_input;
echo 'Expect input is : '.$this-Session-read('alpha');
$success = true;
}
if (!$success)
{
$this-Session-write('alpha',15);
}
}

When the form is posted, in expected input, I am not able to see the
session variable alpha which I had set during the intial view. Can
someone point me in right direction what's wrong?

I know that session variable is set because when I look into database
for session entry, I do see the variable 'alpha' declared as 15 in the
data column. But somehow it is not shown when the form is posted or
read is requested!


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



Re: Sessions Issue

2007-05-29 Thread Chris Hartjes

On 5/29/07, Ketan Patel [EMAIL PROTECTED] wrote:

 When the form is posted, in expected input, I am not able to see the
 session variable alpha which I had set during the intial view. Can
 someone point me in right direction what's wrong?

 I know that session variable is set because when I look into database
 for session entry, I do see the variable 'alpha' declared as 15 in the
 data column. But somehow it is not shown when the form is posted or
 read is requested!

I keep saying to myself people read the manual, Chris, they really do.

What debug level do you have your application set to?  If it's 0 then
you are probably seeing cached data.

-- 
Chris Hartjes

My motto for 2007:  Just build it, damnit!

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Re: Sessions Issue

2007-05-29 Thread Ketan Patel

Hi Chris,

The debug is set to 2. The set up is WAMP where I experience this
issue. However, just to make sure that this happens on Linux box or
not, I booted into Linux and it works fine in linux. So I don't know
if its CakePHP issue or its WAMP configuration issue. Let me know.

Ketan

On May 29, 10:07 pm, Chris Hartjes [EMAIL PROTECTED] wrote:
 On 5/29/07, Ketan Patel [EMAIL PROTECTED] wrote:



  When the form is posted, in expected input, I am not able to see the
  session variable alpha which I had set during the intial view. Can
  someone point me in right direction what's wrong?

  I know that session variable is set because when I look into database
  for session entry, I do see the variable 'alpha' declared as 15 in the
  data column. But somehow it is not shown when the form is posted or
  read is requested!

 I keep saying to myself people read the manual, Chris, they really do.

 What debug level do you have your application set to?  If it's 0 then
 you are probably seeing cached data.

 --
 Chris Hartjes

 My motto for 2007:  Just build it, damnit!

 @TheBallpark -http://www.littlehart.net/attheballpark
 @TheKeyboard -http://www.littlehart.net/atthekeyboard


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



Re: CakePHP php5?

2007-05-29 Thread Nathan Garza
I for one have on at least 2 occasions had my hide saved by cakephp's php4
support.  On both occasions, I discovered that the target server was php4.
Before my cakephp days this kind of a thing could have taken days or weeks
to fix!  With cake, a quick search and replace and we were set.
-- 

Nathan Garza

AshLeaf Media | Director of Technology Innovations
_
www.ashleafmedia.com | [EMAIL PROTECTED] | 832.514.5726

On 5/29/07, Chris Hartjes [EMAIL PROTECTED] wrote:


 On 5/29/07, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote:
  That guy needs PHP4, this host needs PHP4, but no one is saying
  that I need a PHP4 support. This is the same scenario happened when
  PHP4 is released.  It's always better to move upwards whether it's PHP
  or CakePHP (how many people are going to stick to 1.1 for instance?)
 

 Again, you're missing the point.  CakePHP runs just fine on PHP 5.
 There is nothing stopping you from using PHP 5's new stuff with
 CakePHP.  Sadly, many people are reluctant to upgrade to PHP 4 for
 reasons to do with hosting (scared to switch) or comfort level (scared
 that they won't understand PHP 5).  My boss feels that CakePHP suffers
 because it has to support PHP 4 and that somehow it can't compete
 against Zend Framework because it's PHP 5 only.  This is, of course, a
 load of shit.

 So, I put the following to you:  provide an example of where CakePHP
 is being held back by having to support PHP 4 or shut the hell up
 about it.  Documented proof would be nice, not just personal opinion.

 Even if all you do is move your existing app to PHP 5, you will see a
 benefit in performance.  It has been my own personal experience that
 the only apps that might have to be tweaked to run under PHP are those
 doing weird stuff with PHP 4's object model.  I run WordPress for my
 blogs, which is supposedly a PHP 4 only application, with PHP 5.
 Haven't run into any problems yet.

 --
 Chris Hartjes

 My motto for 2007:  Just build it, damnit!

 @TheBallpark - http://www.littlehart.net/attheballpark
 @TheKeyboard - http://www.littlehart.net/atthekeyboard

 


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