Re: Cakephp 2.x Receive emails into the application...

2016-03-13 Thread euromark
This might help you
https://github.com/barbushin/php-imap


Am Samstag, 12. März 2016 01:31:18 UTC+1 schrieb April DeRossett:
>
> Ahoy!  I am looking for a way to receive reply emails into my cakephp 
> application and after a ton of research I haven't yet figured out how to 
> make that happen.  Pretend I am an awesome PHP and MySQL programmer but, 
> that I know Nothing about managing an email server.  Does anyone know of a 
> great tutorial or read that would help me get started?  Thanks in advance. 
> April
>

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Cakephp 2.x Receive emails into the application...

2016-03-11 Thread April DeRossett
Ahoy!  I am looking for a way to receive reply emails into my cakephp 
application and after a ton of research I haven't yet figured out how to 
make that happen.  Pretend I am an awesome PHP and MySQL programmer but, 
that I know Nothing about managing an email server.  Does anyone know of a 
great tutorial or read that would help me get started?  Thanks in advance. 
April

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


CakePhp 2.x Generate tree for Tree Behavior?

2016-01-10 Thread Sam Clauw
A very simple question: is there a way to get an associative array with 
tree nodes build with CakePHP's Tree Behavior? 
I can only find a method that output an array to use in a dropdown field 
...

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Help with Cakephp 2.x pagination

2015-12-29 Thread Clement Crownrise
Thanks @John

On Tue, Dec 29, 2015 at 8:53 AM, John Andersen 
wrote:

> As Matthew wrote, use the Neighbor function. See the CakePHP book in this
> page:
>
> http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#find-neighbors
>
> Enjoy, John
>
>
> On Tuesday, 29 December 2015 00:54:37 UTC+2, Clement Crownrise wrote:
>>
>> Thanks for your response, but please what is the neighbour function?
>>
>> Can you please paste the sytax here.
>>
>> Thanks
>>
>>
>> On Monday, December 28, 2015 at 11:35:36 PM UTC+1, Matthew Kaufman wrote:
>>>
>>> Use the get neighbors function.
>>>
>>> On Mon, Dec 28, 2015 at 5:32 PM, Clement Crownrise <
>>> clementc...@gmail.com> wrote:
>>>
 Hello everyone, below is the first page of my list page, The first
 attachment..

 On clicking on any of the data on the first page, it will open up and
 show like the second attachment.

 Now the problem is, I want to add a "Next " and "Previous" button to
 the second attachment, so that I will not need to go to the first
 page(first attachment ) in order to access the next or previous record.

 HOW CAN I ACHIEVE THIS?

 --
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP

 ---
 You received this message because you are subscribed to the Google
 Groups "CakePHP" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to cake-php+u...@googlegroups.com.
 To post to this group, send email to cake...@googlegroups.com.
 Visit this group at https://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cake-php/HYSgunvislo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at https://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
http://www.clementcrownrise.name/images/nameing.gif

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Help with Cakephp 2.x pagination

2015-12-28 Thread John Andersen
As Matthew wrote, use the Neighbor function. See the CakePHP book in this 
page:
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#find-neighbors

Enjoy, John

On Tuesday, 29 December 2015 00:54:37 UTC+2, Clement Crownrise wrote:
>
> Thanks for your response, but please what is the neighbour function?
>
> Can you please paste the sytax here.
>
> Thanks
>
>
> On Monday, December 28, 2015 at 11:35:36 PM UTC+1, Matthew Kaufman wrote:
>>
>> Use the get neighbors function.
>>
>> On Mon, Dec 28, 2015 at 5:32 PM, Clement Crownrise > > wrote:
>>
>>> Hello everyone, below is the first page of my list page, The first 
>>> attachment..
>>>
>>> On clicking on any of the data on the first page, it will open up and 
>>> show like the second attachment. 
>>>
>>> Now the problem is, I want to add a "Next " and "Previous" button to the 
>>> second attachment, so that I will not need to go to the first page(first 
>>> attachment ) in order to access the next or previous record.
>>>
>>> HOW CAN I ACHIEVE THIS? 
>>>
>>> -- 
>>> Like Us on FaceBook https://www.facebook.com/CakePHP
>>> Find us on Twitter http://twitter.com/CakePHP
>>>
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "CakePHP" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to cake-php+u...@googlegroups.com.
>>> To post to this group, send email to cake...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/cake-php.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Help with Cakephp 2.x pagination

2015-12-28 Thread Clement Crownrise
Thanks for your response, but please what is the neighbour function?

Can you please paste the sytax here.

Thanks


On Monday, December 28, 2015 at 11:35:36 PM UTC+1, Matthew Kaufman wrote:
>
> Use the get neighbors function.
>
> On Mon, Dec 28, 2015 at 5:32 PM, Clement Crownrise  > wrote:
>
>> Hello everyone, below is the first page of my list page, The first 
>> attachment..
>>
>> On clicking on any of the data on the first page, it will open up and 
>> show like the second attachment. 
>>
>> Now the problem is, I want to add a "Next " and "Previous" button to the 
>> second attachment, so that I will not need to go to the first page(first 
>> attachment ) in order to access the next or previous record.
>>
>> HOW CAN I ACHIEVE THIS? 
>>
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Help with Cakephp 2.x pagination

2015-12-28 Thread Matthew Kaufman
Use the get neighbors function.

On Mon, Dec 28, 2015 at 5:32 PM, Clement Crownrise <
clementcrownr...@gmail.com> wrote:

> Hello everyone, below is the first page of my list page, The first
> attachment..
>
> On clicking on any of the data on the first page, it will open up and show
> like the second attachment.
>
> Now the problem is, I want to add a "Next " and "Previous" button to the
> second attachment, so that I will not need to go to the first page(first
> attachment ) in order to access the next or previous record.
>
> HOW CAN I ACHIEVE THIS?
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at https://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


CakePHP 2.x translation fallback

2015-12-04 Thread Zbigniew Ledwoń
I need to have fallback in translation.

If I have 2 translations ex.: 'eng' and 'es'
Some records have both translations and some only one or none.
I hoped that if I do it this way:

$this->Post->locale = ['es', 'eng'];$results = $this->Post->find('first', array(
'conditions' => array('Post.id' => $id)));

I'll get 'es' translation and if 'es' is not available I'll get 'eng'.
but this does not seem to work. If I set 'locale' to a single value 'eng' 
or 'es' it works fine, but when I set $this->locale = ['es', 'eng'];
It seems to be ignored and no translation is taken into the result, just 
data from model table.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


CakePHP 2.x Persistent virtual fields problem

2015-11-29 Thread Sam Clauw
I have a brainteaser about virtual fields on associated models. I know it 
has it's limitations as you can read here: 
http://book.cakephp.org/2.0/en/models/virtual-fields.html#limitations-of-virtualfields
. 
But in my specific case, I can't apply the theory of passing the 
virtualField property from one model to another (even when I read this 
topic: 
http://stackoverflow.com/questions/14630819/using-virtual-fields-in-cakephp-2-x
).

I'll try to explane my case as clear as possible.

Database info

I have 3 tables to make a navigation on my website:

*menus*
id
name

*pages*
id
title
content

*menu_page_links*
id
menu_id
page_id
title
lft
rgt
plugin
controller
action

One page can be added to multiple menus, that's why I've made a link table 
(menu_page_links) between menus and pages.

Application info

Menu model

class Menu extends AppModel
{
public $hasMany = array(
'MenuPageLink' => array(
'className' => 'MenuPageLink',
'foreignKey' => 'menu_id'
)
);
}

Page model

class Page extends AppModel
{
public $hasMany = array(
'MenuPageLink' => array(
'className' => 'MenuPageLink',
'foreignKey' => 'page_id'
)
);
}

MenuPageLink model

class MenuPageLink extends AppModel
{
public $belongsTo = array(
'Menu',
'Page'
);

// to calculate the depth of every menu page link

public $virtualFields = array(
'depth' => 'COUNT(MenuPageLink.title) - 1'
);
}

AppController

Now in my application, I want to load a specific menu on every page, e.g. 
the "Primary menu" from the "menus" table.
So in AppController.php, I referred to the tree needed models ("Menu", 
"Page" and "MenuPageLink") as following:

public $uses = array(
'Menu',
'Page',
'MenuPageLink'
);

Then I get my menu pages that belongs to my specific menu with id "2":

$menu = $this->MenuPageLink->find('all', array(
'fields' => array(
'MenuPageLink.id',
'MenuPageLink.title',
'MenuPageLink.plugin',
'MenuPageLink.controller',
'MenuPageLink.action',
'MenuPageLink.depth'
),
'joins' => array(
array(
'table' => $this->MenuPageLink->table,
'alias' => 'Parent',
'type' => 'LEFT',
'conditions' => array(
'MenuPageLink.lft BETWEEN Parent.lft AND Parent.rgt',
'MenuPageLink.menu_id' => 1
)
)
),
'conditions' => array(
'MenuPageLink.menu_id' => 2,
'MenuPageLink.lft >' => 1,
'MenuPageLink.deleted' => null
),
'group' => 'MenuPageLink.id',
'order' => array(
'MenuPageLink.lft ASC'
)
));

This is my result when I debug my $menu variable:

array(
(int) 0 => array( 'MenuPageLink' => array( 'id' => '36', 'title' => 'Home', 
'plugin' => '', 'controller' => 'home', 'action' => 'index', 'depth' => '1' ) ),
(int) 1 => array( 'MenuPageLink' => array( 'id' => '39', 'title' => 'News', 
'plugin' => '', 'controller' => 'news_articles', 'action' => 'index', 'depth' 
=> '1' ) ),
(int) 2 => array( 'MenuPageLink' => array( 'id' => '37', 'title' => 'About the 
park', 'plugin' => '', 'controller' => 'pages', 'action' => 'view', 'depth' => 
'1' ) ),
(int) 3 => array( 'MenuPageLink' => array( 'id' => '41', 'title' => 
'Attractions', 'plugin' => '', 'controller' => 'attractions', 'action' => 
'index', 'depth' => '2' ) ),
(int) 4 => array( 'MenuPageLink' => array( 'id' => '42', 'title' => 'Animals', 
'plugin' => '', 'controller' => 'animals', 'action' => 'index', 'depth' => '2' 
) ),
(int) 5 => array( &

Re: New CakePHP ORM to CakePHP 2.x

2015-10-26 Thread Florian Krämer
I don't get your problem guys. :) Add the new ORM via composer.

Just create the folders inside your 2.x app:

   - app/Model/Table
   - app/Model/Entity
   
Make sure your autoloader is finding the classes based on their namespace 
and put your tables and entities in there just as you would do it in Cake3. 
Then use the TableRegistry instead of the ClassRegistry to get your table 
objects. Just the fact that Cake2 is not using newer php language features 
doesn't mean you can't use them. You can create and use traits within your 
app as well to make getting tables more easy for example.

BUT: If you're after a magic "convert all and everything" to the new ORM, 
this is not going to happen, you'll have to do it by hand.

The way we do it is to slowly migrate what we need, when we need it. So 
we'll slowly replace the old with the new ORM, they can co-exist. This way 
we get the fancy new ORM but can slowly migrate our app as we go.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: New CakePHP ORM to CakePHP 2.x

2015-10-22 Thread Elisio Leonardo
Also interested in this question.

Partial Migration would be great.

I'm looking for a way to migrate some models to new ORM and gradually 
migrate the others..



On Tuesday, September 22, 2015 at 9:23:50 AM UTC+2, Sulian Lanteri wrote:
>
> Hello
>
> Before migrate a big application in CakePHP3, I want first use the new ORM 
> in this CakePHP 2.6 application, any idea how to do that (and/or a good 
> example) ?
>
> Sulian
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: New CakePHP ORM to CakePHP 2.x

2015-09-25 Thread gersonfs
Hello Sulian and José,

I have this problem too. Only much bigger. Because of that I have not yet 
adopted the CakePHP 3.

Migrating an application with 300 tables and business rules from CakePHP 2 
to 3, it takes a long time, this transition should be possible to be made 
into parts.

I can not stop production completely to migrate becouse during this period 
of time the customer comes with new needs. A git merge does not apply in 
this case because the ORM is very different.

Any suggestion?

Em terça-feira, 22 de setembro de 2015 04:23:50 UTC-3, Sulian Lanteri 
escreveu:
>
> Hello
>
> Before migrate a big application in CakePHP3, I want first use the new ORM 
> in this CakePHP 2.6 application, any idea how to do that (and/or a good 
> example) ?
>
> Sulian
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: New CakePHP ORM to CakePHP 2.x

2015-09-24 Thread Sulian Lanteri
Hello José

I want to replace the 2.x orm system by the new ORM before upgrading to 
CakePHP3. My app have several modules, at last about 100 tables. I prefer 
migrate the ORM in CakePHP2 rather than migrating everything at once.

Le mardi 22 septembre 2015 10:57:01 UTC+2, José Lorenzo a écrit :
>
> It depends. The ORM can be installed as a standalone library already, what 
> kind of integration are you looking after?
>
> On Tuesday, September 22, 2015 at 9:23:50 AM UTC+2, Sulian Lanteri wrote:
>>
>> Hello
>>
>> Before migrate a big application in CakePHP3, I want first use the new 
>> ORM in this CakePHP 2.6 application, any idea how to do that (and/or a good 
>> example) ?
>>
>> Sulian
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: New CakePHP ORM to CakePHP 2.x

2015-09-22 Thread José Lorenzo
It depends. The ORM can be installed as a standalone library already, what 
kind of integration are you looking after?

On Tuesday, September 22, 2015 at 9:23:50 AM UTC+2, Sulian Lanteri wrote:
>
> Hello
>
> Before migrate a big application in CakePHP3, I want first use the new ORM 
> in this CakePHP 2.6 application, any idea how to do that (and/or a good 
> example) ?
>
> Sulian
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


New CakePHP ORM to CakePHP 2.x

2015-09-22 Thread Sulian Lanteri
Hello

Before migrate a big application in CakePHP3, I want first use the new ORM 
in this CakePHP 2.6 application, any idea how to do that (and/or a good 
example) ?

Sulian

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cakephp tree behavior + ext js (drag and drop) (can you provide some new version to work with cakephp 2.x)

2014-12-02 Thread imran guher
hi, This one is really nice , I tried to use but could not , mau be becouse 
of cakephp version 2.5, so can you provide some new version to use with 
cakephp 2.x

On Friday, February 15, 2008 5:04:55 AM UTC+5, Adam Royle wrote:
>
> Sounds like you've got problems with your install. I have just tested 
> my app with both 1.2 trunk and 1.2 branch from svn, and can't 
> replicate the problems you've mentioned. 
>
> Since I developed this using 1.2 branch, I had assumed everything 
> would work in 1.2 trunk, however there was a bug with the javascript 
> helper in trunk that has now been fixed in branch (https:// 
> trac.cakephp.org/ticket/3799). I did actually get it working fine in 
> 1.2 trunk after I removed the /js/ prefix from the link in the layout. 
>
> I suggest you try a fresh svn export, and use the source files I've 
> provided in the download. 
>
> With the whitespace issue - maybe it's got something to do with UTF-8 
> BOM being at the top of your files? But I am only speculating on this, 
> the files I've provided shouldn't have this issue. 
>
> Cheers, 
> Adam 
>
> On Feb 15, 6:42 am, Mech7  wrote: 
> > hmmm there is no white space in the controller.. with the exit 
> > function it should not use a view right? So i guess that is not it.. 
> > 
> > Umm also the requesthandler is loaded.. but it does not work with me, 
> > i really need to set the layout.. but maybe its because of my cakephp 
> > install cause the secutiry component does not work either : Undefined 
> > property:  EmployeesController::$Security 
> > 
> > So i need to comment that out to get it to work... im using latest 
> > version from svn. So maybe there are some bugs in that. Because there 
> > are some other things too.. like load a helper that does not exists in 
> > app_controller and it will crash apache, when i go to a controller 
> > that does not exists :)

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


what is the current method to use Jgraph with cakephp 2.x

2014-06-28 Thread ajt
Hi,

How is Jpgraph supposed to integrate with cakephp? In the controller or the 
view do i place the code to construct the jpgraph  ?
The old way is to display a jgraph with an image which is a call to another 
view but that way doesnt appear to work with currect cakephp.


The problem is that jpgraph examples for cakephp is for older versions and 
there is no update for jpgraph with newer cakephp versions that I can find. 
The only solution I have found is from the stackoverflow post.

The jpgraph does work if I place the graph code in the controller like the 
hack solution but that isnt how it is supposed to work according to the 
docs. I didnt get the  requestHandler as explained in the stackoverflow 
post to have any effect  but anyway I cant find anything in the cakephp 
docs.


http://bakery.cakephp.org/articles/cguyer/2007/12/26/using-jpgraph
http://stackoverflow.com/questions/9936890/cakephp-2-0-jpgraph

?php
App::import('Vendor', 'Jpgraphs/jpgraph');
App::import('Vendor', 'Jpgraphs/jpgraph_line');

$ydata = array(11,11,11);

// Create the graph.
$graph = new Graph(350,250);
$graph->SetScale("textlin");
$graph->img->SetMargin(30,90,40,50);
$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);
$graph->title->Set("Example 1.1 same y-values");

// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->SetLegend("Test 1");
$lineplot->SetColor("blue");
$lineplot->SetWeight(5);

// Add the plot to the graph
$graph->Add($lineplot);

// Display the graph
$graph->Stroke();



?>

// ]]>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Composer, PHPUnit and CakePHP 2.x

2014-05-07 Thread Reuben
Looks like I was DOING IT WRONG.

I was calling Console/cake.php directly, instead of using Console/cake.bat 
(or cake.sh).  cake.bat sets up app and lib shell variables which enables 
Composer to be bootstrapped properly.

End result, when using Composer and the Console scripts properly, there's 
no need to include PHPUnit on the include path explicitly.

On Thursday, 8 May 2014 11:56:35 UTC+10, Reuben wrote:
>
> When using Composer with CakePHP 2.x, does PHP Unit still have to be on 
> the include path, or is there a smarter way, like in CakePHP 3.x, where run 
> phpunit directly?
>
> Regards
> Reuben Helms
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Composer, PHPUnit and CakePHP 2.x

2014-05-07 Thread Reuben
When using Composer with CakePHP 2.x, does PHP Unit still have to be on the 
include path, or is there a smarter way, like in CakePHP 3.x, where run 
phpunit directly?

Regards
Reuben Helms

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Thumbs Plugin for CakePHP 2.x

2014-05-06 Thread André Luis
Thanks for your remarks, sure we will look for each observation.

Em segunda-feira, 5 de maio de 2014 20h43min22s UTC-3, euromark escreveu:
>
> A few remarks from my end:
>
> You should probably composer-ize your plugin to make it easier to include 
> in projects that do not want to go down the old fashioned submodule way.
>
> Those classes you put in Vendor shouldn't be in there. vendor is only for 
> third party code, this code of yours should be in /Lib folder instead - and 
> included
> using App::uses which allows lazy loading - your approach doesn't
> Actually, your whole plugin shouldn't have to use import() once - `App::
> import('Lib'..` etc should also be App::uses calls.
>
> Test your code - this is one of the most crucial things missing here - and 
> does not make people confident in your plugin.
> It also allows regression and errors to sneak in.
>
> Respecting the cake coding standards would be helpful, especially when you 
> are not doing this solely for yourself, but also for the community - or if 
> you
> want others to join in and help you.
> This includes the "semantic" cs as well as widely accepted patterns such 
> as "no private, but protected" for example.
> The latter allows easier extendability.
> Furthermore:
> - Use tabs as indentation as well as 
> http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html
> - Dont forget App::uses() calls in classes like Controller etc - this 
> would blow up once you added tests
>
> Respecting all above points should probably make it easier to accept and 
> work with your plugin as well as contribute back.
> Mark
>
>
> Am Montag, 5. Mai 2014 19:25:41 UTC+2 schrieb André Luis:
>>
>> Hi everyone, me and my friend created a Thumbnails plugin for CakePHP 2.x
>>
>> This plugin allows you to create thumbnails from any public image just 
>> using URL´s, so you can use the thumbnail on your backgrounds too.
>>
>> For example, if you have *http://example.com/img/logotype.png 
>> <http://example.com/img/logotype.png>* and you wish to create a cropped 
>> image 100x100 px you can access 
>> *http://example.com/thumbs/crop/small/img/logotype.png 
>> <http://example.com/thumbs/crop/small/img/logotype.png>* and will have a 
>> 100x100 cropped image from original. Or if you want this same logotype on a 
>> red box 300x300 pixels you can *access 
>> https://example.com/thumbs/fill/medium/red/img/logotype.png 
>> <https://example.com/thumbs/fill/medium/red/img/logotype.png>. *
>>
>> All you need to do is create a configuration file wich will be determine 
>> the sizes and fill colors.
>>
>> More on https://github.com/lsantosc/Thumbs
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Thumbs Plugin for CakePHP 2.x

2014-05-05 Thread euromark
A few remarks from my end:

You should probably composer-ize your plugin to make it easier to include 
in projects that do not want to go down the old fashioned submodule way.

Those classes you put in Vendor shouldn't be in there. vendor is only for 
third party code, this code of yours should be in /Lib folder instead - and 
included
using App::uses which allows lazy loading - your approach doesn't
Actually, your whole plugin shouldn't have to use import() once - `App::
import('Lib'..` etc should also be App::uses calls.

Test your code - this is one of the most crucial things missing here - and 
does not make people confident in your plugin.
It also allows regression and errors to sneak in.

Respecting the cake coding standards would be helpful, especially when you 
are not doing this solely for yourself, but also for the community - or if 
you
want others to join in and help you.
This includes the "semantic" cs as well as widely accepted patterns such as 
"no private, but protected" for example.
The latter allows easier extendability.
Furthermore:
- Use tabs as indentation as well 
as http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html
- Dont forget App::uses() calls in classes like Controller etc - this would 
blow up once you added tests

Respecting all above points should probably make it easier to accept and 
work with your plugin as well as contribute back.
Mark


Am Montag, 5. Mai 2014 19:25:41 UTC+2 schrieb André Luis:
>
> Hi everyone, me and my friend created a Thumbnails plugin for CakePHP 2.x
>
> This plugin allows you to create thumbnails from any public image just 
> using URL´s, so you can use the thumbnail on your backgrounds too.
>
> For example, if you have *http://example.com/img/logotype.png 
> <http://example.com/img/logotype.png>* and you wish to create a cropped 
> image 100x100 px you can access 
> *http://example.com/thumbs/crop/small/img/logotype.png 
> <http://example.com/thumbs/crop/small/img/logotype.png>* and will have a 
> 100x100 cropped image from original. Or if you want this same logotype on a 
> red box 300x300 pixels you can *access 
> https://example.com/thumbs/fill/medium/red/img/logotype.png 
> <https://example.com/thumbs/fill/medium/red/img/logotype.png>. *
>
> All you need to do is create a configuration file wich will be determine 
> the sizes and fill colors.
>
> More on https://github.com/lsantosc/Thumbs
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Thumbs Plugin for CakePHP 2.x

2014-05-05 Thread Stephen S
Looks interesting, thanks for sharing this. I may try to test it out on a
personal project, good luck.


On 5 May 2014 18:25, André Luis  wrote:

> Hi everyone, me and my friend created a Thumbnails plugin for CakePHP 2.x
>
> This plugin allows you to create thumbnails from any public image just
> using URL´s, so you can use the thumbnail on your backgrounds too.
>
> For example, if you have *http://example.com/img/logotype.png
> <http://example.com/img/logotype.png>* and you wish to create a cropped
> image 100x100 px you can access 
> *http://example.com/thumbs/crop/small/img/logotype.png
> <http://example.com/thumbs/crop/small/img/logotype.png>* and will have a
> 100x100 cropped image from original. Or if you want this same logotype on a
> red box 300x300 pixels you can *access
> https://example.com/thumbs/fill/medium/red/img/logotype.png
> <https://example.com/thumbs/fill/medium/red/img/logotype.png>. *
>
> All you need to do is create a configuration file wich will be determine
> the sizes and fill colors.
>
> More on https://github.com/lsantosc/Thumbs
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Kind Regards
 Stephen Speakman

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Thumbs Plugin for CakePHP 2.x

2014-05-05 Thread André Luis
Hi everyone, me and my friend created a Thumbnails plugin for CakePHP 2.x

This plugin allows you to create thumbnails from any public image just 
using URL´s, so you can use the thumbnail on your backgrounds too.

For example, if you have *http://example.com/img/logotype.png* and you wish 
to create a cropped image 100x100 px you can access 
*http://example.com/thumbs/crop/small/img/logotype.png* and will have a 
100x100 cropped image from original. Or if you want this same logotype on a 
red box 300x300 pixels you can *access 
https://example.com/thumbs/fill/medium/red/img/logotype.png. *

All you need to do is create a configuration file wich will be determine 
the sizes and fill colors.

More on https://github.com/lsantosc/Thumbs

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to integrate Apache Lucene search engine with cakephp 2.x

2014-04-22 Thread José Lorenzo
I would strongly suggest using ElasticSearch. It is the easiest way of 
integrating lucene in any project.

On Tuesday, April 22, 2014 6:11:19 AM UTC+2, Pawan Kumar wrote:
>
>  I want to integrate *Apache Lucene Search engine* with *cakephp*, here 
> is the link for Apache Lucene serach engine http://lucene.apache.org/core/
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


How to integrate Apache Lucene search engine with cakephp 2.x

2014-04-22 Thread Pawan Kumar
 I want to integrate *Apache Lucene Search engine* with *cakephp*, here is 
the link for Apache Lucene serach engine http://lucene.apache.org/core/

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Serving assets from nginx static server in cakephp 2.x

2014-02-17 Thread learning
Hi!

Thank you very much, finally i solved the problem.

In the NAS i created a static folder with the symlinks i needed like:

ls -l /mynas/static/

css -> /app/webroot/css/
myplugin -> /app/Plugin/MyPlugin/img/

and in nginx i changed my config DocumentRoot to /mynas/static

Cheers!

El viernes, 14 de febrero de 2014 21:36:51 UTC+1, AD7six escribió:
>
> Why not simply symlink you plugin webroot as indicated in the docs?
>
> AD
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Serving assets from nginx static server in cakephp 2.x

2014-02-14 Thread AD7six
Why not simply symlink you plugin webroot as indicated in the docs?

AD

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Serving assets from nginx static server in cakephp 2.x

2014-02-13 Thread learning
Hi, 

I'm trying to serve my cakephp assets from a nginx static server.

The problem is that cakephp make assets urls lowercase and the url to nginx 
static server is not correct because nginx is serving the real path to the 
file like /Plugin/PluginFolderName/.../myasset.js

I tried it in vhost nginx configuration:

# Serve CakePHP plugin assets directly
location ~ /(.+)/(img|css|js|files)/(.*) {
  access_log off;
  expires 10d;
  add_header Cache-Control public;
  try_files $uri $uri/ /../Plugin/$1/webroot/$2/$3 
/../../Plugin/$1/webroot/$2/$3 /index.php?url=$uri;
}

Changing in cakephp to uppercase the first letter on asset url works but 
only with the Plugins that are not CamelCased.

How could i solve this?

Thank you very much

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Cakephp 2.x ajax edit not working in Firefox and Opera

2013-12-19 Thread cake_beginner
im also having this kind of problem.
does anyone know what's wrong with this one?



On Friday, September 14, 2012 6:23:05 AM UTC+8, incognito wrote:
>
> Hi, 
>
> I am basically trying to create an ajax edit form. 
> This is the edit link code 
>
> Js->link('Edit', 
>   array('controller' => 'employees', 'action' => 
> 'personal_details_edit',$employee['Employee']['id']), 
>   array( 
>  'update' => '#personal_details_update', 
>  'evalScripts' => true, 
> 'before' => $this->Js->get('#busy-indicator')->effect('fadeIn', 
> array('buffer' => false)), 
>  'complete' => $this->Js->get('#busy-indicator')->effect('fadeOut', 
> array('buffer' => false)), 
>   ) 
>); 
>  echo $this->Js->writeBuffer();   
> ?> 
>
> And this is the ajax form code which gets loaded after clicking the above 
> edit link. 
>
>  //serialize the form element to submit 
>   
> $data = $this->Js->get('#employee_personal_edit')->serializeForm( 
> array( 
> 'isForm' => true, 
> 'inline' => true) 
> ); 
>   
> // Submit the serialize data on submit click 
> $this->Js->get('#employee_personal_edit')->event( 
>   'submit', 
>   $this->Js->request( 
> array('action' => 'personal_details_edit'), 
> array( 
> 'update' => '#personal_details_update', // element to 
> update 
>  // after form submission 
> 'data' => $data, 
> 'async' => true, 
> 'dataExpression'=>true, 
> 'method' => 'POST', 
> 
>   
> ) 
> ) 
> ); 
>  echo $this->Js->writeBuffer(); 
> ?> 
>
>
> The form submit is working in Chrome, IE, Safari but not working in 
> Firefox and Opera.When I click form submit in Firefox nothing happens(no 
> XMLHTTPRequest is being sent). 
>
> If i access the form link directly(without loading via ajax edit link)its 
> working normally in Firefox. 
>
> How to fix it?Any help is appreciated. :)  
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CakePHP 2.x running on Lighttpd

2013-11-29 Thread Κωνσταντίνος Θεοφίλης
Did you found any solution for that?

Τη Δευτέρα, 11 Νοεμβρίου 2013 2:35:16 μ.μ. UTC+2, ο χρήστης Riccardo 
Trombini έγραψε:
>
> Hi
>
> Did someone successfully manage to run CakePHP 2.x on a lighttp server? I 
> am having troubles accessing javascript and css-files. I run into an error 
> 404. 
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


CakePHP 2.x running on Lighttpd

2013-11-12 Thread Riccardo Trombini
Hi

Did someone successfully manage to run CakePHP 2.x on a lighttp server? I 
am having troubles accessing javascript and css-files. I run into an error 
404. 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Sybase Database Driver for CakePHP 2.x - Is there any? Tips to develop one?

2013-10-01 Thread tkunitz
I would like to develop a *CakePHP 2.4* app using a *Sybase database*.

There is not any Sybase database driver for CakePHP 2.x as I learned from 
the cookbook 2.0 <http://book.cakephp.org/2.0/en/models/datasources.html>  
and 2.4 api documentation 
Cake\Model\Datasource\Database<http://api.cakephp.org/2.4/package-Cake.Model.Datasource.Database.html>so
 far.
Also Github cakephp/datasources branch 
2.0<https://github.com/cakephp/datasources/tree/2.0>or 2.3 lists 
Database/Sybase 
as a Still Incompatible Datasource.
Is there any update on this?

In CakePHP 1.2 a Sybase Database Driver exists as described in api for 
class DboSybase <http://api.cakephp.org/1.2/class-DboSybase.html>

Is it a big thing to update the driver from the 1.2-driver as a template?
Is it better/easier to use MySQL DBO 
driver<http://api.cakephp.org/2.4/class-Mysql.html> or 
any other db driver as a code template?

I learned that for database access a pdo extended datasources is the way 
which requires the PDO extensions.

Can provide anyone tips/support/teamwork how to develop and test such a 
driver?

Thanks


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: CakePHP 2.x Date Field Helper set year?

2013-08-07 Thread euromark
the rule stays the same, you just apply a different start value to check 
against.

< TODAY
is the same as
< $startValue
for your custom validation method anyway


Am Mittwoch, 7. August 2013 20:06:50 UTC+2 schrieb Eric Haskins:
>
> Hey everyone quick question. 
>
>  I have an app and Im having issues with "Users" setting birthdates to 
> 2013-12-13 as an example.  I know I should have a validator to make sure it 
> isnt a future date but is there a way to seed the start year say 4 years 
> ago?  
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




CakePHP 2.x Date Field Helper set year?

2013-08-07 Thread Eric Haskins
Hey everyone quick question. 

 I have an app and Im having issues with "Users" setting birthdates to 
2013-12-13 as an example.  I know I should have a validator to make sure it 
isnt a future date but is there a way to seed the start year say 4 years 
ago?  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




RE: CakePHP 2.x Moving Find into Model

2013-05-23 Thread Advantage+
Yeah just to keep it simple but allow to pass vars if needed. 

Just an example what I sent but you can pop wars in everything condition you
want based on the controller action.

 

I have some if logged in page based on viewed / like / hate.. Its limitless.
So define the core structure and just simply swap out as needed

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Jeremy Burns : Class Outfit
Sent: Friday, May 24, 2013 2:01 AM
To: cake-php@googlegroups.com
Subject: Re: CakePHP 2.x Moving Find into Model

 

Got it - thanks. So you're really just setting up the paginate variable in
the model rather than the controller then calling it from the controller to
set up pagination before doing a paginate find?

 

On 24 May 2013, at 05:25, "Advantage+"  wrote:





Not sure if this is any help. But I hate all the $params in the controller
especially if you have to do it on the fly so I set all the params in the
model like such: (Just swap out 'model' for your own )

Model:

public function _Pagination($limit = 15){

   

$params = array(

'conditions' => array(

 
'fields' => array(

 
'Model.id',

 
'Model.featured',

 
'Model.title',

 
'Model.description),

 
'limit' => $limit,

 
'order' => array(

 
'Model.created DESC'),

 
'contain' => array(

 
'State' => array(

 
'fields' => array(

 
'State.abrev')),

'Country' =>
array(

 
'fields' => array(

 
'Country.name',

 
'Country.iso')));

   

return $params;

}

 

Controller:

$this->paginate = $this->Model->_Pagination ($anything you want to pass
$limit, $conditions...);

And just pop it into the find into the $params like

 

$this->paginate = $this->Model->_Pagination($limit = 10); or anything you
might want to edit on the fly.

 

Swap out all the vars you want and make it work for you.

Then do standard:

 

$this->set('whatever', $this->paginate('Model'));

 

All it is basically is the same as you normally would do in the controller
but rather than having all that crap I find it easier to say paginateThis(),
pagginateThat() rather than all that in the controller and just pull the
params from the model.

 

Dave

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Jeremy Burns : Class Outfit
Sent: Friday, May 24, 2013 1:00 AM
To: cake-php@googlegroups.com
Subject: Re: CakePHP 2.x Moving Find into Model

 

Have you got an example of that?

 

On 24 May 2013, at 01:09, lowpass < <mailto:zijn.digi...@gmail.com>
zijn.digi...@gmail.com> wrote:






Apply the array to the $paginate class var, not the method. Basically, you
can declare the $paginate array as a class var, then add to or override any
part of it from within an action.

 

On Thu, May 23, 2013 at 7:12 PM, Larry Lutz < <mailto:lut...@swbell.net>
lut...@swbell.net> wrote:

I'm trying to achieve the fat model/skinny controller mantra in CakePHP 2.7.
In that scenario, the model should control the data, and that means moving
the finds out of the controllers and into the models. However, at least with
the view and admin_view actions, one needs the data paginated.

The problem starts there. It's easy enough to do a $this->find('all') in the
model to get the data, along with any conditions, contains, etc. However
that produces an array. Paginator->paginate(), as far as I can tell won't
work in the model; it's a component that only works in a controller. Yet, if
I take the array produced in the model into the controller and try to pass
it on toPaginator->paginate(), it fails because paginate won't accept an
array.

In terms of trying to achieve the fat model/skinny controller goal, what am
I missing here. How can I achieve a paginated result while still having the
model (properly) do the work of managing and finding the data?

 

-- 
Like Us on FaceBook  <https://www.facebook.com/CakePHP>
https://www.facebook.com/CakePHP
Find us on Twitter  <http://twitter.com/CakePHP> http://twitter.com/CakePHP
 
--- 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to  <mailto:cake-php%2bunsubscr...@googlegroups.com>
cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to  <mailto:cake-php@googlegroups.com>
cake-php@googlegroups.com.
Visit this group at  <http://groups.google.com/group/cake-php?hl=en>

Re: CakePHP 2.x Moving Find into Model

2013-05-23 Thread Jeremy Burns : Class Outfit
Got it - thanks. So you're really just setting up the paginate variable in the 
model rather than the controller then calling it from the controller to set up 
pagination before doing a paginate find?

On 24 May 2013, at 05:25, "Advantage+"  wrote:

> Not sure if this is any help. But I hate all the $params in the controller 
> especially if you have to do it on the fly so I set all the params in the 
> model like such: (Just swap out 'model' for your own )
> Model:
> public function _Pagination($limit = 15){
>
> $params = array(
> 'conditions' => array(
>   
>   'fields' => array(
>   
>   'Model.id',
>   
>   'Model.featured',
>   
>   'Model.title',
>   
>   'Model.description),
>   
>   'limit' => $limit,
>   
>   'order' => array(
>   
>   'Model.created DESC'),
>   
>   'contain' => array(
>   
>   'State' => array(
>   
>   'fields' => array(
>   
>   'State.abrev')),
> 'Country' => 
> array(
>   
>   'fields' => array(
>   
>   'Country.name',
>   
>   'Country.iso')));
>
> return $params;
> }
>  
> Controller:
> $this->paginate = $this->Model->_Pagination ($anything you want to pass 
> $limit, $conditions…….);
> And just pop it into the find into the $params like
>  
> $this->paginate = $this->Model->_Pagination($limit = 10); or anything you 
> might want to edit on the fly.
>  
> Swap out all the vars you want and make it work for you.
> Then do standard:
>  
> $this->set('whatever', $this->paginate('Model'));
>  
> All it is basically is the same as you normally would do in the controller 
> but rather than having all that crap I find it easier to say paginateThis(), 
> pagginateThat() rather than all that in the controller and just pull the 
> params from the model.
>  
> Dave
>  
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf 
> Of Jeremy Burns : Class Outfit
> Sent: Friday, May 24, 2013 1:00 AM
> To: cake-php@googlegroups.com
> Subject: Re: CakePHP 2.x Moving Find into Model
>  
> Have you got an example of that?
>  
> On 24 May 2013, at 01:09, lowpass  wrote:
> 
> 
> Apply the array to the $paginate class var, not the method. Basically, you 
> can declare the $paginate array as a class var, then add to or override any 
> part of it from within an action.
>  
> 
> On Thu, May 23, 2013 at 7:12 PM, Larry Lutz  wrote:
> I'm trying to achieve the fat model/skinny controller mantra in CakePHP 2.7. 
> In that scenario, the model should control the data, and that means moving 
> the finds out of the controllers and into the models. However, at least with 
> the view and admin_view actions, one needs the data paginated.
> 
> The problem starts there. It's easy enough to do a $this->find('all') in the 
> model to get the data, along with any conditions, contains, etc. However that 
> produces an array. Paginator->paginate(), as far as I can tell won't work in 
> the model; it's a component that only wo

RE: CakePHP 2.x Moving Find into Model

2013-05-23 Thread Advantage+
Not sure if this is any help. But I hate all the $params in the controller
especially if you have to do it on the fly so I set all the params in the
model like such: (Just swap out 'model' for your own )

Model:

public function _Pagination($limit = 15){



$params = array(

'conditions' => array(

 
'fields' => array(

 
'Model.id',

 
'Model.featured',

 
'Model.title',

 
'Model.description),

 
'limit' => $limit,

 
'order' => array(

 
'Model.created DESC'),

 
'contain' => array(

 
'State' => array(

 
'fields' => array(

 
'State.abrev')),

'Country' =>
array(

 
'fields' => array(

 
'Country.name',

 
'Country.iso')));



return $params;

}

 

Controller:

$this->paginate = $this->Model->_Pagination ($anything you want to pass
$limit, $conditions...);

And just pop it into the find into the $params like 

 

$this->paginate = $this->Model->_Pagination($limit = 10); or anything you
might want to edit on the fly.

 

Swap out all the vars you want and make it work for you.

Then do standard:

 

$this->set('whatever', $this->paginate('Model'));

 

All it is basically is the same as you normally would do in the controller
but rather than having all that crap I find it easier to say paginateThis(),
pagginateThat() rather than all that in the controller and just pull the
params from the model. 

 

Dave

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Jeremy Burns : Class Outfit
Sent: Friday, May 24, 2013 1:00 AM
To: cake-php@googlegroups.com
Subject: Re: CakePHP 2.x Moving Find into Model

 

Have you got an example of that?

 

On 24 May 2013, at 01:09, lowpass  wrote:





Apply the array to the $paginate class var, not the method. Basically, you
can declare the $paginate array as a class var, then add to or override any
part of it from within an action.

 

On Thu, May 23, 2013 at 7:12 PM, Larry Lutz  wrote:

I'm trying to achieve the fat model/skinny controller mantra in CakePHP 2.7.
In that scenario, the model should control the data, and that means moving
the finds out of the controllers and into the models. However, at least with
the view and admin_view actions, one needs the data paginated.

The problem starts there. It's easy enough to do a $this->find('all') in the
model to get the data, along with any conditions, contains, etc. However
that produces an array. Paginator->paginate(), as far as I can tell won't
work in the model; it's a component that only works in a controller. Yet, if
I take the array produced in the model into the controller and try to pass
it on to Paginator->paginate(), it fails because paginate won't accept an
array.

In terms of trying to achieve the fat model/skinny controller goal, what am
I missing here. How can I achieve a paginated result while still having the
model (properly) do the work of managing and finding the data?

 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
--- 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cake-php+unsubscr...@googlegroups.com
<mailto:cake-php%2bunsubscr...@googlegroups.com> .
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

 

 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
--- 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
--- 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl

Re: CakePHP 2.x Moving Find into Model

2013-05-23 Thread Jeremy Burns : Class Outfit
Have you got an example of that?

On 24 May 2013, at 01:09, lowpass  wrote:

> Apply the array to the $paginate class var, not the method. Basically, you 
> can declare the $paginate array as a class var, then add to or override any 
> part of it from within an action.
> 
> 
> On Thu, May 23, 2013 at 7:12 PM, Larry Lutz  wrote:
> I'm trying to achieve the fat model/skinny controller mantra in CakePHP 2.7. 
> In that scenario, the model should control the data, and that means moving 
> the finds out of the controllers and into the models. However, at least with 
> the view and admin_view actions, one needs the data paginated.
> 
> The problem starts there. It's easy enough to do a $this->find('all') in the 
> model to get the data, along with any conditions, contains, etc. However that 
> produces an array. Paginator->paginate(), as far as I can tell won't work in 
> the model; it's a component that only works in a controller. Yet, if I take 
> the array produced in the model into the controller and try to pass it on to 
> Paginator->paginate(), it fails because paginate won't accept an array.
> 
> In terms of trying to achieve the fat model/skinny controller goal, what am I 
> missing here. How can I achieve a paginated result while still having the 
> model (properly) do the work of managing and finding the data?
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
> 
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: CakePHP 2.x Moving Find into Model

2013-05-23 Thread lowpass
Apply the array to the $paginate class var, not the method. Basically, you
can declare the $paginate array as a class var, then add to or override any
part of it from within an action.


On Thu, May 23, 2013 at 7:12 PM, Larry Lutz  wrote:

> I'm trying to achieve the fat model/skinny controller mantra in CakePHP
> 2.7. In that scenario, the model should control the data, and that means
> moving the finds out of the controllers and into the models. However, at
> least with the view and admin_view actions, one needs the data paginated.
>
> The problem starts there. It's easy enough to do a $this->find('all') in
> the model to get the data, along with any conditions, contains, etc.
> However that produces an array. Paginator->paginate(), as far as I can
> tell won't work in the model; it's a component that only works in a
> controller. Yet, if I take the array produced in the model into the
> controller and try to pass it on to Paginator->paginate(), it fails
> because paginate won't accept an array.
>
> In terms of trying to achieve the fat model/skinny controller goal, what
> am I missing here. How can I achieve a paginated result while still having
> the model (properly) do the work of managing and finding the data?
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




CakePHP 2.x Moving Find into Model

2013-05-23 Thread Larry Lutz
I'm trying to achieve the fat model/skinny controller mantra in CakePHP 
2.7. In that scenario, the model should control the data, and that means 
moving the finds out of the controllers and into the models. However, at 
least with the view and admin_view actions, one needs the data paginated.

The problem starts there. It's easy enough to do a $this->find('all') in 
the model to get the data, along with any conditions, contains, etc. 
However that produces an array. Paginator->paginate(), as far as I can tell 
won't work in the model; it's a component that only works in a controller. 
Yet, if I take the array produced in the model into the controller and try 
to pass it on to Paginator->paginate(), it fails because paginate won't 
accept an array.

In terms of trying to achieve the fat model/skinny controller goal, what am 
I missing here. How can I achieve a paginated result while still having the 
model (properly) do the work of managing and finding the data?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Verificar se o usuário tá logado (CakePHP 2.x)

2013-04-26 Thread André Luis
$this->Session->read('Auth.Usuario.username');

Ou o mais correto...

AuthComponent::user('Usuario.username');

Em quarta-feira, 24 de abril de 2013 18h50min47s UTC-3, Anderson Moraes 
escreveu:
>
> Pessoal, boa noite.
>
> Como eu faço a verificação abaixo no CakePHP 2.x???
>
> if(is_null($session->read('Auth.Usuario.username'))){
>   //Usuário não logado}else{
>   //Usuário logado}
>
> Grato desde já,
>
> Anderson
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Verificar se o usuário tá logado (CakePHP 2.x)

2013-04-25 Thread Reuben
That's generally the right way.

Except in CakePHP 2.x (as opposed to CakePHP 1.3), you might want to use 
$this->Session->read('Auth.User.username') instead.  Perhaps also try 
empty() instead of is_null().

On Thursday, 25 April 2013 07:50:47 UTC+10, Anderson Moraes wrote:
>
> Pessoal, boa noite.
>
> Como eu faço a verificação abaixo no CakePHP 2.x???
>
> if(is_null($session->read('Auth.Usuario.username'))){
>   //Usuário não logado}else{
>   //Usuário logado}
>
> Grato desde já,
>
> Anderson
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Verificar se o usuário tá logado (CakePHP 2.x)

2013-04-24 Thread Anderson Moraes
Pessoal, boa noite.

Como eu faço a verificação abaixo no CakePHP 2.x???

if(is_null($session->read('Auth.Usuario.username'))){
//Usuário não logado}else{
//Usuário logado}

Grato desde já,

Anderson

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: CakePhp 2.x - Internationalization/Localization/Translate Behavior/i18n - How to use in 2.x?

2013-04-14 Thread Livin Inchina

Hi Kicaj and thanks for your post, I stumbled upon it before to start the 
internationalization of project.
It was helpful but my main problem is that I can't save data with 
validation, I have to turn them off on my save($data,false) and I can't 
figure why it won't work!

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: CakePhp 2.x - Internationalization/Localization/Translate Behavior/i18n - How to use in 2.x?

2013-04-09 Thread kicaj
Read my article on bakery site: 
http://bakery.cakephp.org/articles/kicaj/2013/01/27/internationalization_with_static_and_dynamic_content_routing_and_switching

W dniu wtorek, 2 kwietnia 2013 05:06:25 UTC+2 użytkownik Livin Inchina 
napisał:
>
> Hi everyone!
>
> I'm having a hard time making my website multilingual and I after going 
> through the net seeking for answers, I found out that I wasn't the first 
> one to have these issues with version 2.x.
>
> I'm trying to translate my blog. So I have a Post.php model, a 
> PostsController.php and a view admin_edit.ctp.
>
> Using the console, I've created the i18n table by hitting the command > 
> cake i18n.
>
> Following are my files:
>
> *bootstrap.php*
>
> Configure::write('Config.languages', array('fra','eng'));
> Configure::write('Config.language','fra');
> *
> *
> *Post.php*
>
>  class Post extends AppModel{
>
> public $actsAs = array(
> 'Translate' => array(
> 'name'=> '_name',
> 'slug'=> '_slug',
> 'content' => '_content'
> )
> );
> }
>
> *PostsController.php*
> *
> *
> function admin_edit($id=null){
>
> if (!empty($this->request->data)) {
>
> $this->Post->create();
> $this->Post->locale = Configure::read('Config.languages');
>
> if (!empty($this->request->data['Post']['file']['name']) && 
> !empty($this->request->data['Post']['photo'])) {
> $dir = IMAGES.'news';
> if (!file_exists($dir)) {
> mkdir($dir,0777);
> }
> $photo = preg_replace('~[^\w-\.]~', '-', 
> strtolower($this->request->data['Post']['photo']['fra']));
> $f = explode('.',$this->request->data['Post']['file']['name']);
> $ext = '.'.end($f);
> $filename = $photo.date('-YmdHis');
>
> move_uploaded_file($this->request->data['Post']['file']['tmp_name'], 
> $dir.DS.$filename.$ext);
> }
>
> if ($this->Post->save($this->request->data, false)) {
> debug($this->request->data);
> // $this->redirect(array('action' => 'admin_index'));
> }
>
> if ($id!=null) {
> $this->Post->id = $id;
> $this->request->data = $this->Post->readAll();
> }
> }
> }
>
> *admin_edit.ctp*
> *
> *
>  echo $this->Form->create('Post', array('type' => 'file'));
>
> echo $this->Form->input('file', array('type' => 'file'));
> echo $this->Form->input('photo', array();
>
> foreach (Configure::read('Config.languages') as $lang):
> echo $this->Form->input('Post.name.'.$lang, array('div' => false, 'label' 
> => false));
> echo $this->Form->input('Post.slug.'.$lang, array('div' => false, 'label' 
> => false));
> echo $this->Form->textarea('Post.content.'.$lang, array('div' => false, 
> 'label' => false));
> endforeach;
>
> echo $this->Form->input('id');
> echo $this->Form->hidden('created');
>
> echo $this->Form->end('done');
> ?>
>
>
> --
>
> You will notice that in my controller I use $this->Post->locale = 
> Configure::read('Config.languages'); to save all my languages at once.
> To do that, I also loop my input in the view foreach 
> (Configure::read('Config.languages') as $lang):
>
> This code is working as it but it's not enough. As you can see I have a 
> picture and I would like to insert its name in the posts table.
> Right now, if I want to save the name of the picture, I have to do like 
> that: my-image.jpg, meaning I have to manually format it in the form.
> Also, I have a slug and to create it I would like to use the name field 
> and add "-" instead of the spaces to format my slug.
>
> With my code above, I just do a simple 
> $this->Post->save($this->request->data, false) but I cannot format my data.
> What I'd like to do is something like that for example:
>
> $success = array(
> 'name'=> $name,
> 'slug'=> $slug,
> 'photo'   => $photo,
> 'content' => $content,
> 'id'  => $id
> );
> $this->Post->save($success,false);
>
> The problem when I do that is that it needs to be saved in as many 
> languages as I have because. When I loop it to save all the languages, 
> everything is save in the i18n table,
> all the values are translated, the only problem is that the locale column 
> data are all the same, the locale that has been used when saved.
>
> By the way, you will notice that I disabled the validation in the second 
> parameter of the save. If I don't do that, nothing happens.
> That's one of the problem I can't figure, why couldn't I do validations?
>
> So my questions are, how can I save my data in both tables i18n and posts 
> with the possibility to format the data before saving?
> How come I have to disable the validation to make the saving work?
> If you already done that on V2.x, how did you do it?
>
> I'm really stuck on this, the only solution I have right now is no 
> validations, and format data manually in the form.
> This is really not convenient and not pro.
>
> I really hope somebody will help me, I've posted this problem in every 
> forum and group I know, and nobody answered me yet.
> Help for a desperate guy...
>
> Thank you very very much for your help!
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---

CakePhp 2.x - Internationalization/Localization/Translate Behavior/i18n - How to use in 2.x?

2013-04-02 Thread Livin Inchina
Hi everyone!

I'm having a hard time making my website multilingual and I after going 
through the net seeking for answers, I found out that I wasn't the first 
one to have these issues with version 2.x.

I'm trying to translate my blog. So I have a Post.php model, a 
PostsController.php and a view admin_edit.ctp.

Using the console, I've created the i18n table by hitting the command > 
cake i18n.

Following are my files:

*bootstrap.php*

Configure::write('Config.languages', array('fra','eng'));
Configure::write('Config.language','fra');
*
*
*Post.php*

 array(
'name'=> '_name',
'slug'=> '_slug',
'content' => '_content'
)
);
}

*PostsController.php*
*
*
function admin_edit($id=null){

if (!empty($this->request->data)) {

$this->Post->create();
$this->Post->locale = Configure::read('Config.languages');

if (!empty($this->request->data['Post']['file']['name']) && 
!empty($this->request->data['Post']['photo'])) {
$dir = IMAGES.'news';
if (!file_exists($dir)) {
mkdir($dir,0777);
}
$photo = preg_replace('~[^\w-\.]~', '-', 
strtolower($this->request->data['Post']['photo']['fra']));
$f = explode('.',$this->request->data['Post']['file']['name']);
$ext = '.'.end($f);
$filename = $photo.date('-YmdHis');

move_uploaded_file($this->request->data['Post']['file']['tmp_name'], 
$dir.DS.$filename.$ext);
}

if ($this->Post->save($this->request->data, false)) {
debug($this->request->data);
// $this->redirect(array('action' => 'admin_index'));
}

if ($id!=null) {
$this->Post->id = $id;
$this->request->data = $this->Post->readAll();
}
}
}

*admin_edit.ctp*
*
*
Form->create('Post', array('type' => 'file'));

echo $this->Form->input('file', array('type' => 'file'));
echo $this->Form->input('photo', array();

foreach (Configure::read('Config.languages') as $lang):
echo $this->Form->input('Post.name.'.$lang, array('div' => false, 'label' 
=> false));
echo $this->Form->input('Post.slug.'.$lang, array('div' => false, 'label' 
=> false));
echo $this->Form->textarea('Post.content.'.$lang, array('div' => false, 
'label' => false));
endforeach;

echo $this->Form->input('id');
echo $this->Form->hidden('created');

echo $this->Form->end('done');
?>


--

You will notice that in my controller I use $this->Post->locale = 
Configure::read('Config.languages'); to save all my languages at once.
To do that, I also loop my input in the view foreach 
(Configure::read('Config.languages') as $lang):

This code is working as it but it's not enough. As you can see I have a 
picture and I would like to insert its name in the posts table.
Right now, if I want to save the name of the picture, I have to do like 
that: my-image.jpg, meaning I have to manually format it in the form.
Also, I have a slug and to create it I would like to use the name field and 
add "-" instead of the spaces to format my slug.

With my code above, I just do a simple 
$this->Post->save($this->request->data, false) but I cannot format my data.
What I'd like to do is something like that for example:

$success = array(
'name'=> $name,
'slug'=> $slug,
'photo'   => $photo,
'content' => $content,
'id'  => $id
);
$this->Post->save($success,false);

The problem when I do that is that it needs to be saved in as many 
languages as I have because. When I loop it to save all the languages, 
everything is save in the i18n table,
all the values are translated, the only problem is that the locale column 
data are all the same, the locale that has been used when saved.

By the way, you will notice that I disabled the validation in the second 
parameter of the save. If I don't do that, nothing happens.
That's one of the problem I can't figure, why couldn't I do validations?

So my questions are, how can I save my data in both tables i18n and posts 
with the possibility to format the data before saving?
How come I have to disable the validation to make the saving work?
If you already done that on V2.x, how did you do it?

I'm really stuck on this, the only solution I have right now is no 
validations, and format data manually in the form.
This is really not convenient and not pro.

I really hope somebody will help me, I've posted this problem in every 
forum and group I know, and nobody answered me yet.
Help for a desperate guy...

Thank you very very much for your help!

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: How to install CakePHP 2.x on OS X 10.8?

2013-03-05 Thread Andras Kende
try these :

change /etc/php.ini date.timezone to:
date.timezone = 'America/Chicago'


make tmp folder writeable:
sudo chmod -R 777 /Library/WebServer/Documents/cake2/app/tmp/



also all you setup issues is listed here: 
http://book.cakephp.org/2.0/en/installation.html



Andras Kende
http://www.kende.com

On Mar 5, 2013, at 1:55 PM, BoiceNet  wrote:

> I'm new to CakePHP and am trying to configure my MacBook Pro running OS X 
> 10.8 as a developer machine. I already have Apache, MySQL, PHP 5.x installed 
> and they all work fine. I'm unable to get CakePHP to work and cannot find any 
> instructions that work for my situation - did watch a couple of videos and 
> looked into the documentation. 
> 
> Can anyone provide me some assistance with this task? I have the latest 
> version of all software running and have unzipped the CakePHP download. I did 
> copy the Cake folders into the root of my web server. I receive the following 
> error when I go to the folder on my localhost using Firefox. I'm sure I'm 
> missing something important for this configuration.
> 
> Thank you.
> 
> 
> 
> Warning: strtotime() [function.strtotime]: It is not safe to rely on the 
> system's timezone settings. You are *required* to use the date.timezone 
> setting or the date_default_timezone_set() function. In case you used any of 
> those methods and you are still getting this warning, you most likely 
> misspelled the timezone identifier. We selected 'America/Chicago' for 
> 'CST/-6.0/no DST' instead in 
> /Library/WebServer/Documents/cake2/lib/Cake/Cache/CacheEngine.php on line 60
> 
> Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache 
> in /Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php on line 310
> 
> Warning: /Library/WebServer/Documents/cake2/app/tmp/cache/persistent/ is not 
> writable in 
> /Library/WebServer/Documents/cake2/lib/Cake/Cache/Engine/FileEngine.php on 
> line 337
> 
> Fatal error: Uncaught exception 'CacheException' with message 'Cache engine 
> _cake_core_ is not properly configured.' in 
> /Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php:166 Stack trace: 
> #0 /Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php(136): 
> Cache::_buildEngine('_cake_core_') #1 
> /Library/WebServer/Documents/cake2/app/Config/core.php(342): 
> Cache::config('_cake_core_', Array) #2 
> /Library/WebServer/Documents/cake2/lib/Cake/Core/Configure.php(77): 
> include('/Library/WebSer...') #3 
> /Library/WebServer/Documents/cake2/lib/Cake/bootstrap.php(164): 
> Configure::bootstrap(true) #4 
> /Library/WebServer/Documents/cake2/app/webroot/index.php(95): 
> include('/Library/WebSer...') #5 
> /Library/WebServer/Documents/cake2/index.php(43): 
> require('/Library/WebSer...') #6 {main} thrown in 
> /Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php on line 166
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




How to install CakePHP 2.x on OS X 10.8?

2013-03-05 Thread BoiceNet
I'm new to CakePHP and am trying to configure my MacBook Pro running OS X 
10.8 as a developer machine. I already have Apache, MySQL, PHP 5.x 
installed and they all work fine. I'm unable to get CakePHP to work and 
cannot find any instructions that work for my situation - did watch a 
couple of videos and looked into the documentation. 

Can anyone provide me some assistance with this task? I have the latest 
version of all software running and have unzipped the CakePHP download. I 
did copy the Cake folders into the root of my web server. I receive the 
following error when I go to the folder on my localhost using Firefox. I'm 
sure I'm missing something important for this configuration.

Thank you.



*Warning*: strtotime() 
[function.strtotime]: 
It is not safe to rely on the system's timezone settings. You are 
*required* to use the date.timezone setting or the 
date_default_timezone_set() function. In case you used any of those methods 
and you are still getting this warning, you most likely misspelled the 
timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' 
instead in *
/Library/WebServer/Documents/cake2/lib/Cake/Cache/CacheEngine.php* on line *
60*

*Warning*: _cake_core_ cache was unable to write 'cake_dev_en-us' to File 
cache in */Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php* on 
line *310*

*Warning*: /Library/WebServer/Documents/cake2/app/tmp/cache/persistent/ is 
not writable in *
/Library/WebServer/Documents/cake2/lib/Cake/Cache/Engine/FileEngine.php* on 
line *337*

*Fatal error*: Uncaught exception 'CacheException' with message 'Cache 
engine _cake_core_ is not properly configured.' in 
/Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php:166 Stack 
trace: #0 /Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php(136): 
Cache::_buildEngine('_cake_core_') #1 
/Library/WebServer/Documents/cake2/app/Config/core.php(342): 
Cache::config('_cake_core_', Array) #2 
/Library/WebServer/Documents/cake2/lib/Cake/Core/Configure.php(77): 
include('/Library/WebSer...') #3 
/Library/WebServer/Documents/cake2/lib/Cake/bootstrap.php(164): 
Configure::bootstrap(true) #4 
/Library/WebServer/Documents/cake2/app/webroot/index.php(95): 
include('/Library/WebSer...') #5 
/Library/WebServer/Documents/cake2/index.php(43): 
require('/Library/WebSer...') #6 {main} thrown in *
/Library/WebServer/Documents/cake2/lib/Cake/Cache/Cache.php* on line *166*

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Cakephp 2.x - Changing the name of a table within the schema

2013-02-15 Thread Simon Males
Not sure if it is possible using the core CakePHP schema tool.

If I was to attempt this, I would investigate what events are sent to
the before() method. If you find something that works. Then run
ClassRegistry::init('Model')->query('RENAME ...').

Take a look at how I pre-populated a user table after I created it:
https://gist.github.com/sime/1917192

I must say I religiously used the schema tool for migrations, until I
discovered the Migrations plugin by CakeDC.


On Fri, Feb 15, 2013 at 3:43 AM, fr3nch13  wrote:
> Is there a way to change the name of a table (tables) within the database
> schema?
>
> reference:
> (http://book.cakephp.org/2.0/en/console-and-shells/schema-management-and-migrations.html)
>
> I was unable to find out how to do this via googling, or searching the
> api/book.
>
> Basically this is what I'm trying to do:
>
> 1. I have a table named say 'cars'. I want to change the table name to
> 'vehicles'.
> 2. I would like to be able to do this within the built in schema.
> 3. I don't want to drop the old table and create a new one.
>
> The only way have come up with to do this would be to do something in the
> before() function.
> and do something like this:
> http://dev.mysql.com/doc/refman/5.0/en/rename-table.html
>
> I haven't tested this idea as I don't want to actually change anything.
> Is this the only way?
> Will cakephp recognize the change instead of resorting to looking at it's
> own cache?
>
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Simon Males

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Cakephp 2.x - Changing the name of a table within the schema

2013-02-14 Thread fr3nch13
Is there a way to change the name of a table (tables) within the database 
schema?

reference: 
(http://book.cakephp.org/2.0/en/console-and-shells/schema-management-and-migrations.html)

I was unable to find out how to do this via googling, or searching the 
api/book.

Basically this is what I'm trying to do:

1. I have a table named say 'cars'. I want to change the table name to 
'vehicles'.
2. I would like to be able to do this within the built in schema.
3. I don't want to drop the old table and create a new one.

The only way have come up with to do this would be to do something in the 
before() function.
and do something like this: 
http://dev.mysql.com/doc/refman/5.0/en/rename-table.html

I haven't tested this idea as I don't want to actually change anything.
Is this the only way?
Will cakephp recognize the change instead of resorting to looking at it's 
own cache?


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Database Connection MS SQL 2012 With CakePHP 2.X

2013-01-03 Thread Wladimir Chopite
You have to install sqlsrv driver on your server
El ene 2, 2013 10:02 p.m., "Mohamad Zulhelmi Redzwan" 
escribió:

> I try to make connection with my local ms sql db with this settings
> public $default = array(
> 'datasource' => 'Database/Sqlserver',
> 'persistent' => false,
> 'host' => 'localhost\SQLEXPRESS',
> 'login' => 'sa',
> 'password' => '123456',
> 'database' => 'ktmb',
> 'prefix' => '',
> //'encoding' => 'utf8',
> );
>
> but it show error "Cake is NOT able to connect to the database.
>
> Database connection "Sqlserver" is missing, or could not be created."
>
> who can help me...
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Database Connection MS SQL 2012 With CakePHP 2.X

2013-01-03 Thread Lloyd Johnson
i have found this 
http://about-opensource.blogspot.com/2012/06/cake-php-231-with-sql-server-2005-or.html
 i 
am going to try it out tomorrow 

On Thursday, January 3, 2013 4:11:40 PM UTC-7, Lloyd Johnson wrote:
>
> me too i am looking to do this in cakephp 2.0 myself.
>
> On Wednesday, January 2, 2013 7:27:55 PM UTC-7, Mohamad Zulhelmi Redzwan 
> wrote:
>>
>> I try to make connection with my local ms sql db with this settings 
>> public $default = array(
>> 'datasource' => 'Database/Sqlserver',
>> 'persistent' => false,
>> 'host' => 'localhost\SQLEXPRESS',
>> 'login' => 'sa',
>> 'password' => '123456',
>> 'database' => 'ktmb',
>> 'prefix' => '',
>> //'encoding' => 'utf8',
>> );
>>
>> but it show error "Cake is NOT able to connect to the database.
>>
>> Database connection "Sqlserver" is missing, or could not be created."
>>
>> who can help me... 
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Database Connection MS SQL 2012 With CakePHP 2.X

2013-01-03 Thread Lloyd Johnson
me too i am looking to do this in cakephp 2.0 myself.

On Wednesday, January 2, 2013 7:27:55 PM UTC-7, Mohamad Zulhelmi Redzwan 
wrote:
>
> I try to make connection with my local ms sql db with this settings 
> public $default = array(
> 'datasource' => 'Database/Sqlserver',
> 'persistent' => false,
> 'host' => 'localhost\SQLEXPRESS',
> 'login' => 'sa',
> 'password' => '123456',
> 'database' => 'ktmb',
> 'prefix' => '',
> //'encoding' => 'utf8',
> );
>
> but it show error "Cake is NOT able to connect to the database.
>
> Database connection "Sqlserver" is missing, or could not be created."
>
> who can help me... 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Database Connection MS SQL 2012 With CakePHP 2.X

2013-01-02 Thread Mohamad Zulhelmi Redzwan
I try to make connection with my local ms sql db with this settings 
public $default = array(
'datasource' => 'Database/Sqlserver',
'persistent' => false,
'host' => 'localhost\SQLEXPRESS',
'login' => 'sa',
'password' => '123456',
'database' => 'ktmb',
'prefix' => '',
//'encoding' => 'utf8',
);

but it show error "Cake is NOT able to connect to the database.

Database connection "Sqlserver" is missing, or could not be created."

who can help me... 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: how to create a sample theme in cakephp 2.x

2013-01-02 Thread Passivhaus Experte

Am 02.01.2013 13:09, schrieb Siva Kumar:
i am beginner of cakephp. now only i learning it. plz if any one know 
it means help me to create a theme. --
CakePHP Cookbook 2.x Themes 
http://book.cakephp.org/2.0/en/views/themes.html


--
Grüße Sie freundlich.
Tim Bischoff (Indianer3c)
Blogautor Passivhaus Experte
http://www.passivhaus-experte.de/

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




how to create a sample theme in cakephp 2.x

2013-01-02 Thread Siva Kumar
i am beginner of cakephp. now only i learning it. plz if any one know it 
means help me to create a theme.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Access to specific data cakephp 2.x

2012-12-25 Thread Paulo Braga
I already used that way to solve what I want. I wanted something like "acl 
solution", hehe.

Thank you for your answer
Best regards

Paulo 

On Tuesday, December 25, 2012 4:53:22 AM UTC+2, zuha wrote:
>
> Is there a reason you don't just do access control in the controller then? 
>   ie. 
>
> if ($this->request->data['User']['creator_id']  == $this->Session->read('
> Auth.User.id')) {
> $this->BlogPost->save($this->request->data);
> }
>
> BTW, Zuha has a behavior called the UsableBehavior which could probably be 
> modified to do what you're trying to do with a new function or two added to 
> it.  
> https://github.com/zuha/Zuha/tree/master/app/Plugin/Users/Model/Behavior
>
>
>
> On Monday, December 24, 2012 6:12:02 PM UTC-5, Paulo Braga wrote:
>>
>> Hi Rob. Thanks for your answer, the behavior is very interesting. 
>>
>> I think I did not express myself well, I dont want just to set that a 
>> user has only access to the posts he created.
>>
>> I want also to configure for example:
>>
>> We have hotels around a country from the same organization, so in each 
>> city there's a manager, and I want a manager to manage just the hotels in 
>> his city. but this hotels can be created by another user(admin), is it 
>> possible?   I did it with isAuthorized() method, but it requires a lot of 
>> "code (ugly code)° :p 
>>
>> Paulo
>>
>> On Monday, December 24, 2012 3:08:31 PM UTC+2, Rob M wrote:
>>>
>>> Hi Paulo: You are describing row-level access control, and I am doing 
>>> that with CakePHP 2.0 using a modified version of Daniel 
>>> Vecchiato's WhoDidIt Model Behavior (
>>> https://github.com/danfreak/4cakephp/tree/master/models/behaviors). 
>>> Then I check in the controller to see if the id in the table for the person 
>>> who created the record matches the id of the person who is trying to modify 
>>> it. - Rob
>>>
>>> On Sunday, December 23, 2012 4:01:28 PM UTC-5, Paulo Braga wrote:
>>>>
>>>> Hi people.
>>>>
>>>> I am using cakephp 2.x, and I am trying to build a system with group 
>>>> permissions, ok, I used Acl and Auth component without problem.
>>>>
>>>> Now I want to configure access to specific data. for example: 
>>>>
>>>> we have a blog app, and we have users, posts, etc.
>>>> an admin can do anything(no problems);
>>>> a post is posted by a user. (some problems here);
>>>>
>>>> With acl I configured that admin group can do anything. and that user 
>>>> group can just do anything in posts(add, list, edit, delete). everything 
>>>> is 
>>>> working.
>>>>
>>>> But I dont want a user to edit,delete,list posts that were not created 
>>>> by him. 
>>>>
>>>> I used to do it with the method isAuthorized(), but imagining a big 
>>>> app, I think it will be too hard to codify it.
>>>>
>>>> is there a "clean" way to do it???
>>>>
>>>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Access to specific data cakephp 2.x

2012-12-25 Thread Paulo Braga
Hi rob, thanks for your answer, I already used that solution in some 
projects, but I thought that there was an acl solution to do it but as I 
see, there is no.

Thank you, WhoDidIt is very interesting.

Best regards

On Tuesday, December 25, 2012 1:35:59 PM UTC+2, Rob M wrote:
>
> Hi Paulo:
> To answer your first question: give everyone access to every post by 
> *not*checking to see who owns it in the Controller::index() and 
> Controller::view() methods. Give only the post's writer the ability to 
> edit/delete the post by checking first to see who owns it in the 
> Controller::edit() and Controller::delete() methods. With the 
> aforementioned WhoDidIt behavior we're talking about only one additional 
> line of controller code plus one additional condition:
> $user = $this->Session->Read('Auth.User.id');
>
> ...so in the Controller::delete() function (for example):
> function delete($id = null) {
> if (!$id) {
> $this->Session->setFlash(__('Invalid id for Post'));
> $this->redirect(array('action'=>'index'));
> }
> *$*user* = $this->Session->Read('Auth.User.id'); *// Only allow deletes 
> from user's own records
> if (*$this->Post->field('created_by', array('id' => $id)) == $user* && 
> $this->Post->delete($id)) {
> $this->Session->setFlash(__('Post deleted'));
> }
> $this->Session->setFlash(__('Post was not deleted'));
> }
>
> To answer your second question: same idea. Check that the manager logged 
> in has access to the controller function on that hotel *in the 
> appropriate controller function*.
> -Rob
>
> On Monday, December 24, 2012 6:12:02 PM UTC-5, Paulo Braga wrote:
>>
>> Hi Rob. Thanks for your answer, the behavior is very interesting. 
>>
>> I think I did not express myself well, I dont want just to set that a 
>> user has only access to the posts he created.
>>
>> I want also to configure for example:
>>
>> We have hotels around a country from the same organization, so in each 
>> city there's a manager, and I want a manager to manage just the hotels in 
>> his city. but this hotels can be created by another user(admin), is it 
>> possible?   I did it with isAuthorized() method, but it requires a lot of 
>> "code (ugly code)° :p 
>>
>> Paulo
>>
>> On Monday, December 24, 2012 3:08:31 PM UTC+2, Rob M wrote:
>>>
>>> Hi Paulo: You are describing row-level access control, and I am doing 
>>> that with CakePHP 2.0 using a modified version of Daniel 
>>> Vecchiato's WhoDidIt Model Behavior (
>>> https://github.com/danfreak/4cakephp/tree/master/models/behaviors). 
>>> Then I check in the controller to see if the id in the table for the person 
>>> who created the record matches the id of the person who is trying to modify 
>>> it. - Rob
>>>
>>> On Sunday, December 23, 2012 4:01:28 PM UTC-5, Paulo Braga wrote:
>>>>
>>>> Hi people.
>>>>
>>>> I am using cakephp 2.x, and I am trying to build a system with group 
>>>> permissions, ok, I used Acl and Auth component without problem.
>>>>
>>>> Now I want to configure access to specific data. for example: 
>>>>
>>>> we have a blog app, and we have users, posts, etc.
>>>> an admin can do anything(no problems);
>>>> a post is posted by a user. (some problems here);
>>>>
>>>> With acl I configured that admin group can do anything. and that user 
>>>> group can just do anything in posts(add, list, edit, delete). everything 
>>>> is 
>>>> working.
>>>>
>>>> But I dont want a user to edit,delete,list posts that were not created 
>>>> by him. 
>>>>
>>>> I used to do it with the method isAuthorized(), but imagining a big 
>>>> app, I think it will be too hard to codify it.
>>>>
>>>> is there a "clean" way to do it???
>>>>
>>>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Access to specific data cakephp 2.x

2012-12-25 Thread Rob M
Hi Paulo:
To answer your first question: give everyone access to every post by 
*not*checking to see who owns it in the Controller::index() and 
Controller::view() methods. Give only the post's writer the ability to 
edit/delete the post by checking first to see who owns it in the 
Controller::edit() and Controller::delete() methods. With the 
aforementioned WhoDidIt behavior we're talking about only one additional 
line of controller code plus one additional condition:
$user = $this->Session->Read('Auth.User.id');

...so in the Controller::delete() function (for example):
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Post'));
$this->redirect(array('action'=>'index'));
}
*$*user* = $this->Session->Read('Auth.User.id'); *// Only allow deletes 
from user's own records
if (*$this->Post->field('created_by', array('id' => $id)) == $user* && 
$this->Post->delete($id)) {
$this->Session->setFlash(__('Post deleted'));
}
$this->Session->setFlash(__('Post was not deleted'));
}

To answer your second question: same idea. Check that the manager logged in 
has access to the controller function on that hotel *in the appropriate 
controller function*.
-Rob

On Monday, December 24, 2012 6:12:02 PM UTC-5, Paulo Braga wrote:
>
> Hi Rob. Thanks for your answer, the behavior is very interesting. 
>
> I think I did not express myself well, I dont want just to set that a user 
> has only access to the posts he created.
>
> I want also to configure for example:
>
> We have hotels around a country from the same organization, so in each 
> city there's a manager, and I want a manager to manage just the hotels in 
> his city. but this hotels can be created by another user(admin), is it 
> possible?   I did it with isAuthorized() method, but it requires a lot of 
> "code (ugly code)° :p 
>
> Paulo
>
> On Monday, December 24, 2012 3:08:31 PM UTC+2, Rob M wrote:
>>
>> Hi Paulo: You are describing row-level access control, and I am doing 
>> that with CakePHP 2.0 using a modified version of Daniel 
>> Vecchiato's WhoDidIt Model Behavior (
>> https://github.com/danfreak/4cakephp/tree/master/models/behaviors). Then 
>> I check in the controller to see if the id in the table for the person who 
>> created the record matches the id of the person who is trying to modify it. 
>> - Rob
>>
>> On Sunday, December 23, 2012 4:01:28 PM UTC-5, Paulo Braga wrote:
>>>
>>> Hi people.
>>>
>>> I am using cakephp 2.x, and I am trying to build a system with group 
>>> permissions, ok, I used Acl and Auth component without problem.
>>>
>>> Now I want to configure access to specific data. for example: 
>>>
>>> we have a blog app, and we have users, posts, etc.
>>> an admin can do anything(no problems);
>>> a post is posted by a user. (some problems here);
>>>
>>> With acl I configured that admin group can do anything. and that user 
>>> group can just do anything in posts(add, list, edit, delete). everything is 
>>> working.
>>>
>>> But I dont want a user to edit,delete,list posts that were not created 
>>> by him. 
>>>
>>> I used to do it with the method isAuthorized(), but imagining a big app, 
>>> I think it will be too hard to codify it.
>>>
>>> is there a "clean" way to do it???
>>>
>>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Access to specific data cakephp 2.x

2012-12-24 Thread zuha
Is there a reason you don't just do access control in the controller then? 
  ie. 

if ($this->request->data['User']['creator_id']  == 
$this->Session->read('Auth.User.id')) {
$this->BlogPost->save($this->request->data);
}

BTW, Zuha has a behavior called the UsableBehavior which could probably be 
modified to do what you're trying to do with a new function or two added to 
it. 
 https://github.com/zuha/Zuha/tree/master/app/Plugin/Users/Model/Behavior



On Monday, December 24, 2012 6:12:02 PM UTC-5, Paulo Braga wrote:
>
> Hi Rob. Thanks for your answer, the behavior is very interesting. 
>
> I think I did not express myself well, I dont want just to set that a user 
> has only access to the posts he created.
>
> I want also to configure for example:
>
> We have hotels around a country from the same organization, so in each 
> city there's a manager, and I want a manager to manage just the hotels in 
> his city. but this hotels can be created by another user(admin), is it 
> possible?   I did it with isAuthorized() method, but it requires a lot of 
> "code (ugly code)° :p 
>
> Paulo
>
> On Monday, December 24, 2012 3:08:31 PM UTC+2, Rob M wrote:
>>
>> Hi Paulo: You are describing row-level access control, and I am doing 
>> that with CakePHP 2.0 using a modified version of Daniel 
>> Vecchiato's WhoDidIt Model Behavior (
>> https://github.com/danfreak/4cakephp/tree/master/models/behaviors). Then 
>> I check in the controller to see if the id in the table for the person who 
>> created the record matches the id of the person who is trying to modify it. 
>> - Rob
>>
>> On Sunday, December 23, 2012 4:01:28 PM UTC-5, Paulo Braga wrote:
>>>
>>> Hi people.
>>>
>>> I am using cakephp 2.x, and I am trying to build a system with group 
>>> permissions, ok, I used Acl and Auth component without problem.
>>>
>>> Now I want to configure access to specific data. for example: 
>>>
>>> we have a blog app, and we have users, posts, etc.
>>> an admin can do anything(no problems);
>>> a post is posted by a user. (some problems here);
>>>
>>> With acl I configured that admin group can do anything. and that user 
>>> group can just do anything in posts(add, list, edit, delete). everything is 
>>> working.
>>>
>>> But I dont want a user to edit,delete,list posts that were not created 
>>> by him. 
>>>
>>> I used to do it with the method isAuthorized(), but imagining a big app, 
>>> I think it will be too hard to codify it.
>>>
>>> is there a "clean" way to do it???
>>>
>>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Access to specific data cakephp 2.x

2012-12-24 Thread Paulo Braga
Hi Rob. Thanks for your answer, the behavior is very interesting. 

I think I did not express myself well, I dont want just to set that a user 
has only access to the posts he created.

I want also to configure for example:

We have hotels around a country from the same organization, so in each city 
there's a manager, and I want a manager to manage just the hotels in his 
city. but this hotels can be created by another user(admin), is it 
possible?   I did it with isAuthorized() method, but it requires a lot of 
"code (ugly code)° :p 

Paulo

On Monday, December 24, 2012 3:08:31 PM UTC+2, Rob M wrote:
>
> Hi Paulo: You are describing row-level access control, and I am doing that 
> with CakePHP 2.0 using a modified version of Daniel Vecchiato's WhoDidIt 
> Model Behavior (
> https://github.com/danfreak/4cakephp/tree/master/models/behaviors). Then 
> I check in the controller to see if the id in the table for the person who 
> created the record matches the id of the person who is trying to modify it. 
> - Rob
>
> On Sunday, December 23, 2012 4:01:28 PM UTC-5, Paulo Braga wrote:
>>
>> Hi people.
>>
>> I am using cakephp 2.x, and I am trying to build a system with group 
>> permissions, ok, I used Acl and Auth component without problem.
>>
>> Now I want to configure access to specific data. for example: 
>>
>> we have a blog app, and we have users, posts, etc.
>> an admin can do anything(no problems);
>> a post is posted by a user. (some problems here);
>>
>> With acl I configured that admin group can do anything. and that user 
>> group can just do anything in posts(add, list, edit, delete). everything is 
>> working.
>>
>> But I dont want a user to edit,delete,list posts that were not created by 
>> him. 
>>
>> I used to do it with the method isAuthorized(), but imagining a big app, 
>> I think it will be too hard to codify it.
>>
>> is there a "clean" way to do it???
>>
>>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Access to specific data cakephp 2.x

2012-12-24 Thread Rob M
Hi Paulo: You are describing row-level access control, and I am doing that 
with CakePHP 2.0 using a modified version of Daniel Vecchiato's WhoDidIt 
Model Behavior 
(https://github.com/danfreak/4cakephp/tree/master/models/behaviors). Then I 
check in the controller to see if the id in the table for the person who 
created the record matches the id of the person who is trying to modify it. 
- Rob

On Sunday, December 23, 2012 4:01:28 PM UTC-5, Paulo Braga wrote:
>
> Hi people.
>
> I am using cakephp 2.x, and I am trying to build a system with group 
> permissions, ok, I used Acl and Auth component without problem.
>
> Now I want to configure access to specific data. for example: 
>
> we have a blog app, and we have users, posts, etc.
> an admin can do anything(no problems);
> a post is posted by a user. (some problems here);
>
> With acl I configured that admin group can do anything. and that user 
> group can just do anything in posts(add, list, edit, delete). everything is 
> working.
>
> But I dont want a user to edit,delete,list posts that were not created by 
> him. 
>
> I used to do it with the method isAuthorized(), but imagining a big app, I 
> think it will be too hard to codify it.
>
> is there a "clean" way to do it???
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Access to specific data cakephp 2.x

2012-12-23 Thread Paulo Braga
Hi people.

I am using cakephp 2.x, and I am trying to build a system with group 
permissions, ok, I used Acl and Auth component without problem.

Now I want to configure access to specific data. for example: 

we have a blog app, and we have users, posts, etc.
an admin can do anything(no problems);
a post is posted by a user. (some problems here);

With acl I configured that admin group can do anything. and that user group 
can just do anything in posts(add, list, edit, delete). everything is 
working.

But I dont want a user to edit,delete,list posts that were not created by 
him. 

I used to do it with the method isAuthorized(), but imagining a big app, I 
think it will be too hard to codify it.

is there a "clean" way to do it???

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




CakePhp 2.x Newbie

2012-12-10 Thread Maximum
Hello everyone!!!

I am a Php Junior developer. been recently employed tomaintained CakePhp 
Applications developed using 1.3.X version. I do the job very well. My 
problem is that now I am trying to learn to build cake applications from 
scratch using Cakephp 2.X.

the actual problem is when having done setting up mu enviroment, Cake gives 
me a "Missing controller" error. Say if I have named my app 
InventotySystem, cake will say "InventorySystemController missing please 
verify if created blah blah blah blah". I am not sure whether this is an 
expected behavior. if not, what should I do to proceed from this?

Please help.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: CakePHP 2.x and ajax

2012-11-04 Thread Jeremy Burns : Class Outfit
The ajax helper is deprecated in 2.0.

Here's a quick and dirty ajax form submission:

in app_controller->beforeFilter():

if ($this->RequestHandler->isAjax()) {
 Configure::write('debug', 0);
 $this->autoRender = false;
 $this->layout = 'ajax';
}

In the  section of default layout:


 var baseUrl = "<?php echo $this->Html->url('/', true); ?>";


At the end of the controller function (after all variables have been set):

if ($this->RequestHandler->isAjax()) {
 $this->render('/elements/[element name]);
}


At the foot of the form containing the form to submit via ajax (or in an 
external js file that's called with $this->Html->script):


 $('#[FORM_NAME]').submit(function() {

  $.ajax({
   type: 'POST',
   url: baseUrl + '[ROUTE]', - note that baseUrl has a following / 
so no need to put one in from of [ROUTE]
   data: $(this).serialize(),
   dataType: 'html',
   success: function(data){
$('#[id of receiving content]').fadeOut(100, function() {
 $(this).html(data).fadeIn(500);
});
   },
   error: function(message){
console.debug(message);
   }
  });
 return false;
 });



And that's it!!


On 4 Nov 2012, at 06:59, kani  wrote:

> http://www.cakephp.4uk.pl
> 
> On Thursday, November 1, 2012 4:18:57 PM UTC+8, franscelstain wrote:
> is there someone who can teach me to use ajax in cakephp 2.x, because I am 
> still very novice
> 
> thanks
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>  
>  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: CakePHP 2.x and ajax

2012-11-03 Thread kani
http://www.cakephp.4uk.pl

On Thursday, November 1, 2012 4:18:57 PM UTC+8, franscelstain wrote:
>
> is there someone who can teach me to use ajax in cakephp 2.x, because I am 
> still very novice
>
> thanks
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: CakePHP 2.x and ajax

2012-11-02 Thread Karey Powell
Checkout this video: http://www.youtube.com/watch?v=dQ71psonQx0&feature=plcp. 
Hope it helps.

On Thursday, 1 November 2012 04:18:57 UTC-4, franscelstain wrote:
>
> is there someone who can teach me to use ajax in cakephp 2.x, because I am 
> still very novice
>
> thanks
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




CakePHP 2.x and ajax

2012-11-01 Thread franscelstain
is there someone who can teach me to use ajax in cakephp 2.x, because I am 
still very novice

thanks

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: CakePHP 2.x implement edit form in ajax in a popup

2012-10-30 Thread Babulal Saini
Hi,

You are use facebox jquery this is very nice

On Wednesday, October 3, 2012 10:00:22 AM UTC-4, Kiran wrote:
>
> I have read other posts and searched google before posting this here.
>
> I have a jquery popup in a view where I intend to show EDIT form and then 
> submit using ajax.
>
> Further Details
>
> There is a reservation controller. reservations on a particular date are 
> shown in the index ctp in a table . When user clicks on edit button a div 
> pops up. Now I need to show Edit form and submit it via Ajax. 
>
> Please can somebody point me in the right direction , may be some help or 
> some tutorial.
>
> Thanks in advance,
> Kiran
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Ask retrieving data from multiple association data in cakephp 2.x

2012-10-24 Thread ecko usil
I have multiples table in my database. 
agendas, agenda_details, activities

agendas has many agenda_details 
agenda_details belongs to agendas and has many activities. 

I want retrieve data so I can get data like this 
agenda name 
 - activities 1
 - activities 2
 - activities 3

when I use find all, I can't get data from activities which has tied by 
agenda_detail 
agenda 
 - agenda-detail
 - agenda-detail

anyone can help me?

thanks in advance.
Best regards 
- Ucil @ucil619 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: CakePHP 2.x how to manage multiple user-tables and access areas?

2012-10-23 Thread Braindead
Actually you only need one table with the following fields:

username or email
password
group
+ additional fields that might be useful for your application

After login (with AuthComponent) you can check to which group the user 
belongs. Depending on the group you can redirect the user to the correct 
area.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




CakePHP 2.x how to manage multiple user-tables and access areas?

2012-10-23 Thread Mathias Ratheike


i'm planning a new project with cakephp and i have a problem.

i want to create multiple access areas and multiple user-tables i.e. like a 
shop system:
group 1: customers
group 2: merchants
group 3: affiliate-partners (4. group: admins [this maybe with acl])

every group will have its own area (domain.tld, domain.tld/merchants, 
domain.tld/affiliate) (i know about prefex-routing, but will it works with 
my idea?)

How can i manage 3 separate logins, if i.e. a merchant logged in, he 
wouldn't automatically logged in in affiliate area? in my first trys i see, 
that there's only one cookie and every merchant would be logged in in other 
areas too without having an account there.

please help me and point me in the right direction ;)

(sry for my terrible english) greetings from germany

m.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




twitter application using cakephp 2.x

2012-10-10 Thread ecko usil
Hi, 

I just develop new cake application and want to connect with twitter by 
OAuth. I found this plugin 
https://github.com/mishudark/CakePHP-2.x-Twitter-Plugin but I have trouble 
when applied that plugin into my app. 

"Whoa there!

There is no request token for this page. That's the special key we need 
from applications asking to use your Twitter account. Please go back to the 
site or application that sent you here and try again; it was probably just 
a mistake."


When I look into address bar, "
http://api.twitter.com/oauth/authorize?oauth_token="; no oauth_token 
generated. 


Please link me any code or tutorial

Thank in advance.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Sequence Behavior in CakePHP 2.x ?

2012-10-09 Thread Mark Kessler
Hi!
Does anybody know of a good sequence (ordered list) behavior for cakePHP 
2.x? I used Neil Crookes Seqence Behavior but this hasn't been updated to 
2.x yet.
Thx!
Mark

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: CakePHP 2.x implement edit form in ajax in a popup

2012-10-03 Thread Kiran Ambati
Thank you very much Ivan,

I got an Idea now. I tried similarly but couldnt get it worked and thought
that was not the right way. It is clear now. I will try this and post my
results here.

Cheers,
Kiran

On Thu, Oct 4, 2012 at 11:46 AM, Ivan Rimac  wrote:

> You can find solution inside code down here, just read it carefuly. I used
> fancybox, but easily you can use some other functions from jquery. I
> recommend you fancybox for this kind of action.
>
> 
>   __('Submit feedback'); ?>
> 
>  
> Form->create('Feedback', array('id' => 'feedback-form',
> 'controller' => 'feedbacks', 'action' => 'add'));?>
>  
> Form->input('rate', array('type' => 'hidden', 'id' =>
> 'rate-value')); ?>
>  
> Form->input('ride_id', array('type' => 'hidden', 'value'
> => $ride['Ride']['id'])); ?>
>  Form->input('comment', array('type' => 'textfield'));
> ?>
> Form->end(__('Submit', true));?>
>  
> 
> 
>  $(document).ready(function() {
> $(".rize-feedback").fancybox({
>  fitToView : false,
> width : '70%',
>  height : '70%',
> autoSize : true,
>  closeClick : false,
> openEffect : 'none',
>  closeEffect : 'none'
> });
>  $('.star').raty({
>   cancel : true,
>   target : '#rate-value',
>   targetKeep : true,
>   targetType : 'number'
> });
>  $("#feedback-form").submit(function(){
> $.fancybox.showLoading();
>  $.ajax({
>   type: "POST",
>   url: $(this).attr('action'),
>   data: $("#feedback-form").serialize(),
> }).done(function( msg ) {
>$.fancybox.hideLoading();
>json = jQuery.parseJSON(msg);
>$('#feedback-form').hide();
>$('#feedback-form-div h2').text(json.Success.title);
>$('#feedback-form-div').append('

' + > json.Success.message + '

'); > }); > return false; > }) > }) > > > > > > -- > *Ivan Rimac*** > mail: ivn...@gmail.com > *tel: +385 95 555 99 66* > *http://ivanrimac.com* > > -- > Like Us on FacekBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > 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. > Visit this group at http://groups.google.com/group/cake-php?hl=en. > > > -- *Thank you,* *Kiran.* -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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. Visit this group at http://groups.google.com/group/cake-php?hl=en.

Re: CakePHP 2.x implement edit form in ajax in a popup

2012-10-03 Thread Ivan Rimac
You can find solution inside code down here, just read it carefuly. I used
fancybox, but easily you can use some other functions from jquery. I
recommend you fancybox for this kind of action.





Form->create('Feedback', array('id' => 'feedback-form',
'controller' => 'feedbacks', 'action' => 'add'));?>

Form->input('rate', array('type' => 'hidden', 'id' =>
'rate-value')); ?>

Form->input('ride_id', array('type' => 'hidden', 'value'
=> $ride['Ride']['id'])); ?>
Form->input('comment', array('type' => 'textfield')); ?>
Form->end(__('Submit', true));?>



$(document).ready(function() {
$(".rize-feedback").fancybox({
fitToView : false,
width : '70%',
height : '70%',
autoSize : true,
closeClick : false,
openEffect : 'none',
closeEffect : 'none'
});
$('.star').raty({
  cancel : true,
  target : '#rate-value',
  targetKeep : true,
  targetType : 'number'
});
 $("#feedback-form").submit(function(){
$.fancybox.showLoading();
$.ajax({
  type: "POST",
  url: $(this).attr('action'),
  data: $("#feedback-form").serialize(),
}).done(function( msg ) {
   $.fancybox.hideLoading();
   json = jQuery.parseJSON(msg);
   $('#feedback-form').hide();
   $('#feedback-form-div h2').text(json.Success.title);
   $('#feedback-form-div').append('

' + json.Success.message + '

'); }); return false; }) }) -- *Ivan Rimac*** mail: ivn...@gmail.com *tel: +385 95 555 99 66* *http://ivanrimac.com* -- Like Us on FacekBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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. Visit this group at http://groups.google.com/group/cake-php?hl=en.

Re: CakePHP 2.x implement edit form in ajax in a popup

2012-10-03 Thread Kiran Ambati
Thanks for your reply Greg.

If I had to close the pop up , your solution might work. But I should not
close the pop up on submit. That is why I want to do that in Ajax.

How can $load pick form which is not on the page. However I am able to
display form.

I need to know how to submit this form in ajax way..

Many thanks,
Kiran


On Thu, Oct 4, 2012 at 6:06 AM, Greg Skerman  wrote:

> jquery, and $.load() will be your friend here.
>
> You can just "load" the html view of the edit form into a div and show it.
>
> not the only way to do it, but certainly the most straight forward. (then
> just trap the submit, serialize the form, fire off a post in jquery and
> close the popup, refresh the content)
>
>
>
> On Thu, Oct 4, 2012 at 12:00 AM, Kiran  wrote:
>
>> I have read other posts and searched google before posting this here.
>>
>> I have a jquery popup in a view where I intend to show EDIT form and then
>> submit using ajax.
>>
>> Further Details
>>
>> There is a reservation controller. reservations on a particular date are
>> shown in the index ctp in a table . When user clicks on edit button a div
>> pops up. Now I need to show Edit form and submit it via Ajax.
>>
>> Please can somebody point me in the right direction , may be some help or
>> some tutorial.
>>
>> Thanks in advance,
>> Kiran
>>
>> --
>> Like Us on FacekBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> 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.
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>
>>
>>
>
>  --
> Like Us on FacekBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>



-- 
*Thank you,*
*Kiran.*

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: CakePHP 2.x implement edit form in ajax in a popup

2012-10-03 Thread Greg Skerman
jquery, and $.load() will be your friend here.

You can just "load" the html view of the edit form into a div and show it.

not the only way to do it, but certainly the most straight forward. (then
just trap the submit, serialize the form, fire off a post in jquery and
close the popup, refresh the content)


On Thu, Oct 4, 2012 at 12:00 AM, Kiran  wrote:

> I have read other posts and searched google before posting this here.
>
> I have a jquery popup in a view where I intend to show EDIT form and then
> submit using ajax.
>
> Further Details
>
> There is a reservation controller. reservations on a particular date are
> shown in the index ctp in a table . When user clicks on edit button a div
> pops up. Now I need to show Edit form and submit it via Ajax.
>
> Please can somebody point me in the right direction , may be some help or
> some tutorial.
>
> Thanks in advance,
> Kiran
>
> --
> Like Us on FacekBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




CakePHP 2.x implement edit form in ajax in a popup

2012-10-03 Thread Kiran
I have read other posts and searched google before posting this here.

I have a jquery popup in a view where I intend to show EDIT form and then 
submit using ajax.

Further Details

There is a reservation controller. reservations on a particular date are 
shown in the index ctp in a table . When user clicks on edit button a div 
pops up. Now I need to show Edit form and submit it via Ajax. 

Please can somebody point me in the right direction , may be some help or 
some tutorial.

Thanks in advance,
Kiran

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Pagination Limit Default Global AppController CakePHP 2.x

2012-10-02 Thread TonyCharlotteCakePHP
Thanks. Exactly what I was looking for.

On Thursday, September 20, 2012 5:26:58 PM UTC-4, cricket wrote:
>
> If you define a $paginate var in AppController, it's going to be 
> overwritten in your other controllers. What you could do instead is 
> put it in AppController::beforeFilter() like so: 
>
> $this->paginate['limit'] = 15; 
>
> Just remember to have parent::beforeFilter() in your other 
> controllers' beforeFilter callbacks. 
>
> On Tue, Sep 18, 2012 at 5:38 PM, TonyCharlotteCakePHP 
> > wrote: 
> > Well it seems like cakephp's default limit for pagination is 20. For 
> > instance, if limit is not set for pagination, then cakephp will display 
> 20 
> > records when using pagination. I can set the limit for each individual 
> > controller with: 
> > 
> > public $paginate = array( 
> > 'limit' => 15 
> > ); 
> > 
> > but I'm wanting to set this globally for all controllers/actions. I 
> figured 
> > I could set limit to 15 within the AppController (using the same code 
> above) 
> > but I still get 20 records for pagination within my other 
> controllers/action 
> > where limit has not been set. 
> > 
> > On Thursday, September 13, 2012 4:42:53 PM UTC-4, TonyCharlotteCakePHP 
> > wrote: 
> >> 
> >> Is it possible to set or change the limit of pagination globally for 
> all 
> >> controllers? 
> >> 
> >> I've tried adding the below to the AppController: 
> >> 
> >> public $paginate = array( 
> >> 'limit' => 15 
> >> ); 
> >> 
> >> Thanks 
> > 
> > -- 
> > Like Us on FacekBook https://www.facebook.com/CakePHP 
> > Find us on Twitter http://twitter.com/CakePHP 
> > 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "CakePHP" group. 
> > To post to this group, send email to cake...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > cake-php+u...@googlegroups.com . 
> > Visit this group at http://groups.google.com/group/cake-php?hl=en. 
> > 
> > 
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Pagination Limit Default Global AppController CakePHP 2.x

2012-09-21 Thread AD7six


On Friday, 21 September 2012 13:01:56 UTC+2, Nikhil Agrawal wrote:
>
> Hi
> Directly you can change inside the pagination helper, it has been defined 
>  as 20 over there.
>

1) no it isn't
2) don't edit your Cake folder

AD

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Pagination Limit Default Global AppController CakePHP 2.x

2012-09-20 Thread lowpass
If you define a $paginate var in AppController, it's going to be
overwritten in your other controllers. What you could do instead is
put it in AppController::beforeFilter() like so:

$this->paginate['limit'] = 15;

Just remember to have parent::beforeFilter() in your other
controllers' beforeFilter callbacks.

On Tue, Sep 18, 2012 at 5:38 PM, TonyCharlotteCakePHP
 wrote:
> Well it seems like cakephp's default limit for pagination is 20. For
> instance, if limit is not set for pagination, then cakephp will display 20
> records when using pagination. I can set the limit for each individual
> controller with:
>
> public $paginate = array(
> 'limit' => 15
> );
>
> but I'm wanting to set this globally for all controllers/actions. I figured
> I could set limit to 15 within the AppController (using the same code above)
> but I still get 20 records for pagination within my other controllers/action
> where limit has not been set.
>
> On Thursday, September 13, 2012 4:42:53 PM UTC-4, TonyCharlotteCakePHP
> wrote:
>>
>> Is it possible to set or change the limit of pagination globally for all
>> controllers?
>>
>> I've tried adding the below to the AppController:
>>
>> public $paginate = array(
>> 'limit' => 15
>> );
>>
>> Thanks
>
> --
> Like Us on FacekBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Pagination Limit Default Global AppController CakePHP 2.x

2012-09-18 Thread TonyCharlotteCakePHP
Well it seems like cakephp's default limit for pagination is 20. For 
instance, if limit is not set for pagination, then cakephp will display 20 
records when using pagination. I can set the limit for each individual 
controller with:

public $paginate = array(
'limit' => 15
);

but I'm wanting to set this globally for all controllers/actions. I figured 
I could set limit to 15 within the AppController (using the same code 
above) but I still get 20 records for pagination within my other 
controllers/action where limit has not been set.

On Thursday, September 13, 2012 4:42:53 PM UTC-4, TonyCharlotteCakePHP 
wrote:
>
> Is it possible to set or change the limit of pagination globally for all 
> controllers?
>
> I've tried adding the below to the AppController:
>
> public $paginate = array(
> 'limit' => 15
> );
>
> Thanks
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Cakephp 2.x ajax edit not working in Firefox and Opera

2012-09-13 Thread incognito
Hi, 

I am basically trying to create an ajax edit form. 
This is the edit link code 

Js->link('Edit', 
  array('controller' => 'employees', 'action' => 
'personal_details_edit',$employee['Employee']['id']), 
  array( 
 'update' => '#personal_details_update', 
 'evalScripts' => true, 
'before' => $this->Js->get('#busy-indicator')->effect('fadeIn', 
array('buffer' => false)), 
 'complete' => $this->Js->get('#busy-indicator')->effect('fadeOut', 
array('buffer' => false)), 
  ) 
   ); 
 echo $this->Js->writeBuffer();   
?> 

And this is the ajax form code which gets loaded after clicking the above 
edit link. 

Js->get('#employee_personal_edit')->serializeForm( 
array( 
'isForm' => true, 
'inline' => true) 
); 
  
// Submit the serialize data on submit click 
$this->Js->get('#employee_personal_edit')->event( 
  'submit', 
  $this->Js->request( 
array('action' => 'personal_details_edit'), 
array( 
'update' => '#personal_details_update', // element to 
update 
 // after form submission 
'data' => $data, 
'async' => true, 
'dataExpression'=>true, 
'method' => 'POST', 

  
) 
) 
); 
 echo $this->Js->writeBuffer(); 
?> 


The form submit is working in Chrome, IE, Safari but not working in Firefox 
and Opera.When I click form submit in Firefox nothing happens(no 
XMLHTTPRequest is being sent). 

If i access the form link directly(without loading via ajax edit link)its 
working normally in Firefox. 

How to fix it?Any help is appreciated. :)  

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Pagination Limit Default Global AppController CakePHP 2.x

2012-09-13 Thread Tilen Majerle
and ? it's not working ?
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/9/13 TonyCharlotteCakePHP 

> Is it possible to set or change the limit of pagination globally for all
> controllers?
>
> I've tried adding the below to the AppController:
>
> public $paginate = array(
> 'limit' => 15
> );
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
>

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Pagination Limit Default Global AppController CakePHP 2.x

2012-09-13 Thread TonyCharlotteCakePHP
Is it possible to set or change the limit of pagination globally for all 
controllers?

I've tried adding the below to the AppController:

public $paginate = array(
'limit' => 15
);

Thanks

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




Re: In CakePHP 2.x Extending Views not working.. I think the documentation for 2.0 is wrong. How to work Extending Views concept ?

2012-08-28 Thread majna
Should be plural "Users":

$this->extend('/Users/add');

Cheers!

On Monday, August 27, 2012 4:29:37 PM UTC+2, Steve Babs wrote:
>
> I have created .
>
>
> Views/Users/add.ctp
> ---
> fetch('title'); ?>
> fetch('content'); ?>
>
> 
> Related actions
> 
> fetch('sidebar'); ?>
> 
> 
>
> Views/Users/index.ctp
> ---
>  $this->extend('/User/add');
> $this->assign('title', $users['User']['0']['username']);
>
> $this->start('sidebar');
> ?>
>  echo $this->Html->link('edit', array(
> 'action' => 'edit',
> $users['User']['0']['id']
> )); ?>
> 
> end(); ?>
>
> while I am accessing http://localhost/cakesite/users/add.
>
> I am getting blank space in sidebar content. anyone help me..
>  
>
> Thanks,
> Steve Babs
>
>
>

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: In CakePHP 2.x Extending Views not working.. I think the documentation for 2.0 is wrong. How to work Extending Views concept ?

2012-08-28 Thread AD7six


On Monday, 27 August 2012 21:22:49 UTC+2, Mancho Murgan wrote:
>
> Remove white spaces and new lines before  models.
>
That's not a relevant suggestion.

AD 

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




Re: In CakePHP 2.x Extending Views not working.. I think the documentation for 2.0 is wrong. How to work Extending Views concept ?

2012-08-27 Thread Mancho
Remove white spaces and new lines before http://groups.google.com/group/cake-php?hl=en-US.




Re: In CakePHP 2.x Extending Views not working.. I think the documentation for 2.0 is wrong. How to work Extending Views concept ?

2012-08-27 Thread AD7six
Well, when you access /users/add - where or what is supposed to be putting 
content in the "sidebar" content block? There's nothing in the add view to 
do that; the contents of your index.ctcp file are irrelevant because your 
add.ctp file neither references it nor extends it.

AD

On Monday, 27 August 2012 16:29:37 UTC+2, Steve Babs wrote:
>
> I have created .
>
>
> Views/Users/add.ctp
> ---
> fetch('title'); ?>
> fetch('content'); ?>
>
> 
> Related actions
> 
> fetch('sidebar'); ?>
> 
> 
>
> Views/Users/index.ctp
> ---
>  $this->extend('/User/add');
> $this->assign('title', $users['User']['0']['username']);
>
> $this->start('sidebar');
> ?>
>  echo $this->Html->link('edit', array(
> 'action' => 'edit',
> $users['User']['0']['id']
> )); ?>
> 
> end(); ?>
>
> while I am accessing http://localhost/cakesite/users/add.
>
> I am getting blank space in sidebar content. anyone help me..
>  
>
> Thanks,
> Steve Babs
>
>
>

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




In CakePHP 2.x Extending Views not working.. I think the documentation for 2.0 is wrong. How to work Extending Views concept ?

2012-08-27 Thread Steve Babs
I have created .


Views/Users/add.ctp
---
fetch('title'); ?>
fetch('content'); ?>


Related actions

fetch('sidebar'); ?>



Views/Users/index.ctp
---
extend('/User/add');
$this->assign('title', $users['User']['0']['username']);

$this->start('sidebar');
?>
Html->link('edit', array(
'action' => 'edit',
$users['User']['0']['id']
)); ?>

end(); ?>

while I am accessing http://localhost/cakesite/users/add.

I am getting blank space in sidebar content. anyone help me..
 

Thanks,
Steve Babs


-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Elfinder 2.x integration with cakephp 2.x ?

2012-08-11 Thread Christopher Castro
elFinder v2.0 based module for QuickApps CMS:
https://github.com/QuickAppsCMS/QACMS-Mediamanager

2012/8/11 Piotr Beschel 

> https://github.com/TamiasSibiricus/CakePHP-ElRte-Plugin
>
> W dniu sobota, 11 sierpnia 2012 16:52:13 UTC+2 użytkownik MetZ napisał:
>
>> So.. After some messing around,, I figured out how to do it using the old
>> 1.x conncetors (probably not the best pratice, but it works).
>> If anyone want to know how I did it => http://whatswhat.no/**
>> development/framework/cakephp-**2/475-how-to-setup-and-use-**
>> elfinder-2-0-as-your-**filemanager-in-cakephp-2-x<http://whatswhat.no/development/framework/cakephp-2/475-how-to-setup-and-use-elfinder-2-0-as-your-filemanager-in-cakephp-2-x>
>>
>> Also, If anyone have some imporvements to add, let me know..
>>
>> Thanks anyway!
>>
>> -Tom
>>
>> kl. 02:07:21 UTC+2 lørdag 11. august 2012 skrev MetZ følgende:
>>>
>>> Hi all..
>>>
>>> I have been using the old Elfinder as my filemanager in my admin panel
>>> (the v.1.somthing).
>>>
>>> Now, I am trying to implement the new Elfinder 2 to my admin panel, and
>>> are experiencing some trouble.
>>>
>>> mainly, I can not seem to get the connector going. I have created an
>>> helper to load all JS to view, and tried to load the connector in my
>>> controller.
>>>
>>> Any suggestions? Or perhaps you have this working on your projects?
>>>
>>> What is the best approach here? I am not to experienced with components
>>> and such..
>>>
>>> Thanks for any help on this..
>>>
>>> Regards!
>>> -Tom
>>>
>>  --
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
>



-- 
Christopher Castro.
Analista Programador Senior PHP/MySQL
Pamplona, España
quickappscms.org
https://github.com/QuickAppsCMS/QuickApps-CMS

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Elfinder 2.x integration with cakephp 2.x ?

2012-08-11 Thread Piotr Beschel
https://github.com/TamiasSibiricus/CakePHP-ElRte-Plugin

W dniu sobota, 11 sierpnia 2012 16:52:13 UTC+2 użytkownik MetZ napisał:
>
> So.. After some messing around,, I figured out how to do it using the old 
> 1.x conncetors (probably not the best pratice, but it works).
> If anyone want to know how I did it => 
> http://whatswhat.no/development/framework/cakephp-2/475-how-to-setup-and-use-elfinder-2-0-as-your-filemanager-in-cakephp-2-x
>
> Also, If anyone have some imporvements to add, let me know.. 
>
> Thanks anyway!
>
> -Tom
>
> kl. 02:07:21 UTC+2 lørdag 11. august 2012 skrev MetZ følgende:
>>
>> Hi all..
>>
>> I have been using the old Elfinder as my filemanager in my admin panel 
>> (the v.1.somthing).
>>
>> Now, I am trying to implement the new Elfinder 2 to my admin panel, and 
>> are experiencing some trouble. 
>>
>> mainly, I can not seem to get the connector going. I have created an 
>> helper to load all JS to view, and tried to load the connector in my 
>> controller.
>>
>> Any suggestions? Or perhaps you have this working on your projects?
>>
>> What is the best approach here? I am not to experienced with components 
>> and such.. 
>>
>> Thanks for any help on this..
>>
>> Regards!
>> -Tom
>>
>

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: Elfinder 2.x integration with cakephp 2.x ?

2012-08-11 Thread MetZ
So.. After some messing around,, I figured out how to do it using the old 
1.x conncetors (probably not the best pratice, but it works).
If anyone want to know how I did it 
=> 
http://whatswhat.no/development/framework/cakephp-2/475-how-to-setup-and-use-elfinder-2-0-as-your-filemanager-in-cakephp-2-x

Also, If anyone have some imporvements to add, let me know.. 

Thanks anyway!

-Tom

kl. 02:07:21 UTC+2 lørdag 11. august 2012 skrev MetZ følgende:
>
> Hi all..
>
> I have been using the old Elfinder as my filemanager in my admin panel 
> (the v.1.somthing).
>
> Now, I am trying to implement the new Elfinder 2 to my admin panel, and 
> are experiencing some trouble. 
>
> mainly, I can not seem to get the connector going. I have created an 
> helper to load all JS to view, and tried to load the connector in my 
> controller.
>
> Any suggestions? Or perhaps you have this working on your projects?
>
> What is the best approach here? I am not to experienced with components 
> and such.. 
>
> Thanks for any help on this..
>
> Regards!
> -Tom
>

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Elfinder 2.x integration with cakephp 2.x ?

2012-08-10 Thread MetZ
Hi all..

I have been using the old Elfinder as my filemanager in my admin panel (the 
v.1.somthing).

Now, I am trying to implement the new Elfinder 2 to my admin panel, and are 
experiencing some trouble. 

mainly, I can not seem to get the connector going. I have created an helper 
to load all JS to view, and tried to load the connector in my controller.

Any suggestions? Or perhaps you have this working on your projects?

What is the best approach here? I am not to experienced with components and 
such.. 

Thanks for any help on this..

Regards!
-Tom

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: CakePHP 2.X Issues with rounting

2012-08-03 Thread lowpass
Set debug to 2. Cake sends a generic 404 when there's an error when
debug is disabled.

On Fri, Aug 3, 2012 at 3:23 PM, Almog Koren  wrote:
> Hi everyone,
> I'm upgrading a baked application from 1.3 to 2.2.1 and I'm running
> into some issue with the routes, in short its not working.
>
> I have
> Router::connect('/login', array('controller' => 'users', 'action' =>
> 'login'));
>
> Set up my controller UsersController and model of course, the
> login.ctp is at View/Users/login.ctp
>
> However I'm getting the following error
>
> Not Found
> The requested URL /app/webroot/login was not found on this server.
>
> I tried everything and have no idea why its not working anymore.
>
> --
> 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.x best practice when adding/editing content?

2012-08-03 Thread bujanga
Validation redundancy. When save is called, the data passed to it in
the first parameter is validated using CakePHP validation mechanism.
Read more on Models -> Saving your data.

Also, the validation errors are already available to the view so no
need to set them. Try bake and see what it does to get a better feel
of the cake way.

Gary

On Fri, Aug 3, 2012 at 1:43 PM, MetZ  wrote:
> Hi Mark..
>
> - Setting validation errors to view to display them in an element => You
> need to correct: Error message 1, Error message 2, Error message 3 => Need
> it ;)
> - __('some text', true) => For translation strings, not sure why I started
> to use the TRUE, but I think it is because of not beeing able to only have
> __('some text') inside the strings (Suggestion??)
>
> And for the validation Redundancy ? what exactly do you mean?
> I am validating in models => and pushing messages to the view (not using the
> error => true on my form fields, all are set to false and display the
> validation messages in element as explained before.
>
> And regarding baking.. Have never used it..  =) Any good tutorials on it? I
> need to use terminal right?
>
> I am developing on my development VPS server, not local, but have terminal
> access..
>
> Thanks for your time!
> -Tom
>
>
> kl. 20:05:19 UTC+2 fredag 3. august 2012 skrev euromark følgende:
>>
>> for starters, take out the validation redundancy
>> why setting the errors to the view? also not necessary
>> also, in 2.x your __() looks differently (arguments usually are not "true"
>> but replacement strings)
>>
>> why dont you use baking? it would display a better output than you
>> currently have
>>
>>
>>
>> Am Freitag, 3. August 2012 17:43:52 UTC+2 schrieb MetZ:
>>>
>>> Yes, I understand what you are doing :)
>>> Have a couple of those myself..
>>>
>>> But my question is (perhaps not clear enough), the best practice for a
>>> function like add and edit.
>>>
>>> I am thinking about:
>>> if ($this->request->is('post')) {
>>> $this->User->set($this->request->data);
>>> if ($this->User->validates()) {
>>> 
>>>
>>> Those things inside the function. Like,, what approach/setup would you
>>> use on cake 2.x to talk with the db and make things happen :)
>>>
>>> I am just wondering if I am doing it 100% correct, as I can not find any
>>> good tutorials on it anywhere..
>>>
>>> Here is my add function as is today, any pointers?
>>>
>>> public function admin_add() {
>>> $this->set('title_for_layout', __('Add new role',true));
>>> if ($this->request->is('post')) {
>>> $this->Role->set($this->request->data);
>>> if ($this->Role->validates()) {
>>> if ($this->Role->save($this->request->data)) {
>>> $this->Session->setFlash(__('New role created.',true),
>>> 'admin/flash/success');
>>> $this->redirect(array('action' => 'index'));
>>> } else {
>>> $this->Session->setFlash(__('Could not create role, please try
>>> again.',true), 'admin/flash/error');
>>> }
>>> } else {
>>> // Didn't validate
>>> }
>>> }
>>> $this->set('errors', $this->Role->validationErrors);
>>> }
>>>
>>> -Tom
>>>
>>>
>>>
>>> kl. 13:35:30 UTC+2 fredag 3. august 2012 skrev SoulRaven følgende:
>>>>
>>>> i use a single method, add/edit even if is user or admin, the difference
>>>> between add/edit is that on edit you have the ID set, or in parameter or in
>>>> $this->data
>>>>
>>>> admin_editpost($id = null){
>>>>if(is_null($id){
>>>>//something
>>>>}
>>>> }
>>>>
>>>> i guess you understand
>>>>
>>>> vineri, 3 august 2012, 11:41:01 UTC+3, MetZ a scris:
>>>>>
>>>>> Hi all..
>>>>>
>>>>> I am in the process of migrate one of my apps fra 1.3 to cakephp 2.x
>>>>> and I am wondering, what are the best practices for the new framework?
>>>>> AND YES, I have read the documents/book :)
>>>>>
>>>>> I am just wondering how you do it, so I can compare my work and see if
>>>>> I am heading in th

CakePHP 2.X Issues with rounting

2012-08-03 Thread Almog Koren
Hi everyone,
I'm upgrading a baked application from 1.3 to 2.2.1 and I'm running
into some issue with the routes, in short its not working.

I have
Router::connect('/login', array('controller' => 'users', 'action' =>
'login'));

Set up my controller UsersController and model of course, the
login.ctp is at View/Users/login.ctp

However I'm getting the following error

Not Found
The requested URL /app/webroot/login was not found on this server.

I tried everything and have no idea why its not working anymore.

-- 
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.x best practice when adding/editing content?

2012-08-03 Thread MetZ
Hi Mark.. 

- Setting validation errors to view to display them in an element => You 
need to correct: Error message 1, Error message 2, Error message 3 => Need 
it ;)
- __('some text', true) => For translation strings, not sure why I started 
to use the TRUE, but I think it is because of not beeing able to only have 
__('some text') inside the strings (Suggestion??)

And for the validation Redundancy ? what exactly do you mean? 
I am validating in models => and pushing messages to the view (not using 
the error => true on my form fields, all are set to false and display the 
validation messages in element as explained before.

And regarding baking.. Have never used it..  =) Any good tutorials on it? I 
need to use terminal right? 

I am developing on my development VPS server, not local, but have terminal 
access.. 

Thanks for your time!
-Tom


kl. 20:05:19 UTC+2 fredag 3. august 2012 skrev euromark følgende:
>
> for starters, take out the validation redundancy
> why setting the errors to the view? also not necessary 
> also, in 2.x your __() looks differently (arguments usually are not "true" 
> but replacement strings)
>
> why dont you use baking? it would display a better output than you 
> currently have
>
>
>
> Am Freitag, 3. August 2012 17:43:52 UTC+2 schrieb MetZ:
>>
>> Yes, I understand what you are doing :) 
>> Have a couple of those myself.. 
>>
>> But my question is (perhaps not clear enough), the best practice for a 
>> function like add and edit.
>>
>> I am thinking about:
>> if ($this->request->is('post')) {
>> $this->User->set($this->request->data);
>> if ($this->User->validates()) {
>> 
>>
>> Those things inside the function. Like,, what approach/setup would you 
>> use on cake 2.x to talk with the db and make things happen :)
>>
>> I am just wondering if I am doing it 100% correct, as I can not find any 
>> good tutorials on it anywhere..
>>
>> Here is my add function as is today, any pointers?
>>
>> public function admin_add() {
>> $this->set('title_for_layout', __('Add new role',true));
>> if ($this->request->is('post')) {
>> $this->Role->set($this->request->data);
>> if ($this->Role->validates()) {
>> if ($this->Role->save($this->request->data)) {
>> $this->Session->setFlash(__('New role created.',true), 
>> 'admin/flash/success');
>> $this->redirect(array('action' => 'index'));
>> } else {
>> $this->Session->setFlash(__('Could not create role, please try 
>> again.',true), 'admin/flash/error');
>> }
>> } else {
>> // Didn't validate
>> }
>> }
>> $this->set('errors', $this->Role->validationErrors);
>> }
>>
>> -Tom
>>
>>
>>
>> kl. 13:35:30 UTC+2 fredag 3. august 2012 skrev SoulRaven følgende:
>>>
>>> i use a single method, add/edit even if is user or admin, 
>>> the difference between add/edit is that on edit you have the ID set, or in 
>>> parameter or in $this->data
>>>
>>> admin_editpost($id = null){
>>>if(is_null($id){
>>>//something
>>>}
>>> }
>>>
>>> i guess you understand
>>>
>>> vineri, 3 august 2012, 11:41:01 UTC+3, MetZ a scris:
>>>>
>>>> Hi all..
>>>>
>>>> I am in the process of migrate one of my apps fra 1.3 to cakephp 2.x  
>>>> and I am wondering, what are the best practices for the new framework?
>>>> AND YES, I have read the documents/book :)
>>>>
>>>> I am just wondering how you do it, so I can compare my work and see if 
>>>> I am heading in the right direction with my app.
>>>>
>>>> So if anyone could give me an idea about a couple simple add/edit 
>>>> functions, and how the best practice for this, I would appreciate it :)
>>>>
>>>> like:
>>>>
>>>> admin_users_add() {
>>>> }
>>>>
>>>> admin_users_edit() {
>>>> }
>>>>
>>>> and other regular functions you might have an example for.
>>>>
>>>> Thanks all!
>>>> Awesome!
>>>>
>>>> -Tom
>>>>
>>>

-- 
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.x best practice when adding/editing content?

2012-08-03 Thread euromark
for starters, take out the validation redundancy
why setting the errors to the view? also not necessary 
also, in 2.x your __() looks differently (arguments usually are not "true" 
but replacement strings)

why dont you use baking? it would display a better output than you 
currently have



Am Freitag, 3. August 2012 17:43:52 UTC+2 schrieb MetZ:
>
> Yes, I understand what you are doing :) 
> Have a couple of those myself.. 
>
> But my question is (perhaps not clear enough), the best practice for a 
> function like add and edit.
>
> I am thinking about:
> if ($this->request->is('post')) {
> $this->User->set($this->request->data);
> if ($this->User->validates()) {
> 
>
> Those things inside the function. Like,, what approach/setup would you use 
> on cake 2.x to talk with the db and make things happen :)
>
> I am just wondering if I am doing it 100% correct, as I can not find any 
> good tutorials on it anywhere..
>
> Here is my add function as is today, any pointers?
>
> public function admin_add() {
> $this->set('title_for_layout', __('Add new role',true));
> if ($this->request->is('post')) {
> $this->Role->set($this->request->data);
> if ($this->Role->validates()) {
> if ($this->Role->save($this->request->data)) {
> $this->Session->setFlash(__('New role created.',true), 
> 'admin/flash/success');
> $this->redirect(array('action' => 'index'));
> } else {
> $this->Session->setFlash(__('Could not create role, please try 
> again.',true), 'admin/flash/error');
> }
> } else {
> // Didn't validate
> }
> }
> $this->set('errors', $this->Role->validationErrors);
> }
>
> -Tom
>
>
>
> kl. 13:35:30 UTC+2 fredag 3. august 2012 skrev SoulRaven følgende:
>>
>> i use a single method, add/edit even if is user or admin, 
>> the difference between add/edit is that on edit you have the ID set, or in 
>> parameter or in $this->data
>>
>> admin_editpost($id = null){
>>if(is_null($id){
>>//something
>>}
>> }
>>
>> i guess you understand
>>
>> vineri, 3 august 2012, 11:41:01 UTC+3, MetZ a scris:
>>>
>>> Hi all..
>>>
>>> I am in the process of migrate one of my apps fra 1.3 to cakephp 2.x  
>>> and I am wondering, what are the best practices for the new framework?
>>> AND YES, I have read the documents/book :)
>>>
>>> I am just wondering how you do it, so I can compare my work and see if I 
>>> am heading in the right direction with my app.
>>>
>>> So if anyone could give me an idea about a couple simple add/edit 
>>> functions, and how the best practice for this, I would appreciate it :)
>>>
>>> like:
>>>
>>> admin_users_add() {
>>> }
>>>
>>> admin_users_edit() {
>>> }
>>>
>>> and other regular functions you might have an example for.
>>>
>>> Thanks all!
>>> Awesome!
>>>
>>> -Tom
>>>
>>

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


  1   2   >