Re: Tree Behavior Issue

2012-04-27 Thread Michael Gaiser
Yep... that would cause an issue. Thanks.

On Fri, Apr 27, 2012 at 9:12 PM, lowpass  wrote:
> public $actsAs = array('Tree');
>
> Notice the lowercase s you left out.
>
> On Fri, Apr 27, 2012 at 7:39 PM, Michael Gaiser  wrote:
>> I want to use the Tree Behavior on one of my models in 2.1, but it has
>> multiple belongsTo relationships which I think is messing it up.
>>
>> In my domain model I have added:
>>
>> public $actAs = array('Tree');
>>
>>
>>
>> In my controller I have:
>>
>> public function index() {
>> $data = $this->Domain->generateTreeList(null, null, null, 
>> '   ');
>> debug($data); die;
>> }
>>
>> It gives me a database error:
>>
>> Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You
>> have an error in your SQL syntax; check the manual that corresponds to
>> your MySQL server version for the right syntax to use near
>> 'generateTreeList' at line 1
>>
>>
>> I have also used $this->Domain->recover() and got the same message. Is
>> there some step I am missing? It didnt seem to be this difficult to do
>> in 1.3
>>
>> --
>> 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

-- 
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 2.1.1 Performance

2012-04-27 Thread Justin Edwards
http://xdebug.org/docs/profiler

On Sat, Apr 28, 2012 at 12:16 AM, Thiago Belem
wrote:

> Can you provide more information about you server like os, versions, cache
> setup and etc?
>
> Regards,
> --
>
> Thiago Belem
>
> Enviado do meu Android (e sujeito a erros do corretor automático)
> Em 27/04/2012 20:17, "Mika"  escreveu:
>
> Since we upgraded our web application to Cake 2.1.1 it has literally
>> killed our server several times. In WHM the "Server load (4 CPUs)"
>> under Service Status runs above 15 the entire time, and spikes up to
>> 50 and as high as 70, at which point the server basically dies.
>>
>> The same application under exactly the same load running on Cake
>> 1.3.15 does not have near the same effect on the server. On 1.3.15 the
>> server load in WHM never exceeds 2.
>>
>> It is exactly the same application. The only changes we made were ones
>> required to make the application run on Cake 2.1.1. There is nothing
>> else running on the server. It's dedicated to just this one web
>> application.
>>
>> We've swapped the code base back and forth (between 1.3.15 and 2.1.1)
>> a few times on the live server, and the results were the same every
>> time. On 1.3.15 the server hums, on 2.1.1 it dies.
>>
>> Has anyone else had similar experiences?
>>
>> --
>> 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
>

-- 
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 2.1.1 Performance

2012-04-27 Thread Thiago Belem
Can you provide more information about you server like os, versions, cache
setup and etc?

Regards,
--

Thiago Belem

Enviado do meu Android (e sujeito a erros do corretor automático)
Em 27/04/2012 20:17, "Mika"  escreveu:

> Since we upgraded our web application to Cake 2.1.1 it has literally
> killed our server several times. In WHM the "Server load (4 CPUs)"
> under Service Status runs above 15 the entire time, and spikes up to
> 50 and as high as 70, at which point the server basically dies.
>
> The same application under exactly the same load running on Cake
> 1.3.15 does not have near the same effect on the server. On 1.3.15 the
> server load in WHM never exceeds 2.
>
> It is exactly the same application. The only changes we made were ones
> required to make the application run on Cake 2.1.1. There is nothing
> else running on the server. It's dedicated to just this one web
> application.
>
> We've swapped the code base back and forth (between 1.3.15 and 2.1.1)
> a few times on the live server, and the results were the same every
> time. On 1.3.15 the server hums, on 2.1.1 it dies.
>
> Has anyone else had similar experiences?
>
> --
> 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


Re: get output controller from another controller

2012-04-27 Thread lowpass
I don't know if this is all you need but these might help:

$this->response->type('xml');
$this->viewPath = 'events';
$this->view = 'view';  // assuming app/views/events/view.ctp

On Fri, Apr 27, 2012 at 2:45 AM, Christophe Vandeplas
 wrote:
> Hello,
>
>
> ( using CakePHP 2.1 )
> I'm building an application that synchronizes data between different
> instances of my application. (download and upload)
>
> My application is REST enabled and thus I can call controller actions
> from external applications and get the result in clean xml. However it
> is not only a REST server, but also a REST client.
>
> Downloading data from the other instance is easy. I do a $xml =
> Xml::build($xmlurl); and process the $xml variable to import
> everything into my database. Perfect.
>
> However I am stuck in the other direction: Uploading data.
> I could simply do a $xmldata = Xml::fromArray($event)->asXML() however
> there is some cleaning to be done. This cleaning is what I do in my
> REST view as my REST clients should see the same xml as what I'm
> uploading to the other instance.
> So if I already do all the work in my rest view, why recoding exactly
> the same filtering?
>
> The url /events/view/5.xml  calls  EventsController->view(5) with XML
> layout and outputs everything in XML, exactly as I want it.
>
> I have a ServersController->push() function.
> This function needs to do get the same output as /events/view/5.xml ,
> and upload it using a REST POST request to the other instance.
>
> You could say I could simply call the /events/view/5.xml page using an
> HTTP request from the application.
> However it seems absurd as i) it seems absurd (and inefficient/slow)
> to do HTTP requests to yourself to extract data and ii) I have
> authentication on my REST calls which makes it a lot more difficult.
>
> I tried with :
> $eventsController = new EventsController();
> $eventsController->set('event', $event);
> $view = new View($eventsController);
> $viewdata = $view->render('view');
>
> But this only outputs the data in HTML, and not XML.
> I tried to play with the CakeResponse object in that newly created
> $eventsController, but that doesn't work. (there are no request or
> response instances created, and creating them myself doesn't work)
>
>
> So my question is:
> What is the best way to get the output of /events/view/5.xml
> (EventsController->view(5) ) inside another controller ?
>
>
> Thanks for your expertise.
> Christophe
>
> --
> 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


Re: When using the delete action what is a good way to retrieve field data?

2012-04-27 Thread lowpass
You can also create a beforeDelete method in the model itself. When
it's called, the Model::id will have been set.

On Fri, Apr 27, 2012 at 2:31 PM, Daniel  wrote:
> Don't worry I used $this->Model->find('first', ...
>
> 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

-- 
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: Hide "previous" "next" when no pagination

2012-04-27 Thread lowpass
You should test hasPrev() and hasNext() for it to work properly
regardless of the current page number.

On Fri, Apr 27, 2012 at 8:32 AM, JonStark  wrote:
> The last solution is the easiest,
>
> for those interested, this works really well :
>
>  if ($this->Paginator->hasPage(2)) {
> echo ("");
> echo $this->Paginator->prev();
> echo (" | ");
> } ?>
> Paginator->numbers(); ?>
>  if ($this->Paginator->hasPage(2)) {
> echo (" | ");
> echo $this->Paginator->next();
> } ?>
>
>
> Le jeudi 26 avril 2012 18:17:49 UTC+2, JonStark a écrit :
>>
>> How can I hide the "<< Previous Next >>" that appears if there is no pages
>> to paginate ?
>> I think this is possible because the numbers do not appear when not
>> needed.
>>
>> Thanks a lot !
>
> --
> 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


Re: Tree Behavior Issue

2012-04-27 Thread lowpass
public $actsAs = array('Tree');

Notice the lowercase s you left out.

On Fri, Apr 27, 2012 at 7:39 PM, Michael Gaiser  wrote:
> I want to use the Tree Behavior on one of my models in 2.1, but it has
> multiple belongsTo relationships which I think is messing it up.
>
> In my domain model I have added:
>
> public $actAs = array('Tree');
>
>
>
> In my controller I have:
>
> public function index() {
> $data = $this->Domain->generateTreeList(null, null, null, 
> '   ');
> debug($data); die;
> }
>
> It gives me a database error:
>
> Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You
> have an error in your SQL syntax; check the manual that corresponds to
> your MySQL server version for the right syntax to use near
> 'generateTreeList' at line 1
>
>
> I have also used $this->Domain->recover() and got the same message. Is
> there some step I am missing? It didnt seem to be this difficult to do
> in 1.3
>
> --
> 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


Re: Table name with no meaning in eglish

2012-04-27 Thread mohit kumar
just follow the Cake naming conventions for non-english words

On Sat, Apr 28, 2012 at 1:11 AM, Mamdouh  wrote:

> Hi I'm new to CakePHP and I'm wondering if I can use as table name a
> words that has no meaning in english. if yes how can I do that ?
> 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
>



-- 
Best Regards,
Mohit Kumar

-- 
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: Pagination

2012-04-27 Thread jeremyharris
Why didn't you use the $belongsTo array I gave you? Your belongsTo has 
changed the aliases from MainCity to main_city, so paginating by MainCity 
will not work.

Rename the aliases to be CamelCased and try again. Also, debug the results 
of $this->paginate() to make sure it includes the MainCity and any other 
data you are trying to sort by.

-jeremy

On Friday, April 27, 2012 4:45:16 PM UTC-7, Hill180 wrote:
>
> Here is the real example I am trying.
>
> The webpage has a list of work order that are open.
>
>
> Paginator->sort('Work Order ID','WorkOrder.id') ?> 
> //works
> Paginator->sort('Customer','Customer.name') ?> 
> //works
> Paginator->sort('City','MainCity.name') ?> //no 
> worky
>
> Customer Model:
>
> var $belongsTo = array(
>'main_city' => array(
> 'className' => 'City',
> 'foreignKey' => 'main_city_id',
> 'conditions' => '',
> 'fields' => '',
> 'order' => ''
> ),
> 'billing_city' => array(
> 'className' => 'City',
> 'foreignKey' => 'billing_city_id',
> 'conditions' => '',
> 'fields' => '',
> 'order' => ''
> ),...
>
>   var $hasMany = array(
> 'WorkOrder' => array(
> 'className' => 'WorkOrder',
> 'foreignKey' => 'customer_id',
> 'dependent' => false,
> ),
>
>
> Work Order Model
>
> var $belongsTo = array(
> 'Customer' => array(
> 'className' => 'Customer',
> 'foreignKey' => 'customer_id',
> 'conditions' => '',
> 'fields' => '',
> 'order' => ''
> ),
>   
> City Model
>
>   var $hasMany = array(
> 'MainCity' => array(
> 'className'=>'Customer',
> 'foreignKey'=> 'main_city_id',
> 'dependent'=>true,
> ),
>   'BillingCity' => array(
> 'className'=>'Customer',
> 'foreignKey'=> 'billing_city_id',
> 'dependent'=>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


Re: Pagination

2012-04-27 Thread hill180
Here is the real example I am trying.

The webpage has a list of work order that are open.


Paginator->sort('Work Order ID','WorkOrder.id') ?>
//works
Paginator->sort('Customer','Customer.name') ?>
//works
Paginator->sort('City','MainCity.name') ?> //no
worky

Customer Model:

var $belongsTo = array(
   'main_city' => array(
'className' => 'City',
'foreignKey' => 'main_city_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'billing_city' => array(
'className' => 'City',
'foreignKey' => 'billing_city_id',
'conditions' => '',
'fields' => '',
'order' => ''
),...

  var $hasMany = array(
'WorkOrder' => array(
'className' => 'WorkOrder',
'foreignKey' => 'customer_id',
'dependent' => false,
),


Work Order Model

var $belongsTo = array(
'Customer' => array(
'className' => 'Customer',
'foreignKey' => 'customer_id',
'conditions' => '',
'fields' => '',
'order' => ''
),

City Model

  var $hasMany = array(
'MainCity' => array(
'className'=>'Customer',
'foreignKey'=> 'main_city_id',
'dependent'=>true,
),
  'BillingCity' => array(
'className'=>'Customer',
'foreignKey'=> 'billing_city_id',
'dependent'=>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


Tree Behavior Issue

2012-04-27 Thread Michael Gaiser
I want to use the Tree Behavior on one of my models in 2.1, but it has
multiple belongsTo relationships which I think is messing it up.

In my domain model I have added:

public $actAs = array('Tree');



In my controller I have:

public function index() {
$data = $this->Domain->generateTreeList(null, null, null, '   ');
debug($data); die;
}

It gives me a database error:

Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You
have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near
'generateTreeList' at line 1


I have also used $this->Domain->recover() and got the same message. Is
there some step I am missing? It didnt seem to be this difficult to do
in 1.3

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


cakephp-mongodb validate subdocuments

2012-04-27 Thread Dmitriy Salko
Hello everybody,

I'm using https://github.com/ichikaway/cakephp-mongodb in my cakephp app 
and want to use cake validation. But have no idea how to validate 
sub-documents.

Did anyone do something like this before?

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


Table name with no meaning in eglish

2012-04-27 Thread Mamdouh
Hi I'm new to CakePHP and I'm wondering if I can use as table name a
words that has no meaning in english. if yes how can I do that ?
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


Paginate - conditions of linked model

2012-04-27 Thread Tim Nijssen
Hi,
I have a model called User and a model called Connection. The User has
a hasMany relation with Connection. When I use $this->paginate() I get
all Users 100 with all there Connections. Nothing strange... I get all
the users with there connections.

But.. I want to filter de Connections. So I still want all 100 users
but only show there connections with, lets say, status = 1. In CakePHP
1.3 it was something like this:

$this->User->hasMany['Connection']['conditions'] =
array('Connection.status' => 1);
$this->data = $this->User->find('all');

I'm using CakePHP 2.1 now and I want the same result with paginator.

Can someone help me to setup the controller?

Thanks, Tim.

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


CakePHP 2.1.1 Performance

2012-04-27 Thread Mika
Since we upgraded our web application to Cake 2.1.1 it has literally
killed our server several times. In WHM the "Server load (4 CPUs)"
under Service Status runs above 15 the entire time, and spikes up to
50 and as high as 70, at which point the server basically dies.

The same application under exactly the same load running on Cake
1.3.15 does not have near the same effect on the server. On 1.3.15 the
server load in WHM never exceeds 2.

It is exactly the same application. The only changes we made were ones
required to make the application run on Cake 2.1.1. There is nothing
else running on the server. It's dedicated to just this one web
application.

We've swapped the code base back and forth (between 1.3.15 and 2.1.1)
a few times on the live server, and the results were the same every
time. On 1.3.15 the server hums, on 2.1.1 it dies.

Has anyone else had similar experiences?

-- 
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: How to call element to element

2012-04-27 Thread Sean
In main view, call:

$this->element('first_element');

In 'first_element' call:

$this->element('second_element');

Hope this helps


On Thursday, April 26, 2012 8:26:48 AM UTC-4, nikunj kansara wrote:
>
> Hello,
>
> I want to call one elements to another elements
>
> example : I have view/elements/view.ctp
>
> i want to call another element from view.ctp
>
> How can i do that?
>
>

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

2012-04-27 Thread Sean
Your Consult model would use $belongsTo.

ex.

/**
 * belongsTo associations
 *
 * @var array
 */
public $belongsTo = array(
'Patient' => array(
'className' => 'Patient',
'foreignKey' => 'patient_id',
),
);// End $belongsTo

Good luck,
Sean


On Friday, April 27, 2012 5:33:06 AM UTC-4, alexkd wrote:
>
> I have two tables 1)Patient2)Consulting. Consulting has foreign key 
> patient_id. But Patient would not have Consulting_id. 
> What relation should I use? 
> I have to ensure saving to Consulting table after each saving of 
> patient. i.e its essential to saving to Consulting table after the 
> saving Patient. 
> How to ensure this?

-- 
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: When using the delete action what is a good way to retrieve field data?

2012-04-27 Thread Daniel
Don't worry I used $this->Model->find('first', ...

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


cakePHP 2.1, ckeditor + ckfinder

2012-04-27 Thread Sean
Hello again,

I am working with cakePHP 2.1.0 and have incorporated ckeditor and 
ckfinder. I have gotten the editor window to come up and even gotten the 
ckfinder "Browse Server" button to work. What I am having problems with now 
is that when I hit the "Browse Server" button, the window opens, but gives 
me the dreaded "Folder not found. Please refresh and try again." error.

I have Googled, and RTFM, but to no avail. I'm not sure what else to do. I 
have tried using my own file structure, and using the default.

Here is some code:

/*
To make it easy to configure CKFinder, the $baseUrl and $baseDir can be 
used.
Those are helper variables used later in this config file.
*/

/*
$baseUrl : the base path used to build the final URL for the resources 
handled
in CKFinder. If empty, the default value (/userfiles/) is used.

Examples:
$baseUrl = 'http://example.com/ckfinder/files/';
$baseUrl = '/userfiles/';

ATTENTION: The trailing slash is required.
*/
$baseUrl = '/js/ckfinder/userfiles/';

/*
$baseDir : the path to the local directory (in the server) which points to 
the
above $baseUrl URL. This is the path used by CKFinder to handle the files in
the server. Full write permissions must be granted to this directory.

Examples:
// You may point it to a directory directly:
$baseDir = '/home/login/public_html/ckfinder/files/';
$baseDir = 'C:/SiteDir/CKFinder/userfiles/';

// Or you may let CKFinder discover the path, based on $baseUrl.
// WARNING: resolveUrl() *will not work* if $baseUrl does not start with a 
slash ("/"),
// for example if $baseDir is set to  http://example.com/ckfinder/files/
$baseDir = resolveUrl($baseUrl);

ATTENTION: The trailing slash is required.
*/
$baseDir = resolveUrl($baseUrl);

At the moment, I have authentication turned off. I don't think it will 
matter as this is in the admin area which has NO public access. Only myself 
and another admin. 
I have tried to use authentication and couldn't get that working either.

I just don't know what these settings should be. I really like cakePHP, but 
getting ckfinder has been REALLY mind-blowing. 
I made this conversion b/c my old FCKeditor didn't work when I ported over 
from 1.2

Any help would be 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


When using the delete action what is a good way to retrieve field data?

2012-04-27 Thread Daniel
When using the delete action what is a good way to retrieve (before
the actual delete) field data (from the same table) ?
e.g. how to get $this->request->data fields?
I had thought of using the query method, but this seems like an ugly
solution:
e.g. $qry = $this->Image->query('SELECT user_id FROM images WHERE
id="'.$id.'"'); etc

Thanks,
Daniel

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


Implementing jQuery File Upload in CakePHP 2.1.x

2012-04-27 Thread Hugo Dias
Hi, i'm trying to implement this plugin 
( http://blueimp.github.com/jQuery-File-Upload/ ) in cakephp 2.1.x the best 
way possible.

Here is the repository 
:  https://github.com/hugodias/JqueryFileUpload-CakePHP

its already done but now we need to review the code and let it clean as 
possible . 

thx :)

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


How to set jqueryObject var in default.ctp and make it works in home.ctp

2012-04-27 Thread Emiliano
Hi everybody,

I'm trying to use cakephp and jquery and I have a problem.
I've define the following in my default.ctp

(...)
$this->Js->JqueryEngine->jQueryObject = '$j';
echo  $this->Html->scriptBlock('var $j =
jQuery.noConflict();',array('inline' => false));
echo $this->Js->JqueryEngine->jQueryObject;//This is for testing!
echo $scripts_for_layout;
(...)

and in my home.ctp I'm including again the testing sentence
(...)
echo $this->Js->JqueryEngine->jQueryObject;//This is for testing!
(...)

When I open the page in the browser It shows
$j
$

For any reason I can set jQueryObject to $j in default.ctp scope but
not in the (default.ctp+home.ctp) scope. The variable setting is not
keeping between my views. Something is bad but I have spent a lot of
time changing args of scriptBlock method in default.ctp as a lot of
posts mentioned but nothing was happened.
I would appreciate your help.

Thanks,
Emiliano.

-- 
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: Hide "previous" "next" when no pagination

2012-04-27 Thread JonStark
The last solution is the easiest,

for those interested, this works really well :

Paginator->hasPage(2)) {
echo (""); 
echo $this->Paginator->prev();
echo (" | ");
} ?> 
Paginator->numbers(); ?> 
Paginator->hasPage(2)) { 
echo (" | ");
echo $this->Paginator->next();
} ?> 


Le jeudi 26 avril 2012 18:17:49 UTC+2, JonStark a écrit :
>
> How can I hide the "<< Previous Next >>" that appears if there is no 
> pages to paginate ?
> I think this is possible because the numbers do not appear when not needed.
>
> Thanks a lot !
>

-- 
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: Hide "previous" "next" when no pagination

2012-04-27 Thread majna
even better:

if ($this->Paginator->hasPage(2))
 // show next prev

On Thursday, April 26, 2012 8:32:27 PM UTC+2, Jeremy Burns wrote:
>
> You can also apply css styles to them, and use the right style to set 
> display: none:
>
> echo $this->Paginator->first('<<', array('class' => 'arrow'), null, 
> array('class' => 'arrow disabled'));
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com 
>
> On 26 Apr 2012, at 19:18:29, jeremyharris wrote:
>
> Try:
>
> if ($this->Paginator->counter(array('format' => '%count%')) == 0) {
>   // no records, don't show links!
> }
>
> -jeremy
>
> On Thursday, April 26, 2012 9:17:49 AM UTC-7, JonStark wrote:
>>
>> How can I hide the "<< Previous Next >>" that appears if there is no 
>> pages to paginate ?
>> I think this is possible because the numbers do not appear when not 
>> needed.
>>
>> Thanks a lot !
>>
>
> -- 
> 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


Re: Model

2012-04-27 Thread LITTO CHACKO
for saving data first you save in patient and after that get the maximum id
from that and use it to save the consulting table
so, when u have to retrieve data  u have to use belongs to relation in the
model of consulting.. and add patient model in that. i hope this will work


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



-- 
Litto Chacko
Axtec Softwares

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


Model

2012-04-27 Thread alexkd
I have two tables 1)Patient2)Consulting. Consulting has foreign key
patient_id. But Patient would not have Consulting_id.
What relation should I use?
I have to ensure saving to Consulting table after each saving of
patient. i.e its essential to saving to Consulting table after the
saving Patient.
How to ensure this?

-- 
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 the first link of a post ?

2012-04-27 Thread Mike Griffin
On Thu, Apr 26, 2012 at 17:53, JonStark  wrote:
> I'm currently trying to get the first link of a post for a specific post
> format, but preg_match needs two parameters and I can't find the second...
> Here is my code :

The second parameter is the thing you want to find a match in, I think
they call it the haystack in the documentation.


> } else if (($post['Post']['format']) == 'link') {
> if (preg_match('/]*?href=[\'"](.+?)[\'"]/is')a) {
> return $firstLink;
> } else {
> return $articleLink;
> }
>
> (...)
>
> How can I make this work in my view ? Thanks a lot.

What are you matching against? Is it something in the $post variable?

Mike.

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