Re: find with complex conditions ("AND" and "OR")

2012-08-01 Thread Carlos Lavin
How about:

$params = array('contain' => 'Product.name',
'fields' => array('DISTINCT(Equipment.**product_id) AS
id', 'Product.name'),
'order' => array('Product.name'),
'group' => array('Equipment.product_id'),
'conditions' => array(
'AND' => array(
  **  'Equipment.company_id' =>
$this->passedArgs['company'],
  **  'Equipment.deleted' => 0,
  **  'OR' => array(
  **  array('Equipment.location_**id'
=> null),
  **  array('Equipment.location_**id'
=> -1 ),
  **  array('Equipment.location_**id'
=> -2)
  **  )
)
));

According to an example in
http://book.cakephp.org/1.3/view/1030/Complex-Find-Conditions that sets
multiple conditions on the same field inside an "OR":

 array(
'OR' => array(
array('Post.title LIKE' => '%one%'),
array('Post.title LIKE' => '%two%')
)
);


2012/8/1 scs 

> Thanks for your response.
>
> Unfortunately, that did not work. I'm still only getting the last element
> of the "OR" array. FWIW: Cake 1.3.10
>
>> SELECT DISTINCT(`Equipment`.`product_id`) AS id, `Product`.`name`,
>> `Product`.`id` FROM `equipment` AS `Equipment` LEFT JOIN `products` AS
>> `Product` ON (`Equipment`.`product_id` = `Product`.`id`) WHERE
>> ((`Equipment`.`company_id` = 23) AND (`Equipment`.`deleted` = 0) AND
>> (`Equipment`.`location_id` = -2)) GROUP BY `Equipment`.`product_id` ORDER
>> BY `Product`.`name` ASC
>
>
> Any other help?
>
> On Tuesday, July 31, 2012 4:09:16 PM UTC-4, lavin wrote:
>
>> Try something like this:
>>
>> $params = array('contain' => 'Product.name',
>> 'fields' => array('DISTINCT(Equipment.**product_id) AS
>> id', 'Product.name'),
>> 'order' => array('Product.name'),
>> 'group' => array('Equipment.product_id'),
>> 'conditions' => array(
>> 'AND' => array(
>>   **  'Equipment.company_id' =>
>> $this->passedArgs['company'],
>>   **  'Equipment.deleted' => 0,
>>   **  'OR' => array(
>>   **  'Equipment.location_**id' =>
>> null,
>>   **  'Equipment.location_**id' =>
>> -1,
>>   **  'Equipment.location_**id' =>
>> -2
>>   **  )
>> )
>> ));
>>
>> Allowing the "OR" subset to be one of the elements considered inside the
>> AND
>>
>> 2012/7/31 scs:
>>
>> > I'm trying to perform what has been called a complex condition in some
>> of
>> > the documentation I have found. I want to use "AND" and "OR" in the
>> > conditions portion of my query via find('all', $params). I haven't been
>> able
>> > to find anything that seems to match my issue (although I'm sure it's
>> out
>> > there).
>> >
>> > I'm not sure what to do. I've tried many different variations of the
>> > conditions array, none seem to work. At best, the query is built with
>> only 1
>> > of the "OR" items, always the last one in the array.
>> >
>> > Here's the information:
>> > $params = array('contain' => 'Product.name',
>> > 'fields' => array('DISTINCT(Equipment.**product_id) AS
>> id',
>> > 'Product.name'),
>> > 'order' => array('Product.name'),
>> > 'group' => array('Equipment.product_id'),
>> > 'conditions' => array('AND' =>
>> array('Equipment.company_id'
>> > => $this->passedArgs['company'], 'Equipment.deleted' => 0,),
>> >   'OR' =>
>> array('Equipment.location_id'
>> > => null, 'Equipment.location_id' => -1, 'Equipment.location_id' => -2))
>> > );
>> > $equipList = $this->Equipment->find('all', $params);
>> >
>> > The sql debugged is: SELECT DISTINCT(`Equipment`.`product_**id`) AS
>> id,
>> > `Product`.`name`, `Product`.`id` FROM `equipment` AS `Equipment` LEFT
>> JOIN
>> > `products` AS `Product` ON (`Equipment`.`product_id` = `Product`.`id`)
>> WHERE
>> > ((`Equipment`.`company_id` = 23) AND (`Equipment`.`deleted` = 0)) AND
>> > `Equipment`.`location_id` = -2 GROUP BY `Equipment`.`product_id` ORDER
>> BY
>> > `Product`.`name` ASC
>> >
>> > What I am looking for is: SELECT DISTINCT(`Equipment`.`product_**id`)
>> AS id,
>> > `Product`.`name`, `Product`.`id` FROM `equipment` AS `Equipment` LEFT
>> JOIN
>> > `products` AS `Product` ON (`Equipment`.`product_id` = `Product`.`id`)
>> WHERE
>> > ((`Equipment`.`company_id` = 23) AND (`Equipment`.`deleted` = 0)) AND
>> > (`Equipment`.`location_id` IS NULL OR `Equipment`.`location_id` = -1 OR
>> > `Equipment`.`location_id` = -2) GROUP BY `Equipment`.`product_id` ORDER
>> BY
>> > `Product`

Re: control visibility of field with second level of depth

2012-07-31 Thread Carlos Lavin
Have you tried using the 'Containable' behavior?
http://book.cakephp.org/1.3/view/1323/Containable

2012/7/30 Mariano C. :
> I have this json:
>
> {
>
> Offices:
> [
>
> {
>
> Office:
> {
>
> address: "JR street"
> Company:
> {
>
> id: "3",
> name: "ABC Software"
>
> },
>
> },
> Person:
> {
>
> id: "1",
> first_name: "M",
> last_name: "c",
>
> }
>
> }
>
> }
>
> I want to show only few fields of the entire set, for example I would show
> just Office.Company.name but if I write this into model:
>
>>
>> $options['fields'] = array("Person.id", "Person.first_name",
>> "Person.last_name", "Office.region", "Company.name");
>
>  or
>
>> $options['fields'] = array("Person.id", "Person.first_name",
>> "Person.last_name", "Office.region", "Office.Company.name");
>
>
> This will get me an error cause Company.name or Office.Company.name is
> unknown.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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



-- 
-Carlos

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: find with complex conditions ("AND" and "OR")

2012-07-31 Thread Carlos Lavin
Try something like this:

$params = array('contain' => 'Product.name',
'fields' => array('DISTINCT(Equipment.product_id) AS
id', 'Product.name'),
'order' => array('Product.name'),
'group' => array('Equipment.product_id'),
'conditions' => array(
'AND' => array(
'Equipment.company_id' => 
$this->passedArgs['company'],
'Equipment.deleted' => 0,
'OR' => array(
'Equipment.location_id' => null,
'Equipment.location_id' => -1,
'Equipment.location_id' => -2
)
)
));

Allowing the "OR" subset to be one of the elements considered inside the AND

2012/7/31 scs :
> I'm trying to perform what has been called a complex condition in some of
> the documentation I have found. I want to use "AND" and "OR" in the
> conditions portion of my query via find('all', $params). I haven't been able
> to find anything that seems to match my issue (although I'm sure it's out
> there).
>
> I'm not sure what to do. I've tried many different variations of the
> conditions array, none seem to work. At best, the query is built with only 1
> of the "OR" items, always the last one in the array.
>
> Here's the information:
> $params = array('contain' => 'Product.name',
> 'fields' => array('DISTINCT(Equipment.product_id) AS id',
> 'Product.name'),
> 'order' => array('Product.name'),
> 'group' => array('Equipment.product_id'),
> 'conditions' => array('AND' => array('Equipment.company_id'
> => $this->passedArgs['company'], 'Equipment.deleted' => 0,),
>   'OR' => array('Equipment.location_id'
> => null, 'Equipment.location_id' => -1, 'Equipment.location_id' => -2))
> );
> $equipList = $this->Equipment->find('all', $params);
>
> The sql debugged is: SELECT DISTINCT(`Equipment`.`product_id`) AS id,
> `Product`.`name`, `Product`.`id` FROM `equipment` AS `Equipment` LEFT JOIN
> `products` AS `Product` ON (`Equipment`.`product_id` = `Product`.`id`) WHERE
> ((`Equipment`.`company_id` = 23) AND (`Equipment`.`deleted` = 0)) AND
> `Equipment`.`location_id` = -2 GROUP BY `Equipment`.`product_id` ORDER BY
> `Product`.`name` ASC
>
> What I am looking for is: SELECT DISTINCT(`Equipment`.`product_id`) AS id,
> `Product`.`name`, `Product`.`id` FROM `equipment` AS `Equipment` LEFT JOIN
> `products` AS `Product` ON (`Equipment`.`product_id` = `Product`.`id`) WHERE
> ((`Equipment`.`company_id` = 23) AND (`Equipment`.`deleted` = 0)) AND
> (`Equipment`.`location_id` IS NULL OR `Equipment`.`location_id` = -1 OR
> `Equipment`.`location_id` = -2) GROUP BY `Equipment`.`product_id` ORDER BY
> `Product`.`name` ASC
>
> Any and all help is greatly appreciated.
> Thanks.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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



-- 
-Carlos

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Getting CakePhp to talk to Android devices

2012-07-26 Thread Carlos Lavin
Guess you could have the layout+views in an easy-to-interpret format
(maybe xml or json) when returning the data to your Android App?

2012/7/26 Lightee :
> Dear CakePHP experts,
>
> I am thinking of creating an Android app to talk to CakePHP server app.
> Sorry for my amateur questions because I am still a newbie. Is there
> anything extra I need to do on the CakePHP side? Are web services the way to
> go? Can the Android talk to MySql database directly and pull out data?
>
> Thank you.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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



-- 
-Carlos

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Cakephp + TCPDF

2012-07-26 Thread Carlos Lavin
Maybe adding the header data in the pdf layout's ctp?

2012/7/26 gloop :
> Its not the pdf application. The question is why cake output a text/html
> header.
>
>
> On Thursday, July 26, 2012 7:07:54 AM UTC+2, gua syed wrote:
>>
>> try to use dompdf
>>
>> On Thu, Jul 26, 2012 at 6:04 AM, gloop  wrote:
>>>
>>> Hello,
>>>
>>> i would like to create a pdf. Now i found this:
>>>
>>>
>>> http://bakery.cakephp.org/articles/kalileo/2010/06/08/creating-pdf-files-with-cakephp-and-tcpdf
>>>
>>> So i try this example:
>>>
>>> Step: 1, 2, 3 the same as the example
>>>
>>> Step 4:
>>>
>>>   function viewPdf() {
>>> $this->layout = 'pdf'; //this will use the pdf.ctp layout
>>> $this->render();
>>> }
>>>
>>> Step 5:
>>>
>>> >> App::import('Vendor','xtcpdf');
>>> $tcpdf = new XTCPDF();
>>> $textfont = 'freesans'; // looks better, finer, and more condensed than
>>> 'dejavusans'
>>> $tcpdf->Cell(0,14, "Hello World", 0,1,'L');
>>> echo $tcpdf->Output('filename.pdf', 'D');
>>> ?>
>>>
>>> When i open function in a browser i get a download popup and i have to
>>> choose how i would open the document. The standard software is "firefox".
>>>
>>> I try
>>>
>>> echo $tcpdf->Output('filename.pdf', 'D');
>>>
>>> and i see many text (like i open the pdf with firefox. I check the http
>>> header and see the document is opend with Content-Type: text/html;
>>> charset=UTF-8
>>>
>>>
>>> I try:
>>>
>>> In the controller $this->header('Content-type: application/pdf'); and
>>> header('Content-type: application/pdf');
>>>
>>> But i get always the wrong content-type.
>>>
>>> How i can change the content type?
>>>
>>> Thanks for help.
>>> gloop
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>>> others with their CakePHP related questions.
>>>
>>>
>>> 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
>>
>>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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



-- 
-Carlos

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Get a value of a select using JS helper.

2011-12-07 Thread Carlos Lavin
Can you share with us the output javascript the helper creates?

2011/12/7 GG 

> I'm trying to build a simple dynamic state / city dropdown menu that
> pulls from my database... Everything is working except I cannot get
> the value of the "#divstate" to further populate the city... If I
> manually enter a # into 'param1', it gets the correct information, and
> correctly updates the "#divcity"
>
> Let me know if you need more code, thanks!
>
>
> 
> echo $this->Form->create('newForm');
> echo $this->Form->input('teacher', array ('type'=>'select', 'id' =>
> 'divstate', 'options' => $states ));
> echo $this->Form->input('classes', array ('type'=>'select', 'id' =>
> 'divcity', 'empty' => '-- Pick a state first --'));
> echo $this->Form->end();
> ?>
>
>
> 
> $this->Js->get('#divstate')->event('change',
> $this->Js->request(array(
>  'action' => 'getcities', 'param1'), array(
>  'async' => true,
>  'update' => '#divcity',
>  'data' => '$("divstate").serialize()',
>  'dataExpression' => true
> )));
>
>
> ?>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>



-- 
-Carlos

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: HABTM/Linking table structure question

2010-10-27 Thread Carlos Lavin
It is "standard". However, CakePHP isn't built to manage multi-column PK's,
always single columned

2010/10/27 Dan 

> On Oct 27, 3:07 pm, cricket  wrote:
> > On Wed, Oct 27, 2010 at 8:07 AM, Dan  wrote:
> > > Structure:
> >
> > > Projects
> > > - project_id
> > > - project_name
> >
> > > Contacts
> > > - contact_id
> > > - contact_name
> >
> > > Contacts_Projects
> > > - project_id
> > > - contact_id
> >
> > > When reading the Cookbook, in a HABTM setting, I should add an ID
> > > field to the Contacts_Projects table.
> >
> > That's not a requirement. But, if you find that you need to store
> > extra information in the join table, it's recommended that you then
> > add a primary key.
> >
> > > Wouldn't this field enable the
> > > possibility of having duplicates?
> >
> > UNIQUE(project_id, contact_id);
> >
> > This creates an index. That's why a PK isn't absolutely necessary.
> >
> > > Or does the ID field only act as auto number, but the key is still
> > > composed of project_id/contact_id?
> >
> > Sort of. The id column becomes the PK and you'd then have two indexes
> > on the table. If you do add a PK, you should keep the unique index as
> > that's what Cake will be using. However, Cake doesn't ever use
> > multi-column PKs..
>
> Okay, so if my linking table has a PK comprised of these two fields
> (and no ID auto number field) should I remove the primary key and
> replace it with an index?
>
> My goal is to simply associate contacts to a project, thus each
> model's PK. I don't need the ID field in that case right?
>
> > that's what Cake will be using. However, Cake doesn't ever use
> > multi-column PKs..
>
> I always thought that having a multi-column PK was "standard" when
> developing a DB?
>
> Next, putting those associations to work :)
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
-Carlos

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: SQL Server 2008 driver for CakePHP?

2010-06-22 Thread Carlos Lavin
Another problem I've come across using IIS with cake is that IIS has
problems when using ":" in your urls, so you'll probably need to change that
in cakephp's libs if you intend to use it for params

2010/6/22 Carlos Lavin 

> Well, you pretty much need to write a new dbo that implements the new SQL
> Server connections. If you look around in google there's this unfinished dbo
> driver with still quite a few opportunity areas, but I guess it's better
> than starting from scratch
>
> 2010/6/22 gbudiman 
>
> I've the weirdest development environment I can think of: IIS, SQL
>> Server 2008, and PHP. I'm not going with ASP.NET or Silverlight, so
>> please don't direct me there. I've had trouble setting up CakePHP
>> configuration for SQL Server 2008 database.
>>
>> This is my configuration (CakePHP):
>> class DATABASE_CONFIG {
>>var $default = array(
>>'driver' => 'mssql',
>>'persistent' => true,
>>'host' => '',
>>'database' => '...',
>>'prefix' => ''
>>);
>> }
>> And the welcome page will only output "Your database configuration
>> file is present." and white page afterwards. CSS is not loaded, and
>> help content after that is not displayed. If I changed 'driver' =>
>> 'mysql', CSS is loaded, help content appeared. (URL rewriting works
>> fine, it's not the problem)
>>
>> Normally, connection string on old school PHP development is:
>> $serverName = '(local)';
>> $connectionInfo = array("Database" => "...");
>> $connectionResource = sqlsrv_connect($serverName, $connectionInfo);
>> And it works fine. (Yes, that's the new php_sqlsrv.dll driver, not the
>> old php_mssql.dll)
>> How do we fix this on CakePHP?
>>
>> Thanks
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>
>
> --
> -Carlos
>



-- 
-Carlos

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: SQL Server 2008 driver for CakePHP?

2010-06-22 Thread Carlos Lavin
Well, you pretty much need to write a new dbo that implements the new SQL
Server connections. If you look around in google there's this unfinished dbo
driver with still quite a few opportunity areas, but I guess it's better
than starting from scratch

2010/6/22 gbudiman 

> I've the weirdest development environment I can think of: IIS, SQL
> Server 2008, and PHP. I'm not going with ASP.NET or Silverlight, so
> please don't direct me there. I've had trouble setting up CakePHP
> configuration for SQL Server 2008 database.
>
> This is my configuration (CakePHP):
> class DATABASE_CONFIG {
>var $default = array(
>'driver' => 'mssql',
>'persistent' => true,
>'host' => '',
>'database' => '...',
>'prefix' => ''
>);
> }
> And the welcome page will only output "Your database configuration
> file is present." and white page afterwards. CSS is not loaded, and
> help content after that is not displayed. If I changed 'driver' =>
> 'mysql', CSS is loaded, help content appeared. (URL rewriting works
> fine, it's not the problem)
>
> Normally, connection string on old school PHP development is:
> $serverName = '(local)';
> $connectionInfo = array("Database" => "...");
> $connectionResource = sqlsrv_connect($serverName, $connectionInfo);
> And it works fine. (Yes, that's the new php_sqlsrv.dll driver, not the
> old php_mssql.dll)
> How do we fix this on CakePHP?
>
> Thanks
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
-Carlos

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: Slug name limitations

2009-08-05 Thread Carlos Lavin
But still... if a user chooses admin for slug, it would cause quite a bit of
trouble...
My guess is the only way to avoid this is to either hardcode an array of
reserved words and keep changing it as you add controllers-actions, or
simply do what u mentioned in first post about querying the ACOS table...
maybe that + reserverd words would be the best solution

2009/8/5 Jamie 

>
> Well, it all depends on the order of your Router rules in routes.php.
> If you put the rule to interpret /admin as going to your admin area
> BEFORE the rule to process those generic slugs, then you won't have a
> problem. Generally, you want to put those catch-all router rules at or
> near the end of routes.php, after any specific router rules.
>
> On Aug 4, 8:18 pm, "Dave Maharaj :: WidePixels.com"
>  wrote:
> > I have for example
> >
> > Site/slug => which goes to controller users, action view
> >
> > Or site/slug/profile => which goes to controller users, action profile
> >
> > So if someone used "admin" for example
> >
> > It would go to site/admin which obviously would get them nowhere.
> >
> > I put my slug in front of the controller/action
> >
> > -Original Message-
> > From: JamesF [mailto:usaexportexpe...@gmail.com]
> > Sent: August-05-09 12:21 AM
> > To: CakePHP
> > Subject: Re: Slug name limitations
> >
> > im not sure i understand why a slug should conflict with you functions.
> > /posts/index/id-slug should be ok.
> > can you explain a little more?
> >
> > On Aug 4, 8:49 am, "Dave Maharaj :: WidePixels.com"
> >  wrote:
> > > How would you validate a user created slug so that it is not a name
> > > used as a function in the app? (in my app they choose the slug they
> > > want...not created by first + lastname)
> >
> > > I obviuosly do not want a user choosing a slug "admin" or any
> > > controller name || function?
> > > Since all of these are stored in the ACOS table is it best to query
> > > the table against what the user submits?
> >
> > > 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: delete post AND unlink image

2009-07-29 Thread Carlos Lavin
Read it before you delete it, you are trying to read a record that is
already deleted

2009/7/29 bberg 

>
> thanks for the reply.
> thought of that. but i'm having a hard time retrieving the $image var.
> here's what i'm trying to figure out, but it doesn't work:
>
> [code]
> if ($this->Model->del($id)) {
>$image = $this->Model->read('image', $id);
>if(unlink($image))
>{
> //success
>}
> }
> [/code]
>
> >
>

--~--~-~--~~~---~--~~
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: Find conditions

2009-07-21 Thread Carlos Lavin
Order the resultset by created and limit the result to 1 entry

2009/7/21 Dave Maharaj :: WidePixels.com 

>  How would I find the newest entry added using the created date?
>
> 'conditions' => array(
>   'Entry.showcase_id' => $showcase_id, 'Entry.created' => not sure
> how to get the newest??/?),
>
> 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: Login authentication

2009-07-20 Thread Carlos Lavin
$form->create('User', array('action' => 'login'))

2009/7/20 Dhileepen Chakravarthy 

> Thank you for your reply.
> But its not working.I dnt know where i did a mistake.
>
> I am using two tables one is posts and users.
>
> Login i use *'users' *table. inside i am using *'posts'* table for
> displaying blog posts.
>
> index.ctp for login screen with form fields. ( $form->create('Post',
> array('action' => 'login')) )
> posts_cotroller.php for action code.
> post for model.
>
> how do i use here user model and users_controller.php here for
> authentication.
>
> if i using those  controller goes into users folder. but my application in
> posts folder only.
>
> Regards,
> Dhileep
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Sanitize:clean replacing hyphens in email addresses

2009-07-20 Thread Carlos Lavin
h() is cake's wrapper for htmlspecialchars()
http://book.cakephp.org/view/121/Global-Functions#h-703

2009/7/20 Bs 

>
> Hi,
>
> thanks for your answer. What do you mean by "h() function"?
>
>
>
> On 17 Jul., 19:13, "Dr. Loboto"  wrote:
> > I personally validate data before save and output it on pages through h
> > () function. That's all. No modification of user data. With such
> > approach I do not see use forSanitize::clean() at all.
> >
> > On Jul 17, 6:34 pm, Bs  wrote:
> >
> > > Hi,
> >
> > > I'm usingSanitize::clean tosanitizemy user data on a registration
> > > page after this tutorial:
> >
> > >http://www.jonnyreeves.co.uk/2008/06/cakephp-activating-user-account-.
> ..
> >
> > > Like mentioned in an much older thread, the sanitizer replaces the
> > > hyphens in email addresses for some reason:
> >
> > >http://groups.google.de/group/cake-php/browse_thread/thread/d0debc94f.
> ..
> >
> > > Are there any new methods to fix this behaviour than writing an own
> > > method which afterwards brings the hyphens back again? Will this
> > > possibly be fixed in a future cakephp release?
> >
>

--~--~-~--~~~---~--~~
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: Model naming convention not working as documented in form input?

2009-07-20 Thread Carlos Lavin
Yep.. looks like your missing a dot there(before the kpi_colour_id') which
Piotr pointed out

2009/7/20 Piotr Kilczuk 

>
> Hello,
>
> > echo $form->input('ChartsKpis.' . $kpi['Kpi']['id'] .
> > 'kpi_colour_id');
> >
> > However the resulting input has the format:
> >
> > 
> >
> > It seems to have got the id correct; but the name attribute hasn't
> > been created in the same way as the documentation states.
> >
> > So which is right, the documentation or the Cake generated code?
>
> Not sure, but I know which is wrong ;-)
>
> How about:
> echo $form->input('ChartsKpis.' . $kpi['Kpi']['id'] . '.kpi_colour_id');
>
>
> Regards,
> Piotr
>
> >
>

--~--~-~--~~~---~--~~
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: belongsto relationship not working

2009-07-19 Thread Carlos Lavin
Cake expects it to be called field_id... although im not sure that is whats
creating the problem.. give it a shot and let us know

2009/7/19 Travis 

>
> "fields_id" is what the FK is called in the table,
>
> I have a table called fields, when I created the foreign key in
> irrigation_events I called it fields_id.
>
> Travis
>
> On Jul 16, 1:30 pm, Piotr Kilczuk  wrote:
> > Hello,
> >
> >
> >
> >
> >
> > > I have successfully set up other belongsto relationships in this
> > > program but one does not work
> >
> > > the model code is:
> >
> > > class IrrigationEvent extends AppModel
> > > {
> > >var $name = 'IrrigationEvent';
> > >var $useTable = 'irrigation_events';
> > >var $belongsTo = array(
> > >'Field' => array(
> > >'className' => 'Field',
> > >'foreignKey'=> 'fields_id'
> > >));
> > > }
> > > ?>
> >
> > FK should be field_id?
> >
> > Regards,
> > Piotr
> >
>

--~--~-~--~~~---~--~~
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 keep Session data clean and not messed up

2009-07-19 Thread Carlos Lavin
Also.. if you know what info gets loaded to the session in what page.. you
could check at each page's action that the info isnt already in session as
in:
(dont feel like coding btw)

function page_a_action{
   if(stuff in session)
clean(stuff in session)
  //rest of the code here
}


2009/7/19 Carlos Lavin 

> If you need it all at the end of the wizard.. you could just carry it from
> A to B to C with a bunch of hiddens...not the most fancy way to do it but
> neither is saving it all in session
>
> 2009/7/19 lapinski 
>
>
>>
>>
>> Why it doesn't work for you?  If you need everything fresh every time a
>> user
>> starts over, then POST is a solution.
>>
>> Lapinski
>>
>>
>> Raph-8 wrote:
>> >
>> >
>> > Yes - I'm afraid you missed the point. ;)
>> >
>> > It's only an example and using $_POST it's not the solution IMHO.
>> >
>> > On 19 Lip, 15:50, MrMeikel  wrote:
>> >> (Apologies if I have missed the point...)
>> >>
>> >> If you only want to save information when the user has gone from pageA
>> >> directly to pageB, couldn't you use $_POST? Sounds like you're using a
>> >> form anyway, so just set the target to pageB and check the (correct)
>> >> information has been passed - ie. posted from pageA.
>> >>
>> >> On Jul 19, 1:43 pm, Raph  wrote:
>> >>
>> >>
>> >>
>> >> > Let's say I've got an exmaple application, and in this application
>> >> > there are a few wizards. User goes to one of the wizards, inputs data
>> >> > in form in step 1, then goes to step 2. Data from step 1 was saved in
>> >> > session.  Now user should do somehting in step 2 and go to step 3,
>> but
>> >> > he dosen't do that. He clicks "back" button in his browser, or maybe
>> >> > he types url in address bar and goes to place in the system outside
>> >> > the wizard.
>> >>
>> >> > The problem is those data in session. It wasn't removed and it still
>> >> > there. User could go to another wizard and do the same thing and new
>> >> > unnecessary data appear in session.
>> >>
>> >> > How you handle situations like that?
>> >>
>> >> > --
>> >> > Raph
>> > >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-keep-Session-data-clean-and-not-messed-up-tp24556669p24560643.html
>> Sent from the CakePHP mailing list archive at Nabble.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: How to keep Session data clean and not messed up

2009-07-19 Thread Carlos Lavin
If you need it all at the end of the wizard.. you could just carry it from A
to B to C with a bunch of hiddens...not the most fancy way to do it but
neither is saving it all in session

2009/7/19 lapinski 

>
>
>
> Why it doesn't work for you?  If you need everything fresh every time a
> user
> starts over, then POST is a solution.
>
> Lapinski
>
>
> Raph-8 wrote:
> >
> >
> > Yes - I'm afraid you missed the point. ;)
> >
> > It's only an example and using $_POST it's not the solution IMHO.
> >
> > On 19 Lip, 15:50, MrMeikel  wrote:
> >> (Apologies if I have missed the point...)
> >>
> >> If you only want to save information when the user has gone from pageA
> >> directly to pageB, couldn't you use $_POST? Sounds like you're using a
> >> form anyway, so just set the target to pageB and check the (correct)
> >> information has been passed - ie. posted from pageA.
> >>
> >> On Jul 19, 1:43 pm, Raph  wrote:
> >>
> >>
> >>
> >> > Let's say I've got an exmaple application, and in this application
> >> > there are a few wizards. User goes to one of the wizards, inputs data
> >> > in form in step 1, then goes to step 2. Data from step 1 was saved in
> >> > session.  Now user should do somehting in step 2 and go to step 3, but
> >> > he dosen't do that. He clicks "back" button in his browser, or maybe
> >> > he types url in address bar and goes to place in the system outside
> >> > the wizard.
> >>
> >> > The problem is those data in session. It wasn't removed and it still
> >> > there. User could go to another wizard and do the same thing and new
> >> > unnecessary data appear in session.
> >>
> >> > How you handle situations like that?
> >>
> >> > --
> >> > Raph
> > >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/How-to-keep-Session-data-clean-and-not-messed-up-tp24556669p24560643.html
> Sent from the CakePHP mailing list archive at Nabble.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: Using mod_rewrite without .htaccess overhead (quick solution)

2009-07-19 Thread Carlos Lavin
Does anyone know how much this "overhead" really represents?

2009/7/19 Enrique 

>
> Hi Cake Fans,
>
> just a quick note on how to use CakePHP with mod_rewrite but without
> the unnecessary .htaccess overhead:
>
> http://www.creative-outsourcing.com/cakephp-using-mod_rewrite-without-.htaccess-overhead.html
>
> - Enrique
> >
>

--~--~-~--~~~---~--~~
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: Associations - naming conventions

2009-07-17 Thread Carlos Lavin
Club hasMany users sounds a bit less illogical.. but yeah, user belongsTo
club

2009/7/16 Piotr Kilczuk 

>
> Hello,
>
> > Now I have a problem with the hasOne association.
> > Users have a favorite club (favclub) which is a foreign key to the
> > Clubs (contains id and name) table. How do I code that? So every user
> > hasOne favclub (referring to clubs.id)?
> >
> > Thanks for much appreciated your help.
>
> This might be illogical at first, but it's a belongsTo relationship.
>
> User belongsTo his favorite club :)
>
> Regards,
> Piotr
>
> >
>

--~--~-~--~~~---~--~~
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: hasMany question

2009-07-17 Thread Carlos Lavin
Merely a wrapper for find... more documentation about it on:
http://api.cakephp.org/class/model

2009/7/16 fedekun 

>
> Thanks! Hmm is there a way to do that on read instead of find?
> I have... $this->Post->read(null, $id);
> I cant find documentationfor read method though..i just find about
> "find", "findAll" etc...
>
> On 16 jul, 10:59, Carlos Gonzalez Lavin 
> wrote:
> > A thorough read of the cookbook is always a good place to start
> > I have never tried sorting by two fields, but how about:
> >
> > *$this->Post->find('all',array('order' => array('Post.created ASC',
> > 'Comment.created DESC')));*
> >
> > if that doesnt work:
> >
> > *$this->Post->find('all',array('order' => 'Post.created ASC,
> Comment.created
> > DESC'));*
> >
> > And you can't do $this->Comment in the Posts Controller because $this
> refers
> > to an instance of the class (Posts Controller)... and this class by
> itself
> > doesn't have an instantiated reference to the Comment model's class...
> >
> > However, due to the defined relationships, cake takes care of making a
> > reference of the Comment model instance inside the Post model instance
> > (which the Posts Controller can acces through $this->Post).. making it
> > accesible by $this->Post->Comment
> >
> > Hope I didn't confuse you much
> >
> > 2009/7/15 fedekun 
> >
> >
> >
> > > Hi! I have just started with CakePHP and it seems very good so far!
> > > But i have a little question... i have a Post model, each post
> > > "hasMany" comments, and comments "belongsTo" a Post.
> > > So, recursive in the Post model is default, so when i do
> > > $this->Post->find('all');
> > > I get all posts and comments, now...If i want to order posts ASC and
> > > comments DESC...How do i do it?
> > > Also, another thing i dont know...When i'm in the Posts controller, i
> > > do
> > > $this->Post->find to get posts
> > > and $this->Post->Comment->find to get comments
> > > Why not $this->Comment->find ?
> >
>

--~--~-~--~~~---~--~~
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: form with reset and submit button

2009-07-17 Thread Carlos Lavin
Or you could do it with javascript... sending a server request(+ the
framework's overhead) just to empty your fields is plain lazy programming

2009/7/17 John Andersen 

>
> For the solution to do the clearing in the controller!
>
> Change the buttons to:
>
> echo $form->submit('Clear', array('name'=>'clear'));
> echo $form->submit('Save Post', array('name'=>'save'));
>
> In the controller, check for which button was used:
>
>  if (!empty($this->data))
>  {
> ...
>if ( isset($this->params['form']) and isset($this->params['form']
> ['clear']) )
>{
>   $this->data['Post']['title'] = '';
>   $this->data['Post']['body'] = '';
>}
>else
> {
>  if ($this->Post->save($this->data))
>  {
> ...
>
> Enjoy,
>   John
>
> On Jul 17, 8:31 am, Dhileepen Chakravarthy
>  wrote:
> > Thanks all
> >
> > 
> >
> > Add Post
> >  > echo $form->create('Post');
> > echo $form->input('title');
> > echo $form->input('body', array('rows' => '3'));
> > echo $form->button('Reset', array('type'=>'reset'), action=);
> > echo $form->submit('Save Post');
> > echo $form->end();
> > ?>
> >
> > //controller
> > function add()
> >  {
> >   if (!empty($this->data))
> >   {
> >if ($this->Post->save($this->data))
> >{
> > $this->Session->setFlash('Your post has been saved.');
> > $this->redirect(array('action' => 'index'));
> >}
> >   }
> >  }
> >
> > how do i add the controller code here
> >
>

--~--~-~--~~~---~--~~
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: Model association problem

2009-07-17 Thread Carlos Lavin
Tables are supposed to be plural (users,groups,medicinal_devices) and the
foreign keys singular(user_id,group_id...)
Change it and give it another shot =)

2009/7/17 Zoran Kovac 

> Here are some of the table fields. it's the table USER, GROUPS and
> MEDICIANL DEVICE.
> In short relatons are: ser should be in one group and have many MedDevice,
> group should have one user, medicinal
> device should have only one user.
>
>
> CREATE  TABLE IF NOT EXISTS `baza2`.`USER` (
>   `id` INT NOT NULL AUTO_INCREMENT ,
>   `UserName` VARCHAR(45) NULL ,
>   `Password` VARCHAR(45) NULL COMMENT '
> ' ,
>   `Surname` VARCHAR(45) NULL ,
>   `Name` VARCHAR(45) NULL ,
>   `groups_id` INT NULL ,
>   PRIMARY KEY (`id`) ,
>   INDEX `fk_USER_GROUPS` (`groups_id` ASC) ,
>   CONSTRAINT `fk_USER_GROUPS`
> FOREIGN KEY (`groups_id` )
> REFERENCES `baza2`.`GROUPS` (`id` )
> ON DELETE CASCADE
> ON UPDATE CASCADE)
> ENGINE = InnoDB;
>
>
> -- -
> -- Table `baza2`.`MANUFACTURER`
> -- -
> CREATE  TABLE IF NOT EXISTS `baza2`.`MANUFACTURER` (
>   `id` INT NOT NULL AUTO_INCREMENT ,
>   `Name` VARCHAR(45) NULL ,
>   `Address` VARCHAR(45) NULL ,
>   `Phone` VARCHAR(45) NULL ,
>   `Contact` VARCHAR(45) NULL ,
>   `Mail` VARCHAR(45) NULL ,
>   `user_id` INT NULL ,
>   PRIMARY KEY (`id`) ,
>   INDEX `fk_MANUFACTURER_USER` (`user_id` ASC) ,
>   CONSTRAINT `fk_MANUFACTURER_USER`
> FOREIGN KEY (`user_id` )
> REFERENCES `baza2`.`USER` (`id` )
> ON DELETE CASCADE
> ON UPDATE CASCADE)
> ENGINE = InnoDB;
>
>
> -- -
> -- Table `baza2`.`MEDICINAL_DEVICE`
> -- -
> CREATE  TABLE IF NOT EXISTS `baza2`.`MEDICINAL_DEVICE` (
>   `id` INT NOT NULL AUTO_INCREMENT ,
>   `Name` VARCHAR(45) CHARACTER SET 'big5' COLLATE 'big5_chinese_ci' NULL
> COMMENT '' ,
>   `ActiveIng` VARCHAR(45) NULL ,
>   `PharmaForm` VARCHAR(45) NULL ,
>   `RouteAdministration` VARCHAR(45) NULL ,
>   `DailyDose` VARCHAR(45) NULL ,
>   `user_id` INT NULL ,
>   `manufacturer_id` INT NULL ,
>   PRIMARY KEY (`id`) ,
>   INDEX `fk_MEDICINAL_DEVICE_USER` (`user_id` ASC) ,
>   INDEX `fk_MEDICINAL_DEVICE_MANUFACTURER` (`manufacturer_id` ASC) ,
>   CONSTRAINT `fk_MEDICINAL_DEVICE_USER`
> FOREIGN KEY (`user_id` )
> REFERENCES `baza2`.`USER` (`id` )
> ON DELETE CASCADE
> ON UPDATE CASCADE,
>   CONSTRAINT `fk_MEDICINAL_DEVICE_MANUFACTURER`
> FOREIGN KEY (`manufacturer_id` )
> REFERENCES `baza2`.`MANUFACTURER` (`id` )
> ON DELETE CASCADE
> ON UPDATE CASCADE)
> ENGINE = InnoDB;
>
>
>
> On Thu, Jul 16, 2009 at 4:02 PM, Carlos Gonzalez Lavin <
> carloslavi...@gmail.com> wrote:
>
>> Maybe if you described the tables' fields.. theres gotta be some
>> convention breaking there
>>
>> 2009/7/16 Zoran Kovac 
>>
>>>
>>> Hi!
>>>
>>> I'm having a dilema, maybe the better word is that I'm puzzled.
>>>
>>> The problem is when I'm baking models. The console doesn't detect
>>> relations between tables automatically. For instance, the console does
>>> recognize all the tables from the database, but when it's triying to
>>> detect associations it comes up with the result like on the end of
>>> this post or just skips to 'Look okay?'. It the noted example on end
>>> of the post, I manage to create a complete model (with association to
>>> user), but association among other models fails.
>>>
>>> So my question's are:
>>>
>>> 1. Am I breaking some convetions and it's not working?
>>> 2. Could it be that I'm using InnoDB type?
>>> 3. Anything else?
>>>
>>> Any kind of sugestions is appreciated. Thnx.
>>>
>>>
>>> Possible Models based on your current database:
>>> 1. DocumentsDevice
>>> 2. Group
>>> 3. InvestigationalSite
>>> 4. Investigator
>>> 5. Manufacturer
>>> 6. MedicinalDevice
>>> 7. MedicinalProduct
>>> 8. ReportDevice
>>> 9. ReportProduct
>>> 10. SoaDevice
>>> 11. SoaProduct
>>> 12. User
>>> Enter a number from the list above, type in the name of another model,
>>> or 'q' to
>>>  exit
>>> [q] > 2
>>> Would you like to supply validation criteria for the fields in your
>>> model? (y/n)
>>>
>>> [y] > n
>>> Would you like to define model associations (hasMany, hasOne,
>>> belongsTo, etc.)?
>>> (y/n)
>>> [y] > y
>>> One moment while the associations are detected.
>>> ---
>>> Please confirm the following associations:
>>> ---
>>> Would you like to define some additional model associations? (y/n)
>>> [n] >
>>>
>>> 
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> Zoran Kovac
> 091/ 588 6175
> V.Gorica
>
>
> >
>

--~--~-~--~~~---~--~~
You received t

Re: $_POST

2009-07-17 Thread Carlos Lavin
Or just pr($_REQUEST)... cakephp's pre wrapper
http://book.cakephp.org/view/707/pr

2009/7/17 womble 

>
> I think you may find that FB sends the fb_sig varibales in $_GET. Just
> to test it, in your controller method:
> echo '';
> print_r($_REQUEST);  // or print_r($_GET);
> echo '';
> exit;
>
>
> On Jul 16, 9:57 am, mario vallejo  wrote:
> > Hello and thank you for your time and attention. I am building a
> > Facebook app and I want to use CakePHP to build it. The problem is the
> > following
> >
> > I have tried to translate this into cake to no avail:
> >
> > $is_tab = isset($_POST['fb_sig_in_profile_tab']);
> >
> > if( !$is_tab ) $user = $fb->require_login();
> >
> > And that's really the only thing left in order to finish my app. I
> > have got no clue on how to access 'normal' $_POST data inside of cake.
> > Thank you very much and I really appreciate this.
> >
> > Mario R. Vallejo
> >
>

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