Re: Naming Conventions... Apply. Applys. Applies? Gobsmacked!

2014-09-09 Thread Thomas von Hassel
I would maybe call the model `Application` or `Registration` .. makes a bit 
more sense logically

The error you are seeing is because CakePHP pluralises names corretly, its 
doesn’t just put and `s` at the end


/thomas

> On 09 Sep 2014, at 09:34, MarkB  wrote:
> 
> Hi,
> 
> This is not a support request, more of a WTF?
> 
> I'm ultra new to CakePHP and I just built my first app yesterday, loosely 
> based on the Blog Tutorial. 
> 
> It is centred around the processing and management of proposal application 
> forms for lectures at a conference, so I called my model 'Apply'. I followed 
> naming conventions and so set up my ApplysController and Applys view folder 
> etc etc etc.
> 
> I naturally called my database table 'applys', but when I run my app at 
> www.example.com/applys it threw up an error message saying it couldn't find 
> the database 'applies'.
> 
> Er... wow! How did it know? Annoying, but impressive.
> 
> Regards,
> MarkB.
> 
> PS: I think it took me less time to build my app than hand code the 20 field 
> HTML form for the application. I was expecting to be spending the rest of the 
> week writing the code to validate it, process it and write to database 
> securely (something I'm not too confident about!).  As a cut'n'paste 
> programming web designer with fumbling knowledge of PHP and complete 
> cluelessness regarding OOP, I wish I had looked at using a framework years 
> ago. I think CakePHP is going to open up a whole new world to 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 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 
> .

-- 
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: Why CakePHP ?

2014-09-09 Thread Thomas von Hassel
There are still instances where rolling your own is the only good solution …

/thomas


> On 09 Sep 2014, at 03:51, #2Will  wrote:
> 
> Don't roll your own cms. 

-- 
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: VirtualFields Cakephp 3

2014-09-05 Thread Thomas von Hassel
Yes, that's the beauty of the new ORM ... Separate the table from the entity .. 

/thomas



Sent from my iPad

> On 05 Sep 2014, at 19:15, Abdelmajid el Ibrahimi  
> wrote:
> 
> so i need to make a entity class so i can join 2 fields?
> 
> Op vrijdag 5 september 2014 18:27:27 UTC+2 schreef José Lorenzo:
>> 
>> Virtual property getters go in the Entity classes not in the Table classes.
>> 
>> On Friday, September 5, 2014 3:57:30 PM UTC+2, Abdelmajid el Ibrahimi wrote:
>>> 
>>> Hello,
>>> 
>>> I used the virtualsfield function from the api but it doens't work what do 
>>> i do wrong.
>>> 
>>> namespace App\Model\Table;
>>> 
>>> use Cake\ORM\Table;
>>> use Cake\Validation\Validator;
>>> 
>>> class DocentenTable extends Table {
>>> protected function _getFullName() {
>>> return $this->_properties['voornaam'] . '  ' .
>>> $this->_properties['achternaam'];
>>> }
>>> 
>>> public function initialize(array $config) {
>>> $this->belongsToMany('Klassen');
>>> $this->addBehavior('Timestamp');
>>> }
>>> 
>>> public function validationDefault(Validator $validator) {
>>> $validator
>>> ->notEmpty('voornaam');
>>> return $validator;
>>> }
>>> }
>>> 
>>> public function add(){
>>> $this->loadModel('Docenten');
>>> $klas = $this->Klassen->newEntity($this->request->data);
>>> if($this->request->is('post')){
>>> if($this->Klassen->save($klas)){
>>> $this->Flash->success(__('De klas is opgeslagen.'));
>>> return $this->redirect(['action' => 'index']);
>>> }
>>> $this->Flash->error(__('Het toevoegen is niet gelukt.'));
>>> }
>>> $docenten = $this->Docenten->find('list',[
>>> 'idField' => 
>>> 'docent_id',
>>> 'valueField' => 
>>> 'full_name'
>>> ]);
>>> $this->set('docenten',$docenten);
>>> $this->set('klas', $klas);
>>> }
>>> 
>>> But the full_name field is empty. 
>>> 
> 
> -- 
> 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.

-- 
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: Error menu.ctp

2014-09-03 Thread Thomas von Hassel
Your IDE is even marking the error with a red line :)


> On 03 Sep 2014, at 13:24, Bprd Codin  wrote:
> 
> Hello,
> 
> Problem with my menu.ctp
> 
> error message 
> 
> Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting ')' in 
> /app/View/Elements/menu.ctp on line 1
> 
> 
> 
> my menu.ctp
> 
> requestAction(array 
> ('controller'=>'pages','action'=>'menu'array 
> ('return')));?>
> 
> and ma controller
> 
> 
>  array('Post');  function menu(){ $pages = $this-> 
> Post->find('all',array('conditions' => 
> array('type'=>'page','online'=>1) )); return $pages;
>}  function show($id = null,$slug = null){   }
> }
> 
> if you have a idéa thank you
> 
> -- 
> 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 
> .

-- 
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: BelongsToMany model

2014-09-01 Thread Thomas von Hassel
https://gist.github.com

On 01 Sep 2014, at 13:08, Abdelmajid el Ibrahimi  wrote:

> What is a gist?
> 
> Met vriendelijke groet,
> A. el Ibrahimi
> 
> Op 1 sep. 2014 13:04 schreef "Thomas von Hassel" :
> maybe you should post a gist with your code ..
> 
> 
> On 01 Sep 2014, at 13:02, Abdelmajid el Ibrahimi  
> wrote:
> 
>> I know what you mean but than i need to translate all my fields to show it 
>> to the users. Now i dont need to do anything the system generates the field 
>> and table names in my view in dutch because that is how my database model is 
>> build. Well it is solved now and i get what the problem is. Because the 
>> verzorgers table is not a problem and the key is searched for is verzorger. 
>> Because in english the s is for plural so he removes the s and knows that it 
>> is the singular form. Where can I find the core orm file in the system.
>> 
>> Met vriendelijke groet,
>> A. el Ibrahimi
>> 
>> Op 1 sep. 2014 12:56 schreef "Thomas von Hassel" :
>> Im not talking about what the users see, only what the models are called 
>> internally
>> 
>> /thomas
>> 
>> 
>> On 01 Sep 2014, at 12:55, Abdelmajid el Ibrahimi  
>> wrote:
>> 
>>> I have used it but it still didnt solve the problem. And to make everything 
>>> in english is double work for me because then i will need to translate 
>>> everything. For a app that is only needed in holland.
>>> 
>>> Met vriendelijke groet,
>>> A. el Ibrahimi
>>> 
>>> Op 1 sep. 2014 09:14 schreef "Thomas von Hassel" :
>>> If you use $this->primaryKey($myKey) in your Table model, thats not in the 
>>> core file and a perfectly valid to do.
>>> 
>>> But, i would mention that when designing your app, it's better to keep 
>>> everything (model names etc) in english so the inflector knows how 
>>> everything is named.
>>> 
>>> /thomas
>>> 
>>> 
>>> On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi  
>>> wrote:
>>> 
>>>> i just changed the key to leerlingen_id and it works. Just a workaround 
>>>> but i dont want to screw with the core files. CakePHP is supposed to be 
>>>> easy to use that means that if i follow the tutorial it should do what is 
>>>> says.
>>>> 
>>>> Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:
>>>> You also have control over what is the foreignKey to use when creating the 
>>>> association. Refer the the ORM docs to customize what the query builder is 
>>>> doing.
>>>> 
>>>> On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi wrote:
>>>> But even if i take that out it still says the same.
>>>> 
>>>> Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:
>>>> There is no "public $primaryKey" in CakePHP 3.0
>>>> 
>>>> You may use $this->primaryKey($myKey) inside the initialize() method
>>>> 
>>>> On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi wrote:
>>>> I have made two tables leerlingen and verzorgers. Because these have a 
>>>> many to many relation i added a table leerlingen_verzorgers.
>>>> I have added 3 model tables:
>>>> 
>>>> class VerzorgersTable extends Table {
>>>> public $primaryKey = 'verzorger_id';
>>>> 
>>>> public function initialize(array $config) {
>>>> $this->belongsToMany('Leerlingen', 
>>>> ['through' => 'LeerlingenVerzorgers',]);
>>>> $this->addBehavior('Timestamp');
>>>> }
>>>> }
>>>> 
>>>> class LeerlingenTable extends Table {
>>>> public $primaryKey = 'leerling_id';
>>>> 
>>>> public function initialize(array $config) {
>>>> $this->belongsToMany('Verzorgers', 
>>>> ['through' => 'LeerlingenVerzorgers',]);
>>>> $this->addBehavior('Timestamp');
>>>> }
>>>> }
>>>> 
>>>> class LeerlingenVerzorgersTable extends Table {
>>>> public function initialize(array $config) {
>>>> $this->belongsTo('Leerlingen');
>>>> $this->belongsTo('Verzorgers');
>>>> }
>&g

Re: BelongsToMany model

2014-09-01 Thread Thomas von Hassel
maybe you should post a gist with your code ..


On 01 Sep 2014, at 13:02, Abdelmajid el Ibrahimi  wrote:

> I know what you mean but than i need to translate all my fields to show it to 
> the users. Now i dont need to do anything the system generates the field and 
> table names in my view in dutch because that is how my database model is 
> build. Well it is solved now and i get what the problem is. Because the 
> verzorgers table is not a problem and the key is searched for is verzorger. 
> Because in english the s is for plural so he removes the s and knows that it 
> is the singular form. Where can I find the core orm file in the system.
> 
> Met vriendelijke groet,
> A. el Ibrahimi
> 
> Op 1 sep. 2014 12:56 schreef "Thomas von Hassel" :
> Im not talking about what the users see, only what the models are called 
> internally
> 
> /thomas
> 
> 
> On 01 Sep 2014, at 12:55, Abdelmajid el Ibrahimi  
> wrote:
> 
>> I have used it but it still didnt solve the problem. And to make everything 
>> in english is double work for me because then i will need to translate 
>> everything. For a app that is only needed in holland.
>> 
>> Met vriendelijke groet,
>> A. el Ibrahimi
>> 
>> Op 1 sep. 2014 09:14 schreef "Thomas von Hassel" :
>> If you use $this->primaryKey($myKey) in your Table model, thats not in the 
>> core file and a perfectly valid to do.
>> 
>> But, i would mention that when designing your app, it's better to keep 
>> everything (model names etc) in english so the inflector knows how 
>> everything is named.
>> 
>> /thomas
>> 
>> 
>> On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi  
>> wrote:
>> 
>>> i just changed the key to leerlingen_id and it works. Just a workaround but 
>>> i dont want to screw with the core files. CakePHP is supposed to be easy to 
>>> use that means that if i follow the tutorial it should do what is says.
>>> 
>>> Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:
>>> You also have control over what is the foreignKey to use when creating the 
>>> association. Refer the the ORM docs to customize what the query builder is 
>>> doing.
>>> 
>>> On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi wrote:
>>> But even if i take that out it still says the same.
>>> 
>>> Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:
>>> There is no "public $primaryKey" in CakePHP 3.0
>>> 
>>> You may use $this->primaryKey($myKey) inside the initialize() method
>>> 
>>> On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi wrote:
>>> I have made two tables leerlingen and verzorgers. Because these have a many 
>>> to many relation i added a table leerlingen_verzorgers.
>>> I have added 3 model tables:
>>> 
>>> class VerzorgersTable extends Table {
>>> public $primaryKey = 'verzorger_id';
>>> 
>>> public function initialize(array $config) {
>>> $this->belongsToMany('Leerlingen', 
>>> ['through' => 'LeerlingenVerzorgers',]);
>>> $this->addBehavior('Timestamp');
>>> }
>>> }
>>> 
>>> class LeerlingenTable extends Table {
>>> public $primaryKey = 'leerling_id';
>>> 
>>> public function initialize(array $config) {
>>> $this->belongsToMany('Verzorgers', 
>>> ['through' => 'LeerlingenVerzorgers',]);
>>> $this->addBehavior('Timestamp');
>>> }
>>> }
>>> 
>>> class LeerlingenVerzorgersTable extends Table {
>>> public function initialize(array $config) {
>>> $this->belongsTo('Leerlingen');
>>> $this->belongsTo('Verzorgers');
>>> }
>>> }
>>> 
>>> Now when i want to retrieve a verzorger with all the leerlingen i get an 
>>> error that he doesn't know the leerlingen_id this is right because it is 
>>> leerling_id. But with the verzorgers table he does use the right id and 
>>> asks for the verzorger_id.
>>> 
>>> My relation table looks like this:
>>> leerlingen_verzorgers
>>> --
>>> id
>>> leerling_id
>>> verzorgers_id
>>> jaar
>>> 
>>> The generated query looks like this:
>>> 
&

Re: BelongsToMany model

2014-09-01 Thread Thomas von Hassel
Im not talking about what the users see, only what the models are called 
internally

/thomas


On 01 Sep 2014, at 12:55, Abdelmajid el Ibrahimi  wrote:

> I have used it but it still didnt solve the problem. And to make everything 
> in english is double work for me because then i will need to translate 
> everything. For a app that is only needed in holland.
> 
> Met vriendelijke groet,
> A. el Ibrahimi
> 
> Op 1 sep. 2014 09:14 schreef "Thomas von Hassel" :
> If you use $this->primaryKey($myKey) in your Table model, thats not in the 
> core file and a perfectly valid to do.
> 
> But, i would mention that when designing your app, it's better to keep 
> everything (model names etc) in english so the inflector knows how everything 
> is named.
> 
> /thomas
> 
> 
> On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi  
> wrote:
> 
>> i just changed the key to leerlingen_id and it works. Just a workaround but 
>> i dont want to screw with the core files. CakePHP is supposed to be easy to 
>> use that means that if i follow the tutorial it should do what is says.
>> 
>> Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:
>> You also have control over what is the foreignKey to use when creating the 
>> association. Refer the the ORM docs to customize what the query builder is 
>> doing.
>> 
>> On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi wrote:
>> But even if i take that out it still says the same.
>> 
>> Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:
>> There is no "public $primaryKey" in CakePHP 3.0
>> 
>> You may use $this->primaryKey($myKey) inside the initialize() method
>> 
>> On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi wrote:
>> I have made two tables leerlingen and verzorgers. Because these have a many 
>> to many relation i added a table leerlingen_verzorgers.
>> I have added 3 model tables:
>> 
>> class VerzorgersTable extends Table {
>> public $primaryKey = 'verzorger_id';
>> 
>> public function initialize(array $config) {
>> $this->belongsToMany('Leerlingen', 
>> ['through' => 'LeerlingenVerzorgers',]);
>> $this->addBehavior('Timestamp');
>> }
>> }
>> 
>> class LeerlingenTable extends Table {
>> public $primaryKey = 'leerling_id';
>> 
>> public function initialize(array $config) {
>> $this->belongsToMany('Verzorgers', 
>> ['through' => 'LeerlingenVerzorgers',]);
>> $this->addBehavior('Timestamp');
>> }
>> }
>> 
>> class LeerlingenVerzorgersTable extends Table {
>> public function initialize(array $config) {
>> $this->belongsTo('Leerlingen');
>> $this->belongsTo('Verzorgers');
>> }
>> }
>> 
>> Now when i want to retrieve a verzorger with all the leerlingen i get an 
>> error that he doesn't know the leerlingen_id this is right because it is 
>> leerling_id. But with the verzorgers table he does use the right id and asks 
>> for the verzorger_id.
>> 
>> My relation table looks like this:
>> leerlingen_verzorgers
>> --
>> id
>> leerling_id
>> verzorgers_id
>> jaar
>> 
>> The generated query looks like this:
>> 
>> 'SELECT Leerlingen.leerling_id AS `Leerlingen__leerling_id`, 
>> Leerlingen.voornaam AS `Leerlingen__voornaam`, Leerlingen.achternaam AS 
>> `Leerlingen__achternaam`, Leerlingen.geboortedatum AS 
>> `Leerlingen__geboortedatum`, Leerlingen.geslacht AS `Leerlingen__geslacht`, 
>> Leerlingen.email AS `Leerlingen__email`, Leerlingen.opmerking AS 
>> `Leerlingen__opmerking`, LeerlingenVerzorgers.id AS 
>> `LeerlingenVerzorgers__id`, LeerlingenVerzorgers.leerling_id AS 
>> `LeerlingenVerzorgers__leerling_id`, LeerlingenVerzorgers.verzorger_id AS 
>> `LeerlingenVerzorgers__verzorger_id`, LeerlingenVerzorgers.jaar AS 
>> `LeerlingenVerzorgers__jaar` FROM leerlingen AS Leerlingen INNER JOIN 
>> leerlingen_verzorgers LeerlingenVerzorgers ON 
>> (LeerlingenVerzorgers.verzorger_id IN (:c0) AND Leerlingen.leerling_id = 
>> (LeerlingenVerzorgers.leerlingen_id))
>> 
>> 
>> so first he uses the right leerling_id but at the end he uses leerlingen_id. 
>> Anyone knows what i did wrong?
>> 
>> 
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>

Re: BelongsToMany model

2014-09-01 Thread Thomas von Hassel
If you use $this->primaryKey($myKey) in your Table model, thats not in the core 
file and a perfectly valid to do.

But, i would mention that when designing your app, it's better to keep 
everything (model names etc) in english so the inflector knows how everything 
is named.

/thomas


On 01 Sep 2014, at 01:34, Abdelmajid el Ibrahimi  wrote:

> i just changed the key to leerlingen_id and it works. Just a workaround but i 
> dont want to screw with the core files. CakePHP is supposed to be easy to use 
> that means that if i follow the tutorial it should do what is says.
> 
> Op zondag 31 augustus 2014 21:35:59 UTC+2 schreef José Lorenzo:
> You also have control over what is the foreignKey to use when creating the 
> association. Refer the the ORM docs to customize what the query builder is 
> doing.
> 
> On Sunday, August 31, 2014 7:30:36 PM UTC+2, Abdelmajid el Ibrahimi wrote:
> But even if i take that out it still says the same.
> 
> Op zondag 31 augustus 2014 11:45:25 UTC+2 schreef José Lorenzo:
> There is no "public $primaryKey" in CakePHP 3.0
> 
> You may use $this->primaryKey($myKey) inside the initialize() method
> 
> On Sunday, August 31, 2014 3:54:56 AM UTC+2, Abdelmajid el Ibrahimi wrote:
> I have made two tables leerlingen and verzorgers. Because these have a many 
> to many relation i added a table leerlingen_verzorgers.
> I have added 3 model tables:
> 
> class VerzorgersTable extends Table {
> public $primaryKey = 'verzorger_id';
> 
> public function initialize(array $config) {
> $this->belongsToMany('Leerlingen', 
> ['through' => 'LeerlingenVerzorgers',]);
> $this->addBehavior('Timestamp');
> }
> }
> 
> class LeerlingenTable extends Table {
> public $primaryKey = 'leerling_id';
> 
> public function initialize(array $config) {
> $this->belongsToMany('Verzorgers', 
> ['through' => 'LeerlingenVerzorgers',]);
> $this->addBehavior('Timestamp');
> }
> }
> 
> class LeerlingenVerzorgersTable extends Table {
> public function initialize(array $config) {
> $this->belongsTo('Leerlingen');
> $this->belongsTo('Verzorgers');
> }
> }
> 
> Now when i want to retrieve a verzorger with all the leerlingen i get an 
> error that he doesn't know the leerlingen_id this is right because it is 
> leerling_id. But with the verzorgers table he does use the right id and asks 
> for the verzorger_id.
> 
> My relation table looks like this:
> leerlingen_verzorgers
> --
> id
> leerling_id
> verzorgers_id
> jaar
> 
> The generated query looks like this:
> 
> 'SELECT Leerlingen.leerling_id AS `Leerlingen__leerling_id`, 
> Leerlingen.voornaam AS `Leerlingen__voornaam`, Leerlingen.achternaam AS 
> `Leerlingen__achternaam`, Leerlingen.geboortedatum AS 
> `Leerlingen__geboortedatum`, Leerlingen.geslacht AS `Leerlingen__geslacht`, 
> Leerlingen.email AS `Leerlingen__email`, Leerlingen.opmerking AS 
> `Leerlingen__opmerking`, LeerlingenVerzorgers.id AS 
> `LeerlingenVerzorgers__id`, LeerlingenVerzorgers.leerling_id AS 
> `LeerlingenVerzorgers__leerling_id`, LeerlingenVerzorgers.verzorger_id AS 
> `LeerlingenVerzorgers__verzorger_id`, LeerlingenVerzorgers.jaar AS 
> `LeerlingenVerzorgers__jaar` FROM leerlingen AS Leerlingen INNER JOIN 
> leerlingen_verzorgers LeerlingenVerzorgers ON 
> (LeerlingenVerzorgers.verzorger_id IN (:c0) AND Leerlingen.leerling_id = 
> (LeerlingenVerzorgers.leerlingen_id))
> 
> so first he uses the right leerling_id but at the end he uses leerlingen_id. 
> Anyone knows what i did wrong?
> 
> 
> -- 
> 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.

-- 
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: find all on complex model

2014-08-31 Thread Thomas von Hassel
There are plenty of complete examples here:

http://book.cakephp.org/2.0/en/core-libraries/behaviors/containable.html#containing-deeper-associations




On 31 Aug 2014, at 10:06, ajt  wrote:

> I tried this and as expected it doesnt work and it cant work because HABTM is 
> a different case.
> THis has to be the hardest framework to just get data to display from tables. 
> There just is no docs for a complete example.
> 
>   $student=  $this->Lesson->find('all', array('contain' => array( 'Student' , 
> 'Tutor')));
> 
> -- 
> 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.

-- 
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: find all on complex model

2014-08-30 Thread Thomas von Hassel
$this->Lesson->find('all', array(
'contain' => array(
'Student' , 'Tutor')));

given that your models are named as the conventions suggest

You also need to attach the Containable Behaviour to your model

/thomas


On 30 Aug 2014, at 16:41, ajt  wrote:

> I am having all sorts of problems and the docs for this is just awful. I have 
> looked into simply getting data from the linked tables and after HOURS no one 
> can give me a working example. I can only assume that this is hard to do or 
> maybe it cant be done?
> 
> 'The relationships are
> Lesson (main table where fk is linked to Tutor BelongsTo)
> LessonsStudents (the  created table with student_id,lesson_id)
> Students (HASTBM student)
> Tutors (linked to Lessons)
> 
> How can I get data from Lesson, Student and Tutor table in a find? I just 
> need an example and not a link to the docs as the docs dont have a complete 
> controller/view example of 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 http://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 http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: TranslateBehavior clarification

2014-08-28 Thread Thomas von Hassel
Hey

Sorry to bump this, but is there a verdict from the powers that be ? ;)

/thomas


On 27 Aug 2014, at 16:53, José Lorenzo  wrote:

> What happens if you try to select a few fields?
> 
> On Wednesday, August 27, 2014 3:05:28 PM UTC+2, Thomas von Hassel wrote:
> Hey 
> 
> In 2.x when you used translate, the table should not contain the field(s) 
> that you were translating. 
> 
> In 3.x it's not clear if this is still the case or if the table should have 
> the fields that you are trying to translate. For instance, when the table has 
> a translated field `name`, using find('list')->select(['id', 'name']) fails, 
> but setting the locale and doing a find('all') correctly output the 
> translated fields. 
> 
> 
> 
> /thomas 
> 
> 
> 
> -- 
> 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.

-- 
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: Get controller name on layout file - CakePHP3

2014-08-28 Thread Thomas von Hassel
you have to look in `$this->request` instead


On 28 Aug 2014, at 14:35, Jipson Thomas  wrote:

> Hi,
> In my Cakephp 3 project on the layout file, I want to set menu classes based 
> on the current controller name. After a search I tried to get it through the 
> following command on my layout.ctp file
> params['controller']; ?>
> 
> But it throughs me an error as following
> Error: paramsHelper could not be found.   
> Error: Create the class paramsHelper below in file: 
> src/View/Helper/paramsHelper.php
> 
> Does anyone know any fix for this?
> 
> Regards,
> Jipson
> 
> 
> -- 
> 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.

-- 
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: TranslateBehavior clarification

2014-08-27 Thread Thomas von Hassel
If i select fields in `select()` and the translated field is not present in the 
table i get an sql error complaining about the missing field

if i don't use select, all the translated fields are present in the resulting 
entity



On 27 Aug 2014, at 16:53, José Lorenzo  wrote:

> What happens if you try to select a few fields?
> 
> On Wednesday, August 27, 2014 3:05:28 PM UTC+2, Thomas von Hassel wrote:
> Hey 
> 
> In 2.x when you used translate, the table should not contain the field(s) 
> that you were translating. 
> 
> In 3.x it's not clear if this is still the case or if the table should have 
> the fields that you are trying to translate. For instance, when the table has 
> a translated field `name`, using find('list')->select(['id', 'name']) fails, 
> but setting the locale and doing a find('all') correctly output the 
> translated fields. 
> 
> 
> 
> /thomas 
> 
> 
> 
> -- 
> 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.

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


TranslateBehavior clarification

2014-08-27 Thread Thomas von Hassel
Hey

In 2.x when you used translate, the table should not contain the field(s) that 
you were translating.

In 3.x it's not clear if this is still the case or if the table should have the 
fields that you are trying to translate. For instance, when the table has a 
translated field `name`, using find('list')->select(['id', 'name']) fails, but 
setting the locale and doing a find('all') correctly output the translated 
fields.



/thomas


-- 
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 3.0.0-beta1 released

2014-08-25 Thread Thomas von Hassel
same here .. i have been building stuff with the hope/expectation that we would 
hit beta right around now, so i'm probably 3 months ahead here ;)

/thomas


On 25 Aug 2014, at 11:25, Dr. Tarique Sani  wrote:

> I make a distinction between experimenting and building ;-)
> 
> T
> 
> 
> On Mon, Aug 25, 2014 at 11:39 AM, Thomas von Hassel  wrote:
> i have been building stuff for 3 months now ;)
> 
> 
> On 25 Aug 2014, at 05:17, Dr. Tarique Sani  wrote:
> 
>> we start building stuff now?
> 
> 
> -- 
> 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.
> 
> 
> 
> -- 
> =
> Hire a CakePHP dev team : http://sanisoft.com
> =
> 
> -- 
> 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.

-- 
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 3.0.0-beta1 released

2014-08-24 Thread Thomas von Hassel
i have been building stuff for 3 months now ;)


On 25 Aug 2014, at 05:17, Dr. Tarique Sani  wrote:

> we start building stuff now?

-- 
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: 3.x - Custom Route Class, match()

2014-08-23 Thread Thomas von Hassel
I have a mysql table with "static" routes, generated from various tree-like 
models. (nodes, categories etc.) and would like to be able to output reverse 
routes from standard Html->link calls.

I could just register routes with the various possible permuations (model, 
controller, action) and feed them into the same RouteClass..

/thomas


On 23 Aug 2014, at 20:44, José Lorenzo  wrote:

> What are you exactly trying to do?
> 
> On Saturday, August 23, 2014 8:31:27 PM UTC+2, Thomas von Hassel wrote:
> Hi 
> 
> I have a router defined like this: 
> 
> Router::scope('/', function ($routes) { 
>$routes->connect('/*',[], ['routeClass' => 'MyPlugin.MyRouteClass']); 
> } 
> 
> And this works fine for parsing incoming routes, but reverse routing never 
> reaches my match() method because the defaults are then set to 
> 
> [ 'action' => 'index', 'plugin' => null ] 
> 
> How do i construct a connect that will match something like 
> Router::url(['controller' => 'somearbitratycontroller', 'action' => 'view', 
> 2]); 
> 
> /thomas 
> 
> 
> 
> 
> -- 
> 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.

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


3.x - Custom Route Class, match()

2014-08-23 Thread Thomas von Hassel
Hi

I have a router defined like this:

Router::scope('/', function ($routes) {
   $routes->connect('/*',[], ['routeClass' => 'MyPlugin.MyRouteClass']);
}

And this works fine for parsing incoming routes, but reverse routing never 
reaches my match() method because the defaults are then set to

[ 'action' => 'index', 'plugin' => null ]

How do i construct a connect that will match something like 
Router::url(['controller' => 'somearbitratycontroller', 'action' => 'view', 
2]); 

/thomas



-- 
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: Baking into an admin sub folder or segmenting admin MVC from public website

2014-08-22 Thread Thomas von Hassel
Actually, in 3.x this is exactly what is going to happen. Admin controllers 
will live in an Controller\Admin namespace

/thomas



On 22 Aug 2014, at 10:39, Stephen S  wrote:

> Hey Paul
> 
> I can understand your reasoning of wanting to bake controllers in an admin 
> subfolder but I think that this is just going to fight against Cake and make 
> life more difficult for you.
> 
> You can set up an admin prefix which means when you access 
> www.site.com/admin/users/index it will search for the default 
> UsersController.php file and the admin_index() method within it. 
> http://book.cakephp.org/2.0/en/development/routing.html#prefix-routing
> 
> /app/Controllers/UsersController.php
> /app/Views/Users/admin_index.ctp
> 
> If you'd like to bake these admin methods and views when you bake your 
> regular methods you can do this by altering the bake templates (See 
> http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html#modify-default-html-produced-by-baked-templates)
> 
> 
> 
> 
> 
> 
> On 21 August 2014 00:35, Paul Drage  wrote:
> Hi there!
> 
> I've a background from CodeIgniter and am trying out CakePHP.
> So far I'm pretty impressed with how Cake can be scaled and how quick it is 
> to get up and running - even on a strange remote DB setup things seem to be 
> lightning fast.
> 
> I have created tables in a database, something like 27-28 tables with 
> interlinking _id fields, I have run # cake bake models / controllers / views 
> - and looked at the resulting framework in a web browser, all of the links 
> seem to work and it's quick to add data - GREAT!
> 
> Now - Rather than creating 27-28 models and controllers and views manually 
> cake has generated it all for me and put it into the relevant folders like 
> /app/views
> This is a bit hard to explain but I would of liked to of baked my CRUD stuff 
> into a sub folder within each type, so for example:
> 
> app/controllers/ADMIN/___all_controllers baked
> app/models/ADMIN/__
> app/views/ADMIN/__
> 
> Then I would like to implement ACL/Auth rules to lock down all of the 
> controllers that were baked into the admin folder/section based on something 
> like admin_level (int) in db table.
> 
> This would then facilitate me in being able to use the root to build out the 
> 'public' facing website which will sit on top of everything else - right now 
> (i'm not sure if this is even possible?!) it's just a mess.. my views folder 
> has probably 40-50 sub-folders with files in each - there isn't a nice folder 
> structure, as soon as i come to add more controllers for the front-end public 
> facing data and website i fear it will become unmanagable.
> 
> Please could you provide any assistance? I've looked at routing - I 
> understand the concept, but I don't think that will solve the file management 
> aspect here.
> If I am unable to solve the file management side, i.e all files must be in 
> subfolders within /views/ then perhaps you could suggest a way that I may be 
> able to continue using the awesome function 'cake bake' to generate the CRUD 
> views/models/controllers but with a view to me being able to specify that 
> everything baked is to be 'ADMIN' functions - i have no problem hand coding 
> the rest of the controllers and models for the public site - but the sheer 
> amount of tables dictates that I'd be crazy to try and build every one of 
> them by hand when cake bake is doing a great job for me already?
> 
> I've looked through the blog tutorial and so on but I've been unable to find 
> any specific answers to my queries - I have been working with PHP since 2004 
> so have plenty of hands on experience but Cake might still be a little alien!
> 
> Thanks for any ideas or input you may have, it will be truly appreciated 
> (right now the comfortable thing to do would be to go back to CodeIgniter 
> which I'm trying my best to resist!)
> Cheers
> Paul
> 
> -- 
> 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 

Re: CakePHP 3 New ORM

2014-08-19 Thread Thomas von Hassel
In the last example each person entity will have a person_set property when you 
loop it

Also ->toArray() on a query is a good way to see what the result set contains

/Thomas



Sent from my iPhone

> On 19/08/2014, at 15.31, Dave Edwards  wrote:
> 
> Thanks for the replies,
> 
> Having thought about it, I think that main thing that currently confuses me 
> is not the construction of the queries, but the process of getting to the 
> data once the object has been returned. Previously I could just drop a 
> pr($result) into the Controller or view and immediately see what data I had. 
> If I try that now it comes up a structure where the data is buried in things 
> like [_properties:protected] ?
> 
> Also the new ORM involves looping through the object (on some occasions, but 
> not others) to get the data out using something like 
> 
> foreach ($query->all() as $person)
> 
> ??
> 
> There's also the issue of getting at the data in the view (or templates as 
> they are now called).
> 
> If for example I had a one to many from Person to PersonSets and I used the 
> following
> 
> $persons = $this->Persons->find('all')->contain('Personsets')
> 
> How do I get at both the person data and the associated sets. In CakePHP 2 I 
> could loop through the associated data using something like
> 
>  foreach($persons['PersonSets'] as $set)
> 
> How would this be done?
> 
> I'm sorry if there are basic questions, but there is lot of example in your 
> documentation on the new ORM, a lot on Controllers etc etc, but not many end 
> to end examples (apart from the blog).
> 
> Dave
> 
>> On Tuesday, 19 August 2014 10:16:42 UTC+1, José Lorenzo wrote:
>> My answers are inline:
>> 
>>> On Monday, August 18, 2014 4:59:42 PM UTC+2, Dave Edwards wrote:
>>> Hi,
>>> 
>>> I'm having trouble getting my head around the new ways of working with the 
>>> new ORM in CakePHP 3.
>> 
>> That's normal, given that you are a longtime CakePHP user, hopefully it will 
>> make sense to you very fast :) 
>>> 
>>> I understand that an object is now returned instead of an array, but I find 
>>> the amount of new Documentation to explain the new methods of working with 
>>> Models almost overwhelming. Whilst it is certainly well written, it seems 
>>> to be pitched at a different (higher level) of user to previous versions. 
>>> To give an example of this, the first paragraph explaining what Models are, 
>>> it says 'interactions and evolution of the information workflow in your 
>>> domain of work.' Sorry, but what does this really mean, in plain English?
>> 
>> If you have been using CakePHP for some time, then I guess you don;t need 
>> models to be explained to you. But in plain english,  it is where the core 
>> of your application exists, when any user interaction is taken away. That 
>> is, all data processing, updating and the rules to follow to keep your data 
>> sane.
>> 
>>> 
>>> The documents also seem to switch backwards and forwards between different 
>>> methods, such as the section called 'Find returns a query object' where it 
>>> shows this method to return articles
>>> 
>>> $articles = TableRegistry::get('Articles');
>>> $query = $articles->find();
>>> $query->where(['author_id' => 1])->order(['title' => 'DESC']);
>>> then it shows you this a few lines later
>>> 
>>> $article = $this->Articles->find('all', [
>>> 'conditions' => ['author_id' => 1]
>>> ])->first();
>>> which is much more like CakePHP 2. What's the difference, which should I be 
>>> using and which is better. Do they give the same results? How do I get my 
>>> data out of the objects?
>> 
>> Both ways are exactly the same, we offered the 2 alternatives to make users 
>> coming form 2.x feel more at home. I would say the first form is preferred 
>> as it is more flexible.
>>  
>>> 
>>> As a user of CakePHP 1.xx and 2.xx for the past 6 years, I am obviously 
>>> comfortable using those versions of the framework, and the appeal of 
>>> CakePHP to me has always been that it could be easily used by novices and 
>>> professionals alike. I know that part of the complaint regarding previous 
>>> versions of CakePHP was that queries returned data arrays, and not objects, 
>>> and I'm sure that the changes to the Model layer will attract more 
>>> professional users, but I hope that this isn't at the expense of those 
>>> choosing a framework for the first time, or cutting their teeth on PHP.
>> 
>> I don't think it is, on the contrary, I feel that the ORM is much more 
>> approachable and understandable that its previous incarnations.
>>  
>>> 
>>> Now before Mark, Mark and Jose etc. jump on me, I am not being critical of 
>>> their fantastic efforts to modernise the framework, or the reasons for 
>>> doing so. I am also not adverse to change, especially if it is for the 
>>> better, which is why I am attempting to get to know this new version, even 
>>> though it is still in Alpha, and yes I have read the documentation, but the 
>>> more I read the more confused I get.
>>>

Re: CakePHP 3 New ORM

2014-08-19 Thread Thomas von Hassel
Exactly, but if you have been using 2.x for a long time, you have to "unlearn" 
all the quirks. Once you do that things are much more intuitive in the new ORM

/thomas


On 19 Aug 2014, at 11:16, José Lorenzo  wrote:

> I don't think it is, on the contrary, I feel that the ORM is much more 
> approachable and understandable that its previous incarnations.
> 

-- 
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: map/reduce with translated models

2014-08-19 Thread Thomas von Hassel
Running though a findPath result set to generate breadcrumbs

/thomas


On 19 Aug 2014, at 09:52, José Lorenzo  wrote:

> You are right... MapReduce will run before any formatters, so I would suggest 
> using a formatter instead. In general you can achieve the same with both.
> 
> What do you need to do?
> 
> On Tuesday, August 19, 2014 12:34:24 AM UTC+2, Thomas von Hassel wrote:
> ah, findList uses format results and not map() reduce()
> 
> the entity i get in map() only has an array of _i18n entities not the 
> _translations array set
> 
> On 19 Aug 2014, at 00:27, José Lorenzo  wrote:
> 
>> This tests shows that it is possible 
>> https://github.com/cakephp/cakephp/blob/3.0/tests/TestCase/Model/Behavior/TranslateBehaviorTest.php#L132
>> 
>> What problems are you having?
>> 
>> On Monday, August 18, 2014 10:15:16 PM UTC+2, Thomas von Hassel wrote:
>> When doing map/reduce on a model with translated fields, there is not good 
>> way to get the translated content in the map/reduce fase except to look in 
>> the `_i18n` association ? 
>> 
>> /thomas 
>> 
>> 
>> -- 
>> 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.
> 
> 
> -- 
> 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.

-- 
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: map/reduce with translated models

2014-08-18 Thread Thomas von Hassel
ah, findList uses format results and not map() reduce()

the entity i get in map() only has an array of _i18n entities not the 
_translations array set

On 19 Aug 2014, at 00:27, José Lorenzo  wrote:

> This tests shows that it is possible 
> https://github.com/cakephp/cakephp/blob/3.0/tests/TestCase/Model/Behavior/TranslateBehaviorTest.php#L132
> 
> What problems are you having?
> 
> On Monday, August 18, 2014 10:15:16 PM UTC+2, Thomas von Hassel wrote:
> When doing map/reduce on a model with translated fields, there is not good 
> way to get the translated content in the map/reduce fase except to look in 
> the `_i18n` association ? 
> 
> /thomas 
> 
> 
> -- 
> 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.

-- 
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 3 New ORM

2014-08-18 Thread Thomas von Hassel
In the first example you could call $query->toArray() to get an array of 
article objects back.

The beauty is when you can start chaining stuff together, for instance custom 
find methods

/thomas


On 18 Aug 2014, at 16:59, Dave Edwards  wrote:

> Hi,
> 
> I'm having trouble getting my head around the new ways of working with the 
> new ORM in CakePHP 3.
> 
> I understand that an object is now returned instead of an array, but I find 
> the amount of new Documentation to explain the new methods of working with 
> Models almost overwhelming. Whilst it is certainly well written, it seems to 
> be pitched at a different (higher level) of user to previous versions. To 
> give an example of this, the first paragraph explaining what Models are, it 
> says 'interactions and evolution of the information workflow in your domain 
> of work.' Sorry, but what does this really mean, in plain English?
> 
> The documents also seem to switch backwards and forwards between different 
> methods, such as the section called 'Find returns a query object' where it 
> shows this method to return articles
> 
> $articles = TableRegistry::get('Articles');
> $query = $articles->find();
> $query->where(['author_id' => 1])->order(['title' => 'DESC']);
> then it shows you this a few lines later
> 
> $article = $this->Articles->find('all', [
> 'conditions' => ['author_id' => 1]
> ])->first();
> which is much more like CakePHP 2. What's the difference, which should I be 
> using and which is better. Do they give the same results? How do I get my 
> data out of the objects?
> 
> As a user of CakePHP 1.xx and 2.xx for the past 6 years, I am obviously 
> comfortable using those versions of the framework, and the appeal of CakePHP 
> to me has always been that it could be easily used by novices and 
> professionals alike. I know that part of the complaint regarding previous 
> versions of CakePHP was that queries returned data arrays, and not objects, 
> and I'm sure that the changes to the Model layer will attract more 
> professional users, but I hope that this isn't at the expense of those 
> choosing a framework for the first time, or cutting their teeth on PHP.
> 
> Now before Mark, Mark and Jose etc. jump on me, I am not being critical of 
> their fantastic efforts to modernise the framework, or the reasons for doing 
> so. I am also not adverse to change, especially if it is for the better, 
> which is why I am attempting to get to know this new version, even though it 
> is still in Alpha, and yes I have read the documentation, but the more I read 
> the more confused I get.
> 
> I know that people at this stage will say, that if I could do better, then I 
> should contribute to the documents myself. But in order to do so, I would 
> need to understand them first! :) They do say that programmers shouldn't 
> write manuals, and perhaps this is a case in point?
> 
> Dave
> 
> 
> 
> -- 
> 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.

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


map/reduce with translated models

2014-08-18 Thread Thomas von Hassel
When doing map/reduce on a model with translated fields, there is not good way 
to get the translated content in the map/reduce fase except to look in the 
`_i18n` association ?

/thomas

-- 
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 access vendor classes in CakePHP 3

2014-08-18 Thread Thomas von Hassel
./composer.path dump-autoload

and check that the namespace is correct


On 18 Aug 2014, at 13:40, Jipson Thomas  wrote:

> Hi Thomas,
> Thank you for your update. MY code is as follows.
> 
> The Controller function I used is
> 
> namespace App\Controller;
> use App\Controller\AppController;
> use Authorizenet\AuthorizeNetARB;
> use Cake\ORM\TableRegistry;
> use Cake\Event\Event;
> use Cake\Network\Email\Email;
> 
> public function authtest(){
> define("AUTHORIZENET_API_LOGIN_ID", "LOGIN");
> define("AUTHORIZENET_TRANSACTION_KEY", "KEY");
> $subscription  = new 
> AuthorizeNet_Subscription;
> $subscription->name= "PHP Monthly Magazine";
> $subscription->intervalLength  = "1";
> $subscription->intervalUnit= "months";
> $subscription->startDate   = "2014-08-14";
> $subscription->totalOccurrences= "12";
> $subscription->amount  = "12.99";
> $subscription->creditCardCardNumber= "60110012";
> $subscription->creditCardExpirationDate= "2018-10";
> $subscription->creditCardCardCode  = "123";
> $subscription->billToFirstName = "Rasmus";
> $subscription->billToLastName  = "Doe";
> 
> // Create the subscription.
> $request = new AuthorizeNetARB;
> $response= $request->createSubscription($subscription);
> $subscription_id = $response->getSubscriptionId();
> echo $subscription_id;exit;
> }
> 
> Regards,
> Jipson
> 
> On Monday, 18 August 2014 10:42:08 UTC+1, Jipson Thomas wrote:
> Hi,
> Would you please tell me how we can access some 3rdpart vendor classes (Not 
> developed in a CakePHP platform) in our controller functions. For example, in 
> my cakePHP 3 website I need to integrate mandrill API and Authorize.net API, 
> I installed both through the compose of cakephp and both are downloaded to my 
> vendors folder.When I am trying to create their objects in our controller 
> action, I am getting fatal error as Class 'App\Controller\AuthorizeNet_
> Subscription' not found. I couldn't find any thing related to this on cakephp 
> documentation also. Would you please help me to solve this issue? I had 
> another post with this details, but that is not replied.
> 
> Thanks and Regards,
> Jipson
> 
> 
> https://groups.google.com/forum/#!searchin/cake-php/authorize.net/cake-php/p5XbQfJGrWg/ZTBd5b1LCUcJ
> 
> -- 
> 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.

-- 
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 access vendor classes in CakePHP 3

2014-08-18 Thread Thomas von Hassel
can you post the code where you instantiate the class ?


On 18 Aug 2014, at 11:42, Jipson Thomas  wrote:

> Hi,
> Would you please tell me how we can access some 3rdpart vendor classes (Not 
> developed in a CakePHP platform) in our controller functions. For example, in 
> my cakePHP 3 website I need to integrate mandrill API and Authorize.net API, 
> I installed both through the compose of cakephp and both are downloaded to my 
> vendors folder.When I am trying to create their objects in our controller 
> action, I am getting fatal error as Class 'App\Controller\AuthorizeNet_
> Subscription' not found. I couldn't find any thing related to this on cakephp 
> documentation also. Would you please help me to solve this issue? I had 
> another post with this details, but that is not replied.
> 
> Thanks and Regards,
> Jipson
> 
> 
> https://groups.google.com/forum/#!searchin/cake-php/authorize.net/cake-php/p5XbQfJGrWg/ZTBd5b1LCUcJ
> 
> -- 
> 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.

-- 
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: 3.x - Entity virtual fields

2014-08-17 Thread Thomas von Hassel
 👍

On 17 Aug 2014, at 23:23, José Lorenzo  wrote:

> It is not possible to configure, unless you instruct the database system to 
> create another type of date object that you can configure.
> The reason for this format is that it is the standard for json responses.
> 
> On Sunday, August 17, 2014 11:19:53 PM UTC+2, Thomas von Hassel wrote:
> another related question. When outputting an entity to json,  DATE and 
> DATETIME fields are formatted like
> 
> "modified": "2014-08-17T19:45:57+",
> 
> Is there a way to set a format string when converting to json/array ?
> 
> On 07 Jul 2014, at 16:06, José Lorenzo  wrote:
> 
>> No problem :)
>> 
>> On Monday, July 7, 2014 3:50:50 PM UTC+2, Thomas von Hassel wrote:
>> oh hell … thanks :)
>> 
>> On 07 Jul 2014, at 15:49, José Lorenzo  wrote:
>> 
>>> http://book.cakephp.org/3.0/en/orm/entities.html#exposing-virtual-properties
>>> 
>>> On Monday, July 7, 2014 3:47:48 PM UTC+2, Thomas von Hassel wrote:
>>> Is there an easy way to get “virtual” fields to be included in a 
>>> `$table->find(‘all’)->toArray();` call 
>>> 
>>> when you set the result to a view and have _serialize render it to json ? 
>>> 
>>> /thomas 
>>> 
>>> 
>>> -- 
>>> 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.
>> 
>> 
>> -- 
>> 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.
> 
> 
> -- 
> 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.

-- 
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: 3.x - Entity virtual fields

2014-08-17 Thread Thomas von Hassel
another related question. When outputting an entity to json,  DATE and DATETIME 
fields are formatted like

"modified": "2014-08-17T19:45:57+",

Is there a way to set a format string when converting to json/array ?

On 07 Jul 2014, at 16:06, José Lorenzo  wrote:

> No problem :)
> 
> On Monday, July 7, 2014 3:50:50 PM UTC+2, Thomas von Hassel wrote:
> oh hell ... thanks :)
> 
> On 07 Jul 2014, at 15:49, José Lorenzo  wrote:
> 
>> http://book.cakephp.org/3.0/en/orm/entities.html#exposing-virtual-properties
>> 
>> On Monday, July 7, 2014 3:47:48 PM UTC+2, Thomas von Hassel wrote:
>> Is there an easy way to get "virtual" fields to be included in a 
>> `$table->find('all')->toArray();` call 
>> 
>> when you set the result to a view and have _serialize render it to json ? 
>> 
>> /thomas 
>> 
>> 
>> -- 
>> 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.
> 
> 
> -- 
> 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.

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


patchEntity with translations

2014-08-17 Thread Thomas von Hassel
Hey

if you pass an array like this

[
'foo' => null,
'_translations' => [
'eng' => [
'name' => a name',
'slug' => 'a-name',

]
]
];

into patchEntity()

is there an easy way to have the translations patched autmaticly or do i have 
to loop though _translations from find('translated') and update them there ?

/thomas

-- 
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: 3.x - en/disable

2014-08-13 Thread Thomas von Hassel
Hi

I just mean that if i remove the behaviour, do some stuff, and then add it 
again, i would have to add it with the same options as i gave it in 
Table::initialize()


/thomas




On 13 Aug 2014, at 13:31, José Lorenzo  wrote:

> Not sure what you meant
> 
> On Wednesday, August 13, 2014 1:03:05 PM UTC+2, Thomas von Hassel wrote:
> ok, that's a bit more verbose if you have something like translate where you 
> define translated fields :)
> 
> On 13 Aug 2014, at 13:01, José Lorenzo  wrote:
> 
>> unload and load again
>> 
>> On Wednesday, August 13, 2014 10:48:02 AM UTC+2, Thomas von Hassel wrote:
>> Hey 
>> 
>> In 2.x you could temporarily disable a behaviour like this: 
>> 
>> `$this->Behaviors->disable('Translate');` 
>> 
>> Is that coming back to 3.x or should i just remove and add them when needed 
>> ? 
>> 
>> /thomas 
>> 
>> 
>> 
>> 
>> -- 
>> 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.
> 
> 
> -- 
> 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.

-- 
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: 3.x - en/disable

2014-08-13 Thread Thomas von Hassel
ok, that's a bit more verbose if you have something like translate where you 
define translated fields :)

On 13 Aug 2014, at 13:01, José Lorenzo  wrote:

> unload and load again
> 
> On Wednesday, August 13, 2014 10:48:02 AM UTC+2, Thomas von Hassel wrote:
> Hey 
> 
> In 2.x you could temporarily disable a behaviour like this: 
> 
> `$this->Behaviors->disable('Translate');` 
> 
> Is that coming back to 3.x or should i just remove and add them when needed ? 
> 
> /thomas 
> 
> 
> 
> 
> -- 
> 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.

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


3.x - en/disable

2014-08-13 Thread Thomas von Hassel
Hey

In 2.x you could temporarily disable a behaviour like this:

`$this->Behaviors->disable('Translate');`

Is that coming back to 3.x or should i just remove and add them when needed ?

/thomas



-- 
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: 3.x - where and null

2014-08-09 Thread Thomas von Hassel
where ?

On 09 Aug 2014, at 17:33, José Lorenzo  wrote:

> No, I think we forgot to include it in the book. Would you be kind to do that 
> as well? :)
> 
> On Saturday, August 9, 2014 5:12:04 PM UTC+2, Thomas von Hassel wrote:
> It's not really documented is it ? (or maybe i'm just blind ?) (The IS 
> operator that is)
> 
> 
> /thomas
> On 09 Aug 2014, at 15:16, José Lorenzo  wrote:
> 
>> Nope, it was added after I created the TreeBehavior. Do you have time to 
>> submit a PR for changing that?
>> 
>> On Saturday, August 9, 2014 3:12:28 PM UTC+2, Thomas von Hassel wrote:
>> ok, because i can see in TreeBehavior you do something like this
>> 
>> ->where(function($exp) use ($parentId, $parent) {
>>return $parentId === null ? $exp->isNull($parent) : $exp->eq($parent, 
>> $parentId);
>> })
>> Is there a downside to using IS ?
>> 
>> 
>> On 09 Aug 2014, at 15:11, José Lorenzo  wrote:
>> 
>>> ->where(['parent_id IS' => $parent_id])
>>> 
>>> It will convert to NULL if needed or just use the provided value
>>> 
>>> On Saturday, August 9, 2014 3:04:51 PM UTC+2, Thomas von Hassel wrote:
>>> Hey 
>>> 
>>> in 2.x you could do something like this: 
>>> 
>>> 'conditions' => array('parent_id' => $parent_id); 
>>> 
>>> where $parent_id could be an int or null 
>>> 
>>> and it would find parent_id that were null in the table 
>>> 
>>> This approach does not work in 3.x. Is there a right way to do this in 3.x 
>>> where a field in an INT but can be null ? 
>>> 
>>> /thomas 
>>> 
>>> 
>>> -- 
>>> 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.
>> 
>> 
>> -- 
>> 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.
> 
> 
> -- 
> 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.

-- 
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: 3.x - where and null

2014-08-09 Thread Thomas von Hassel
It's not really documented is it ? (or maybe i'm just blind ?) (The IS operator 
that is)


/thomas
On 09 Aug 2014, at 15:16, José Lorenzo  wrote:

> Nope, it was added after I created the TreeBehavior. Do you have time to 
> submit a PR for changing that?
> 
> On Saturday, August 9, 2014 3:12:28 PM UTC+2, Thomas von Hassel wrote:
> ok, because i can see in TreeBehavior you do something like this
> 
> ->where(function($exp) use ($parentId, $parent) {
>return $parentId === null ? $exp->isNull($parent) : $exp->eq($parent, 
> $parentId);
> })
> Is there a downside to using IS ?
> 
> 
> On 09 Aug 2014, at 15:11, José Lorenzo  wrote:
> 
>> ->where(['parent_id IS' => $parent_id])
>> 
>> It will convert to NULL if needed or just use the provided value
>> 
>> On Saturday, August 9, 2014 3:04:51 PM UTC+2, Thomas von Hassel wrote:
>> Hey 
>> 
>> in 2.x you could do something like this: 
>> 
>> 'conditions' => array('parent_id' => $parent_id); 
>> 
>> where $parent_id could be an int or null 
>> 
>> and it would find parent_id that were null in the table 
>> 
>> This approach does not work in 3.x. Is there a right way to do this in 3.x 
>> where a field in an INT but can be null ? 
>> 
>> /thomas 
>> 
>> 
>> -- 
>> 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.
> 
> 
> -- 
> 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.

-- 
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: 3.x - where and null

2014-08-09 Thread Thomas von Hassel
ok, because i can see in TreeBehavior you do something like this

->where(function($exp) use ($parentId, $parent) {
   return $parentId === null ? $exp->isNull($parent) : $exp->eq($parent, 
$parentId);
})
Is there a downside to using IS ?


On 09 Aug 2014, at 15:11, José Lorenzo  wrote:

> ->where(['parent_id IS' => $parent_id])
> 
> It will convert to NULL if needed or just use the provided value
> 
> On Saturday, August 9, 2014 3:04:51 PM UTC+2, Thomas von Hassel wrote:
> Hey 
> 
> in 2.x you could do something like this: 
> 
> 'conditions' => array('parent_id' => $parent_id); 
> 
> where $parent_id could be an int or null 
> 
> and it would find parent_id that were null in the table 
> 
> This approach does not work in 3.x. Is there a right way to do this in 3.x 
> where a field in an INT but can be null ? 
> 
> /thomas 
> 
> 
> -- 
> 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.

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


3.x - where and null

2014-08-09 Thread Thomas von Hassel
Hey

in 2.x you could do something like this:

'conditions' => array('parent_id' => $parent_id);

where $parent_id could be an int or null

and it would find parent_id that were null in the table

This approach does not work in 3.x. Is there a right way to do this in 3.x 
where a field in an INT but can be null ?

/thomas

-- 
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: GET or POST

2014-08-08 Thread Thomas von Hassel
You should check the ACL in the edit controller action before actually doing 
anything

/thomas


On 08 Aug 2014, at 22:33, Steve Thomas  wrote:

> All the manager would have to do is change the id in the address bar to 
> access another user. Possibly a user from a different company which they 
> shouldn't be able to access.  

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


Testing controllers - 3.x

2014-08-08 Thread Thomas von Hassel
Hey good people


When i test controllers and want to mock certain methods on the controller, i 
use ->generate(), but i have to also define components that already are defined 
in the controller, and if i want to use the real components i have to stub out 
dummy method on the component to make it work.

Is this the intended behaviour ?

/thomas

-- 
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: Custom FormWidget Vs Custom FormHelper vs ... [Cake 3]

2014-08-06 Thread Thomas von Hassel
Indeed, the only things i would like is:

place checkbox inside it's label like bootstrap wants it without hacking things 
together
set a class on a container from field to field


On 06 Aug 2014, at 16:30, Dr. Tarique Sani  wrote:

> Thanks for the URL that is helpful.
> 
> Regards
> Tarique
> 
> 
> On Wed, Aug 6, 2014 at 6:15 PM, José Lorenzo  wrote:
> you can change the widgets to whatever you like, including the basic widget. 
> Here is a plugin that does that, for example:
> 
> https://github.com/FriendsOfCake/crud-view#example-controller
> 
> 
> On Wednesday, August 6, 2014 1:52:02 PM UTC+2, Thomas von Hassel wrote:
> It is cleaner ... and maybe i just need to fiddle with it some more.
> 
> For instance being able to set a class to the container div without having to 
> make a template would be nice ?
> 
> On 06 Aug 2014, at 13:42, Dr. Tarique Sani  wrote:
> 
>> But template is a much cleaner way to do it. Most of the times you can just 
>> define templates and get away with it. 
>> 
>> I am loving it! 
>> 
>> T
>> 
>> 
>> On Wed, Aug 6, 2014 at 5:10 PM, Thomas von Hassel  wrote:
>> Hey
>> 
>> If i can chime in, the template system is very clever, but in comparison to 
>> the way it was done in 2.x there are quote a few more hoops to go though to 
>> achieve certain things.
>> 
>> /thomas
>> 
>> 
>> On 06 Aug 2014, at 13:30, Dr. Tarique Sani  wrote:
>> 
>>> Thanks, but if I look at 
>>> 
>>> 'inputContainerError' => '{{content}}{{error}}',
>>> 
>>> I can remove the {{error}} here but then there will be no way to show it at 
>>> all by setting ['error'=>true] 
>>> 
>>> 'inputContainer' => '{{content}}',
>>> 
>>> There is no way to remove label here... {{content}} has got label inside it.
>>> 
>>> So I should look at coding a custom helper?
>>> 
>>> Tarique
>>> 
>>> 
>>> 
>>> 
>>> On Wed, Aug 6, 2014 at 4:49 PM, José Lorenzo  wrote:
>>> Wouldn't that be possible by altering the inputContainer and 
>>> inputContainerError templates?
>>> 
>>> 
>>> On Wednesday, August 6, 2014 11:30:02 AM UTC+2, Dr. Tarique Sani wrote:
>>> Hi, 
>>> 
>>> Playing around with form helpers  and form widgets in Cake 3 
>>> 
>>> Is there a way to override the Basic Widget with my custom Basic Widget and 
>>> have options 'error'=>false, 'label'=>false by default? 
>>> 
>>> OR this can't be done in the widget and will have to go into my custom form 
>>> helper
>>> 
>>> TIA
>>> 
>>> Tarique
>>> 
>>> 
>>> 
>>> -- 
>>> =
>>> The Conference Schedule Creator : http://shdlr.com
>>> 
>>> PHP for E-Biz : http://sanisoft.com
>>> =
>>> 
>>> -- 
>>> 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.
>>> 
>>> 
>>> 
>>> -- 
>>> =
>>> The Conference Schedule Creator : http://shdlr.com
>>> 
>>> PHP for E-Biz : http://sanisoft.com
>>> =
>>> 
>>> -- 
>>> 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/grou

Re: Custom FormWidget Vs Custom FormHelper vs ... [Cake 3]

2014-08-06 Thread Thomas von Hassel
It is cleaner ... and maybe i just need to fiddle with it some more.

For instance being able to set a class to the container div without having to 
make a template would be nice ?

On 06 Aug 2014, at 13:42, Dr. Tarique Sani  wrote:

> But template is a much cleaner way to do it. Most of the times you can just 
> define templates and get away with it. 
> 
> I am loving it! 
> 
> T
> 
> 
> On Wed, Aug 6, 2014 at 5:10 PM, Thomas von Hassel  wrote:
> Hey
> 
> If i can chime in, the template system is very clever, but in comparison to 
> the way it was done in 2.x there are quote a few more hoops to go though to 
> achieve certain things.
> 
> /thomas
> 
> 
> On 06 Aug 2014, at 13:30, Dr. Tarique Sani  wrote:
> 
>> Thanks, but if I look at 
>> 
>> 'inputContainerError' => '{{content}}{{error}}',
>> 
>> I can remove the {{error}} here but then there will be no way to show it at 
>> all by setting ['error'=>true] 
>> 
>> 'inputContainer' => '{{content}}',
>> 
>> There is no way to remove label here... {{content}} has got label inside it.
>> 
>> So I should look at coding a custom helper?
>> 
>> Tarique
>> 
>> 
>> 
>> 
>> On Wed, Aug 6, 2014 at 4:49 PM, José Lorenzo  wrote:
>> Wouldn't that be possible by altering the inputContainer and 
>> inputContainerError templates?
>> 
>> 
>> On Wednesday, August 6, 2014 11:30:02 AM UTC+2, Dr. Tarique Sani wrote:
>> Hi, 
>> 
>> Playing around with form helpers  and form widgets in Cake 3 
>> 
>> Is there a way to override the Basic Widget with my custom Basic Widget and 
>> have options 'error'=>false, 'label'=>false by default? 
>> 
>> OR this can't be done in the widget and will have to go into my custom form 
>> helper
>> 
>> TIA
>> 
>> Tarique
>> 
>> 
>> 
>> -- 
>> =
>> The Conference Schedule Creator : http://shdlr.com
>> 
>> PHP for E-Biz : http://sanisoft.com
>> =
>> 
>> -- 
>> 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.
>> 
>> 
>> 
>> -- 
>> =
>> The Conference Schedule Creator : http://shdlr.com
>> 
>> PHP for E-Biz : http://sanisoft.com
>> =
>> 
>> -- 
>> 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.
> 
> 
> -- 
> 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.
> 
> 
> 
> -- 
> =
> The Conference Schedule Creator : http://shdlr.com
> 
> PHP for E-Biz : http://sanisoft.com
> =
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
> 
> --- 
> You received this message because you 

Re: Custom FormWidget Vs Custom FormHelper vs ... [Cake 3]

2014-08-06 Thread Thomas von Hassel
Hey

If i can chime in, the template system is very clever, but in comparison to the 
way it was done in 2.x there are quote a few more hoops to go though to achieve 
certain things.

/thomas


On 06 Aug 2014, at 13:30, Dr. Tarique Sani  wrote:

> Thanks, but if I look at 
> 
> 'inputContainerError' => '{{content}}{{error}}',
> 
> I can remove the {{error}} here but then there will be no way to show it at 
> all by setting ['error'=>true] 
> 
> 'inputContainer' => '{{content}}',
> 
> There is no way to remove label here... {{content}} has got label inside it.
> 
> So I should look at coding a custom helper?
> 
> Tarique
> 
> 
> 
> 
> On Wed, Aug 6, 2014 at 4:49 PM, José Lorenzo  wrote:
> Wouldn't that be possible by altering the inputContainer and 
> inputContainerError templates?
> 
> 
> On Wednesday, August 6, 2014 11:30:02 AM UTC+2, Dr. Tarique Sani wrote:
> Hi, 
> 
> Playing around with form helpers  and form widgets in Cake 3 
> 
> Is there a way to override the Basic Widget with my custom Basic Widget and 
> have options 'error'=>false, 'label'=>false by default? 
> 
> OR this can't be done in the widget and will have to go into my custom form 
> helper
> 
> TIA
> 
> Tarique
> 
> 
> 
> -- 
> =
> The Conference Schedule Creator : http://shdlr.com
> 
> PHP for E-Biz : http://sanisoft.com
> =
> 
> -- 
> 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.
> 
> 
> 
> -- 
> =
> The Conference Schedule Creator : http://shdlr.com
> 
> PHP for E-Biz : http://sanisoft.com
> =
> 
> -- 
> 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.

-- 
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 3.0 - Correct way to append / prepend HTML on FormHelper

2014-08-01 Thread Thomas von Hassel
use the `inputContainer` template to wrap the content like this:

'inputContainer' => '{{content}}',

or create a custom widget, depending on how much customisation you want

 


On 01 Aug 2014, at 12:24, Mikaël Capelle  wrote:

> Hi everyone,
> 
> I am porting my CakePHP 2.0 helpers to CakePHP 3.0 and I am facing some 
> troubles with my custom FormHelper. The helpers are made to be used with 
> bootstrap, the two form helpers can be found here:
>   * CakePHP 2 - 
> https://github.com/Holt59/cakephp-bootstrap3-helpers/blob/master/View/Helper/BootstrapFormHelper.php
>   * CakePHP 3 - 
> https://github.com/Holt59/cakephp3-bootstrap3-helpers/blob/master/View/Helper/BootstrapFormHelper.php
> In the BootstrapFormHelper::input method, I have a 'prepend' and 'append' 
> options which are used to create bootstrap input groups. With the 2.0 
> version, I used the 'before' and 'after' options to create such groups but 
> these options are not available anymore with CakePHP 3.0 so what I'm doing is 
> a temporary template change:
> 
> $oldTemplate = $this->templates('input') ;
> if ($options['prepend']) {
> $this->templates([
> 'input' => /* ... */
> ]) ;
> }
> $res = parent::input(/* ... */) ;
> $this->templates([
> 'input' => $oldTemplate
> ]) ;
> return $res ;
> 
> Is there a better way to do such thing with CakePHP 3.0?
> 
> 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/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 http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3.0.0-alpha2 released

2014-07-29 Thread Thomas von Hassel
If you use good caching of expensive database requests, and offload static 
files to a CDN there is no need to bother with full page caching for most sites.

Our CMS with warm caches can display a somewhat complicated page in about 
100-200 ms ...

/thomas

On 29 Jul 2014, at 12:22, HK  wrote:

> Why isn't needed? Why do I have to bother the server with more proccessing? I 
> have for example a (medium size) VPS with 40+ domains. Some of them use 
> cakePHP, and hopefully more in the future.
> While each site is rather small (some with many pageviews though) all of them 
> are hosted on the same server. 
> 
> Moreover you can achieve less page load times which IS crucial for visitors, 
> SEO, etc.
> 
> On Tuesday, July 29, 2014 1:07:01 PM UTC+3, José Lorenzo wrote:
> For those small sites, is having full page cache actually needed? I would 
> guess that performance wouldn't be a big concern in those cases
> 
> On Tuesday, July 29, 2014 11:47:16 AM UTC+2, HK wrote:
> For small sites that I develop is very helpful. The need to 
> use/configure/monitor extra software like varnish is pain in the ass, 
> especially if you don't have big sites to host.
> 
> On Tuesday, July 29, 2014 11:28:17 AM UTC+3, José Lorenzo wrote:
> HK why would you miss it? There will be no replacement for the cache helper. 
> We recommend using Varnish, which provides the ESI tags. They are similar to 
> the cache tags but they involve internally doing another request. We think 
> this is a more robust and scalable solution than doing it in PHP.
> 
> On Tuesday, July 29, 2014 9:06:36 AM UTC+2, HK wrote:
> Too sad to hear cache helper is removed. This ESI based replacement is it 
> going to be in stable 3.0 version?
> 
> On Monday, July 28, 2014 10:13:14 AM UTC+3, José Lorenzo wrote:
> 
> CacheHelper has been removed from CakePHP. The core team feels that the 
> functionality this helper provided is best handled by standalone servers like 
> Varnish. While we explored building a ESI based replacement for CacheHelper, 
> there were a number of edge cases that would have complicated the 
> implementation.
> 
>  
> 
> -- 
> 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.

-- 
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: 3.x - Fixtures, import records ?

2014-07-22 Thread Thomas von Hassel
Do you just exec() out to the mysql client or how would you do this in the most 
"correct" way ?

/thomas


On 22 Jul 2014, at 09:53, José Lorenzo  wrote:

> For instance, I have .sql files stored in my project that I load in the 
> insert() method.

-- 
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: 3.x - Fixtures, import records ?

2014-07-22 Thread Thomas von Hassel
sure :)

On 22 Jul 2014, at 10:33, José Lorenzo  wrote:

> It was very buggy and slow and what it did could be replaced easier with 
> specific queries for each driver. My personal plan is to do that in another 
> plugin like I did for y current Fixturize plugin in 2.x.
> Maybe you want to help with that? :)
> 
> On Tuesday, July 22, 2014 9:58:49 AM UTC+2, Thomas von Hassel wrote:
> Yeah, that was i was going to do, i was just wondering why that feature got 
> the axe ?
> 
> /thomas
> 
> On 22 Jul 2014, at 09:53, José Lorenzo  wrote:
> 
>> Yes, the feature was removed. You can, though, override the _getRecords() or 
>> insert() method to do whatever you like. For instance, I have .sql files 
>> stored in my project that I load in the insert() method.
>> 
>> On Monday, July 21, 2014 7:49:09 PM UTC+2, Thomas von Hassel wrote:
>> Hey 
>> 
>> Is it true that the importing of records is gone from fixtures in 3.x ? 
>> 
>> I have a dataset that is prohibitive to define manually in the fixture so i 
>> have been relying on having it be imported with the 'records' => true key 
>> 
>> 
>> /thomas 
>> 
>> 
>> -- 
>> 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.
> 
> 
> -- 
> 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.

-- 
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: 3.x - Fixtures, import records ?

2014-07-22 Thread Thomas von Hassel
Yeah, that was i was going to do, i was just wondering why that feature got the 
axe ?

/thomas

On 22 Jul 2014, at 09:53, José Lorenzo  wrote:

> Yes, the feature was removed. You can, though, override the _getRecords() or 
> insert() method to do whatever you like. For instance, I have .sql files 
> stored in my project that I load in the insert() method.
> 
> On Monday, July 21, 2014 7:49:09 PM UTC+2, Thomas von Hassel wrote:
> Hey 
> 
> Is it true that the importing of records is gone from fixtures in 3.x ? 
> 
> I have a dataset that is prohibitive to define manually in the fixture so i 
> have been relying on having it be imported with the 'records' => true key 
> 
> 
> /thomas 
> 
> 
> -- 
> 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.

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


3.x - Fixtures, import records ?

2014-07-21 Thread Thomas von Hassel
Hey

Is it true that the importing of records is gone from fixtures in 3.x ?

I have a dataset that is prohibitive to define manually in the fixture so i 
have been relying on having it be imported with the 'records' => true key


/thomas

-- 
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: Load Time

2014-07-21 Thread Thomas von Hassel
You probably mean "decrease" the load time. 

Without specifics, that's a hard question to answer. 

/Thomas


Sent from my iPhone

> On 21/07/2014, at 12.56, Sudhir Pandey  wrote:
> 
> Hi ,
> How I will increase load time of website in cakephp?
> 
> Regards
> 
> Sudhir 
> -- 
> 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.

-- 
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: 3.x - SecurityComponent and View Cell

2014-07-20 Thread Thomas von Hassel
is there an issue to track this, or should i create one ?

/thomas

On 19 Jul 2014, at 15:12, mark_story  wrote:

> That might be a good compromise. Default to isolated scopes, and allow a 
> shared mode.
> 
> -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 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.

-- 
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: 3.x - SecurityComponent and View Cell

2014-07-17 Thread Thomas von Hassel
Yeah, it makes sense .. 
How about being able to give the cell a specific view in those cases where you 
know what you are doing ?

/thomas

On 18 Jul 2014, at 02:12, mark_story  wrote:

> I don't think cells are going to be a good fit for either of these use cases. 
> The general consensus on the github issse is that having cells be isolated is 
> more useful than having them share state with the containing view scope.
> 
> -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 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.

-- 
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: 3.x - date time fields

2014-07-16 Thread Thomas von Hassel
yep, that was that plan :)

/thomas


ps: kudos to you all, 3.x is looking to be an awesome update and it has made my 
work fun again :)



On 16 Jul 2014, at 13:41, mark_story  wrote:

> I am assuming you have already implemented a custom form widget. You might 
> also want to try replacing the Datetime type in the database layer. The type 
> system has hooks for marshalling data from a request in php form, which would 
> be a good place to set your locales format.
> 
> -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 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.

-- 
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: 3.x - SecurityComponent and View Cell

2014-07-15 Thread Thomas von Hassel
It's a block of custom fields and all that logic is shared between several 
models and views


/thomas

On 16 Jul 2014, at 03:33, mark_story  wrote:

> Why is only part of the form in a cell?
> 
> -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 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.

-- 
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: 3.x - date time fields

2014-07-15 Thread Thomas von Hassel
yes, but turns out our local way of writing dates is backwards in both order 
and separators so DateTime gets confused ..

/thomas


On 15 Jul 2014, at 17:35, José Lorenzo  wrote:

> If you send a string that can be parsed by DateTime() it should just work
> 
> On Tuesday, July 15, 2014 3:43:23 PM UTC+2, Thomas von Hassel wrote:
> Hi 
> 
> Ok, date time fields in 3.x are kicking my ass a bit, because i don't want to 
> use the builtin dateTime widget, but just a text field with a javascript date 
> picker. 
> 
> Now, when the post data is marshalled, is there a good place to configure how 
> a date/time string is parsed to the DateTime object ? 
> 
> I spent a lot of time trying to use Entity get/set to transform my data, but 
> i'm going to have a lot of models where is needs to be done, so i've tried to 
> use Traits on the entity, but couldn't find a good place to override setting 
> of arbitrary properties. 
> 
> Any other good ideas ? 
> 
> /thomas 
> 
> 
> -- 
> 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.

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


3.x - date time fields

2014-07-15 Thread Thomas von Hassel
Hi

Ok, date time fields in 3.x are kicking my ass a bit, because i don't want to 
use the builtin dateTime widget, but just a text field with a javascript date 
picker.

Now, when the post data is marshalled, is there a good place to configure how a 
date/time string is parsed to the DateTime object ?

I spent a lot of time trying to use Entity get/set to transform my data, but 
i'm going to have a lot of models where is needs to be done, so i've tried to 
use Traits on the entity, but couldn't find a good place to override setting of 
arbitrary properties.

Any other good ideas ?

/thomas

-- 
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: 3.x - Entity Accessors & Mutators

2014-07-15 Thread Thomas von Hassel
I got to work by checking if the property was dirty or not and only setting it 
when it's clean

/Thomas




Sent from my iPhone

> On 15/07/2014, at 11.56, José Lorenzo  wrote:
> 
> Not right now, but it definitely makes sense. I will propose the change today 
> in a ticket as I think that using data from the getters in entities for 
> saving was a bad idea after all.
> 
>> On Tuesday, July 15, 2014 11:13:28 AM UTC+2, Thomas von Hassel wrote:
>> Hey (again ..) 
>> 
>> Is it correct that it is not possible to do _getXx and _setXx for the same 
>> field and have it translate to and from the data saved in the database. (say 
>> save the date in mysql format in the table, but present it localised ?) 
>> 
>> 
>> /thomas
> 
> -- 
> 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.

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


3.x - Entity Accessors & Mutators

2014-07-15 Thread Thomas von Hassel
Hey (again ..)

Is it correct that it is not possible to do _getXx and _setXx for the same 
field and have it translate to and from the data saved in the database. (say 
save the date in mysql format in the table, but present it localised ?)


/thomas

-- 
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: 3.x - Saving associated data

2014-07-14 Thread Thomas von Hassel
Ok, figured it out, it's is not clear in the docs that relations behave like 
the rest of the properties and have to be allowed for mass assignment ...

/thomas
 
On 15 Jul 2014, at 00:06, José Lorenzo  wrote:

> Are you setting the property in a beforeSave or something similar?
> 
> On Monday, July 14, 2014 11:55:47 PM UTC+2, Thomas von Hassel wrote:
> Hey (sorry, for spamming ;) 
> 
> I have a Model that i want to save some associated data with (hasMany) 
> 
> I use patchEntity to merge my request data with the existing entity, and the 
> correct values are marked as dirty, but only the main model is being 
> persisted. 
> 
> One thing, the association is set in a Behavior and has some extra 
> conditions. 
> 
> 
> /thomas 
> 
> 
> -- 
> 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.

-- 
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: 3.x - Saving associated data

2014-07-14 Thread Thomas von Hassel
Nope

very simple patch/save like this:


https://gist.github.com/darxmac/20736a8d81bfb27815a1


On 15 Jul 2014, at 00:06, José Lorenzo  wrote:

> Are you setting the property in a beforeSave or something similar?
> 
> On Monday, July 14, 2014 11:55:47 PM UTC+2, Thomas von Hassel wrote:
> Hey (sorry, for spamming ;) 
> 
> I have a Model that i want to save some associated data with (hasMany) 
> 
> I use patchEntity to merge my request data with the existing entity, and the 
> correct values are marked as dirty, but only the main model is being 
> persisted. 
> 
> One thing, the association is set in a Behavior and has some extra 
> conditions. 
> 
> 
> /thomas 
> 
> 
> -- 
> 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.

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


3.x - Saving associated data

2014-07-14 Thread Thomas von Hassel
Hey (sorry, for spamming ;)

I have a Model that i want to save some associated data with (hasMany)

I use patchEntity to merge my request data with the existing entity, and the 
correct values are marked as dirty, but only the main model is being persisted.

One thing, the association is set in a Behavior and has some extra conditions.


/thomas

-- 
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: 3.x - SecurityComponent and View Cell

2014-07-14 Thread Thomas von Hassel
Yeah, that is my ticket ... ;)

/thomas


On 14 Jul 2014, at 23:05, José Lorenzo  wrote:

> Not as of now. Cells do not share the same view instance, so the Form helper 
> instance will actually be different. There is a ticket opened about making 
> cells share the same view instance and we are evaluating if that will be a 
> good idea. So far the best solution is to not break your forms across 
> multiple cells
> 
> On Monday, July 14, 2014 10:53:52 PM UTC+2, Thomas von Hassel wrote:
> Hey 
> 
> I've been banging my head against Securiy Component and FormHelper until i 
> realised that a part of my form is rendered as a View Cell. 
> 
> Is that not supported ? If not, is there a workaround ? 
> 
> 
> /thomas 
> 
> 
> 
> -- 
> 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.

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


3.x - SecurityComponent and View Cell

2014-07-14 Thread Thomas von Hassel
Hey

I've been banging my head against Securiy Component and FormHelper until i 
realised that a part of my form is rendered as a View Cell.

Is that not supported ? If not, is there a workaround ?


/thomas


-- 
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: Want to be inspired and inspire great developer? Attend CakeFest this year :P

2014-07-14 Thread Thomas von Hassel


> Is there anything preventing you from attending this year? Let me know if 
> there is anything we can help with


Mostly scheduling conflicts, once again, but it's definitely on the the list!


/thomas

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


2.x -> 3.x migration

2014-07-14 Thread Thomas von Hassel
Hi good people

If i have a _crapton_ of templates that expect to receive data in the old 
`$var['Model']['field']` style, where would you translate this ? The 
controllers will be rewritten in 3.x but the sheer volume of templates makes i 
prohibitive to convert all at once.


/thomas

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


3.x - View Cell and Helper templates

2014-07-10 Thread Thomas von Hassel
Hi

When using FormHelper in the template for a Cell my overridden templates from 
AppController are not set.

I know i can override them again in the Cell $helpers variable, but i'd rather 
set my templates app-wide .. where is the best place to do that ?

/thomas

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


3.x - Form Helper - checkbox nested in

2014-07-08 Thread Thomas von Hassel
Hey

Is there a non-hacky way to nest the checkbox into it's label via the string 
templates ?


/thomas

-- 
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: 3.x - Entity virtual fields

2014-07-07 Thread Thomas von Hassel
oh hell ... thanks :)

On 07 Jul 2014, at 15:49, José Lorenzo  wrote:

> http://book.cakephp.org/3.0/en/orm/entities.html#exposing-virtual-properties
> 
> On Monday, July 7, 2014 3:47:48 PM UTC+2, Thomas von Hassel wrote:
> Is there an easy way to get "virtual" fields to be included in a 
> `$table->find('all')->toArray();` call 
> 
> when you set the result to a view and have _serialize render it to json ? 
> 
> /thomas 
> 
> 
> -- 
> 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.

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


3.x - Entity virtual fields

2014-07-07 Thread Thomas von Hassel
Is there an easy way to get "virtual" fields to be included in a 
`$table->find('all')->toArray();` call

when you set the result to a view and have _serialize render it to json ?

/thomas

-- 
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: 3.x - Acl Plugin ?

2014-07-06 Thread Thomas von Hassel
change is ok :)

Actually mucking about with 3.x while things are changing has been an excellent 
tour around the internals for me so far :)

/thomas

On 05 Jul 2014, at 23:11, José Lorenzo  wrote:

> It is not stable as in stuff will probably change, but it can be used
> 
> On Saturday, July 5, 2014 9:52:27 PM UTC+2, Thomas von Hassel wrote:
> I see it's there and updated to the new directory structure, but is it in a 
> state to be used ? 
> 
> 
> /thomas 
> 
> 
> -- 
> 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.

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


3.x - Acl Plugin ?

2014-07-05 Thread Thomas von Hassel
I see it's there and updated to the new directory structure, but is it in a 
state to be used ?


/thomas

-- 
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: Access $this->Session from a model

2014-05-28 Thread Thomas von Hassel
If your model depends on knowing, by it self, who the user is, you are doing it 
wrong ..

/thomas


On 27 May 2014, at 20:59, Henry Gabriel González Montejo 
 wrote:

> Hi i have the same problem with the plugin 
> https://github.com/robwilkerson/CakePHP-Audit-Log-Plugin, i put the method in 
> my Model (AppModel) so it can be used in others models, my solution was:
> 
> function currentUser() 
>   {
>   //pr($this->Session->read('Auth.User'));
>   //pr($this->Auth->user());
>   //pr(AuthComponent::user());
>   //die();
>   
>   $user=AuthComponent::user();
>   
>   return $user;
>   
>   } 
> 
> -- 
> 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.

-- 
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 3.x - DbAcl

2014-05-26 Thread Thomas von Hassel
https://bitbucket.org/elementsdk/cndacl.plugin

(please, don't laugh .. it's not quite polished to my standards yet ;))


On 26 May 2014, at 10:06, José Lorenzo  wrote:

> I would be happy to see your implementation :D
> 
> On Monday, May 26, 2014 10:02:11 AM UTC+2, Thomas von Hassel wrote:
> Hey 
> 
> 
> How far away is the DbAcl for 3.x ? 
> 
> I needed a DbAcl implementation for the thing i'm working on right now, so i 
> rolled my own. It's far from feature complete compared to the 2.x version, 
> but works for me. 
> 
> If need be i can clean it up some more and finish the tests if someone wants 
> to use it ? 
> 
> 
> /thomas 
> 
> 
> -- 
> 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.

-- 
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 3.x - DbAcl

2014-05-26 Thread Thomas von Hassel
Hey


How far away is the DbAcl for 3.x ?

I needed a DbAcl implementation for the thing i'm working on right now, so i 
rolled my own. It's far from feature complete compared to the 2.x version, but 
works for me.

If need be i can clean it up some more and finish the tests if someone wants to 
use it ?


/thomas

-- 
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: MP3 Upload Project : CakePHP

2014-05-17 Thread Thomas von Hassel
There is nothing wrong with using Bootstrap, but it doesn't take that much 
effort to not make it look like your are using Bootstrap :)


/thomas


On 17 May 2014, at 12:37, Matthew Kaufman  wrote:

> Awesome, finally someone that isn't using Bootstrap.
> 
> 
> On Fri, May 16, 2014 at 4:40 AM, Sibusiso Ndlovu  wrote:
> Hi All,
> 
> 
> 
> I new to CakePHP, read lot of it and im working on MP3 upload and download 
> project and using cake. Looking for help in building the project, I have 
> started building it(also learning how to use CakePHP),Im also available on 
> skye lusibu1
> 
> -- 
> 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.
> 
> 
> -- 
> 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.

-- 
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: Upgrading from cakePHP version 1.3 to 2.5

2014-05-16 Thread Thomas von Hassel
If you can wait that long, maybe wait for 3.x to become stable and upgrade to 
that instead.

/thomas

On 16 May 2014, at 06:21, earth  wrote:

> I have a project in cakePHP version 1.3 and i want it to upgrade it to 
> cakePHP version 2.5
> Please let me know the best way to do this upgrade.
> 
> -- 
> 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.

-- 
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: TreeBehavior - reorder

2014-05-05 Thread Thomas von Hassel
ah, cool .. that'l work for now. I can also take a look at re-implementing 
::reorder()


On 05 May 2014, at 15:51, José Lorenzo  wrote:

> That is a feature that I left out for the time being, would you like to help 
> us getting it back?
> 
> A workaround before the feature is implemented is using a scope:
> 
> $this->addBehavior('Tree', [
> 'scope' => function($query) { return $query->order('order_by'); };
> ]);
> 
> The scope will be used in all the queries done by the tree behavior, so it 
> should preserve the order when using 'recover'
> 
> 
> On Monday, May 5, 2014 12:46:53 PM UTC+2, Thomas von Hassel wrote:
> Hey 
> 
> in 2.x i have a table that behaves like a tree, but has an order_by key that 
> is used to re-order lft and rght accordinligy on a given level of the tree 
> 
> I guess with this 
> 
> https://github.com/cakephp/docs/pull/1324/files#diff-6e3df36e10f2470e04cdf8643e2ff73dR534
>  
> 
> this is gone now ? 
> 
> 
> How would you handle a use-case like above with the new TreeBehavior ? 
> 
> /thomas
> 
> -- 
> 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.

-- 
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: 3.0 - IN conditions

2014-05-05 Thread Thomas von Hassel
awesome, thanks :)

👍

On 05 May 2014, at 15:46, José Lorenzo  wrote:

> Here 
> https://github.com/cakephp/cakephp/blob/3.0/tests/TestCase/Database/QueryTest.php#L453
> 
> On Monday, May 5, 2014 3:25:00 PM UTC+2, Thomas von Hassel wrote:
> Ok, can you point to a test where this is used ? 
> 
> On 05 May 2014, at 13:27, mark_story  wrote: 
> 
> > It is intentional. Because of the new type system, arrays and other complex 
> > types can be mapped to sql expressions in queries. This made automatically 
> > converting arrays more complex. 
> > 
> > If you don't want to use an explicit in operator, you can use a array 
> > typehint when calling where. Ie. $q->where(['user_id' => $id], ['id' => 
> > 'int[]']); 
> > 
> > -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 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. 
> 
> 
> -- 
> 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.

-- 
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: 3.0 - IN conditions

2014-05-05 Thread Thomas von Hassel
Ok, can you point to a test where this is used ?

On 05 May 2014, at 13:27, mark_story  wrote:

> It is intentional. Because of the new type system, arrays and other complex 
> types can be mapped to sql expressions in queries. This made automatically 
> converting arrays more complex.
> 
> If you don't want to use an explicit in operator, you can use a array 
> typehint when calling where. Ie. $q->where(['user_id' => $id], ['id' => 
> 'int[]']);
> 
> -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 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.

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


TreeBehavior - reorder

2014-05-05 Thread Thomas von Hassel
Hey

in 2.x i have a table that behaves like a tree, but has an order_by key that is 
used to re-order lft and rght accordinligy on a given level of the tree

I guess with this

https://github.com/cakephp/docs/pull/1324/files#diff-6e3df36e10f2470e04cdf8643e2ff73dR534

this is gone now ?


How would you handle a use-case like above with the new TreeBehavior ?

/thomas

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


3.0 - IN conditions

2014-05-04 Thread Thomas von Hassel
In 2.x you could just pass an array to a condition like this:

$this->find('all', array('conditions' => array('id' => array(1,2,3)));

on it would generate a IN(...) sql statement

In 3.x this:

->where(['my_id' => $arrayOfIds])

does not work

but this does:

->where(["my_id IN" => $arrayOfIds])

Is that an intentional change, or a bug ?

/thomas

-- 
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 and HasMany not returning association

2014-05-03 Thread Thomas von Hassel
Without some code and some debug() output that would be rather hard ?

/thomas

On 02 May 2014, at 23:47, Paul Josephson  wrote:

> Anybody have any suggestions of why this is not working or am I doing it 
> wrong? 
> 
> -- 
> 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.

-- 
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 3.x - Accesing relations

2014-04-30 Thread Thomas von Hassel
This works:

$this->belongsTo('Plugin.Related', [
'className' => 'Related',
'foreignKey' => 'my_id']);

This does not:

$this->belongsTo('Authors', [ 
'className' => 'Publishing.Authors',
'foreignKey' => 'authorid',
'propertyName' => 'person' 
]);


In other words, where you need to use plugin syntax is switched in the docs (or 
vice versa)


/thomas



On 30 Apr 2014, at 11:16, José Lorenzo  wrote:

> Show the initialize method for your table. Most probably you have a 
> relationship to a Normal table object and not the the correct class. One way 
> to make sure is providing the full 'className' in the association options.
> 
> On Wednesday, April 30, 2014 7:46:10 AM UTC+2, Thomas von Hassel wrote:
> Ok, auto correct messed that up. 
> 
> Custom finder methods like this one on the related table don't work either: 
> 
> public function findSome(Query $query, array $options) { 
> 
> } 
> 
> when calling: 
> 
> From inside the Table class: 
> 
> $this->Related->find('some'); 
> 
> 
> The finder method itself works when called like this: 
> 
> $related = TableRegistry::get('MyPlugin.Related'); 
> $related->find('some'); 
> 
> 
> When i debug $this->Related 
> 
> i get this: 
> 
> ## DEBUG ## 
> object(Cake\ORM\Association\BelongsTo) 
> 
> 
> 
> 
> 
> 
> 
> On 29 Apr 2014, at 23:13, José Lorenzo  wrote: 
> 
> > Calling custom functions should work, if it does not it is either a bug or 
> > a configuration error on your side 
> > 
> > On Tuesday, April 29, 2014 10:38:10 PM UTC+2, Thomas von Hassel wrote: 
> > aah, yes when i tried using customer finders it worked, but not calling 
> > arbitrary functions that are defined in the Table object. 
> > 
> > I guess the right way is to use custom finders for everything then ? 
> > 
> > /thomas 
> > 
> > On 29 Apr 2014, at 22:06, José Lorenzo  wrote: 
> > 
> >> You can do exactly the same in cake 3 
> >> 
> >> On Tuesday, April 29, 2014 9:21:18 PM UTC+2, Thomas von Hassel wrote: 
> >> Hey 
> >> 
> >> In 2.x when in a Model class you could do something like 
> >> 
> >> $this->RelatedModel->find('all'); 
> >> 
> >> 
> >> What's the "right" way to access related tables in a Table class ? 
> >> 
> >> 
> >> /thomas 
> >> 
> >> 
> >> -- 
> >> 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. 
> > 
> > 
> > -- 
> > 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. 
> 
> 
> -- 
> 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.

-- 
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 3.x - Accesing relations

2014-04-29 Thread Thomas von Hassel
Ok, auto correct messed that up.

Custom finder methods like this one on the related table don't work either:

public function findSome(Query $query, array $options) {

}

when calling:

>From inside the Table class:

$this->Related->find('some');


The finder method itself works when called like this:

$related = TableRegistry::get('MyPlugin.Related');
$related->find('some');


When i debug $this->Related

i get this:

## DEBUG ##
object(Cake\ORM\Association\BelongsTo) 







On 29 Apr 2014, at 23:13, José Lorenzo  wrote:

> Calling custom functions should work, if it does not it is either a bug or a 
> configuration error on your side
> 
> On Tuesday, April 29, 2014 10:38:10 PM UTC+2, Thomas von Hassel wrote:
> aah, yes when i tried using customer finders it worked, but not calling 
> arbitrary functions that are defined in the Table object.
> 
> I guess the right way is to use custom finders for everything then ?
> 
> /thomas
> 
> On 29 Apr 2014, at 22:06, José Lorenzo  wrote:
> 
>> You can do exactly the same in cake 3
>> 
>> On Tuesday, April 29, 2014 9:21:18 PM UTC+2, Thomas von Hassel wrote:
>> Hey 
>> 
>> In 2.x when in a Model class you could do something like 
>> 
>> $this->RelatedModel->find('all'); 
>> 
>> 
>> What's the "right" way to access related tables in a Table class ? 
>> 
>> 
>> /thomas 
>> 
>> 
>> -- 
>> 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.
> 
> 
> -- 
> 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.

-- 
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 3.x - Accesing relations

2014-04-29 Thread Thomas von Hassel
aah, yes when i tried using customer finders it worked, but not calling 
arbitrary functions that are defined in the Table object.

I guess the right way is to use custom finders for everything then ?

/thomas

On 29 Apr 2014, at 22:06, José Lorenzo  wrote:

> You can do exactly the same in cake 3
> 
> On Tuesday, April 29, 2014 9:21:18 PM UTC+2, Thomas von Hassel wrote:
> Hey 
> 
> In 2.x when in a Model class you could do something like 
> 
> $this->RelatedModel->find('all'); 
> 
> 
> What's the "right" way to access related tables in a Table class ? 
> 
> 
> /thomas 
> 
> 
> -- 
> 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.

-- 
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 3.x - Accesing relations

2014-04-29 Thread Thomas von Hassel
Hey

In 2.x when in a Model class you could do something like

$this->RelatedModel->find('all');


What's the "right" way to access related tables in a Table class ?


/thomas

-- 
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 3.x - Schema, Mysql and LONGTEXT

2014-04-29 Thread Thomas von Hassel
Would you add this to 2.x or should i just do it for 3.x ?

/thomas

On 28 Apr 2014, at 20:10, José Lorenzo  wrote:

> In theory you can use whatever text type and cake will still work with it. 
> The problem is at generating tables from fixtures, we don't support that type 
> of column. Adding support for it is kind of trivial, actually, would be be 
> able to help us adding it?
> 
> On Sunday, April 27, 2014 9:19:27 PM UTC+2, Thomas von Hassel wrote:
> No, but sometimes, if you are dealing with a CMS and people store large blobs 
> of html/css then TEXT can end up being be too small.
> 
> /thomas
> 
> On 27 Apr 2014, at 17:31, José Lorenzo  wrote:
> 
>> Do you really need to store 4GB of data in a field?
>> 
>> On Sunday, April 27, 2014 10:06:08 AM UTC+2, Thomas von Hassel wrote:
>> I take it there is still no good way to express LONGTEXT type via the schema 
>> system ? 
>> 
>> /thomas 
>> 
>> 
>> -- 
>> 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.
> 
> 
> -- 
> 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.

-- 
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 3.x - Schema, Mysql and LONGTEXT

2014-04-27 Thread Thomas von Hassel
No, but sometimes, if you are dealing with a CMS and people store large blobs 
of html/css then TEXT can end up being be too small.

/thomas

On 27 Apr 2014, at 17:31, José Lorenzo  wrote:

> Do you really need to store 4GB of data in a field?
> 
> On Sunday, April 27, 2014 10:06:08 AM UTC+2, Thomas von Hassel wrote:
> I take it there is still no good way to express LONGTEXT type via the schema 
> system ? 
> 
> /thomas 
> 
> 
> -- 
> 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.

-- 
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: Jquery and Cake php problem

2014-04-27 Thread Thomas von Hassel
What are you doing in internal.php that could not be done better and more 
"correct" in your controllers ?

/thomas


On 26 Apr 2014, at 11:53, Sir Neiklot Bega  wrote:

> Hello,
> 
> I'm trying to do a 
> 
>$('#div').load("/app/View/About/internal.php")
> 
> To load a content in real-time in a div,
> 
> This is working well in the localhost but when I put this code in the server, 
> cakePhp is searching a Controller (View) to process this request, and then is 
> retourning:
> 
> 
> POST http://www.avantravel.es/app/View/About/aboutPresentation.php
> 404 Not Found
> 183ms
> 
> How I can't inform that this is a page in php that must be load to this Div 
> section without using a controller
> 
> 
> Thanks in advance,
> Neiklot
> 
> -- 
> 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.

-- 
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 3.x - Schema, Mysql and LONGTEXT

2014-04-27 Thread Thomas von Hassel
I take it there is still no good way to express LONGTEXT type via the schema 
system ?

/thomas

-- 
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 3.x - Reference to the table in an entity instance

2014-04-26 Thread Thomas von Hassel
Is there a better way to get a reference to an Entity class's table from within 
an Entity class other than calling 

`$table = TableRegistry::get('MyItems');`


/thomas

-- 
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 know the difference new post and updat post

2014-04-19 Thread Thomas von Hassel
Have you defined the non-conventional id in your model ?

Sent from my iPhone

> On 19/04/2014, at 10.30, mdv  wrote:
> 
> 
> Hi Guys.
> I have a edit form. When i make changes and click update its creating a new 
> id and insert as new.
> 
> I have 'c_id' in my table instead of 'id'
> Here is my code 
>   
>   public function editContact( $c_id = null ) {
>   //echo $c_id;
>   if( !$c_id ) {
>   throw new NotFoundException( __( 'Invalid Post' ) );
>   }
>   
>   $contact = $this->Contact->findBycId( $c_id );
>   if( !$contact ) {
>   throw new NotFoundException( __( 'Invalid Post' ) );
>   }
>   $id = $c_id;
>   if( $this->request->is( array( 'post', 'put' ) ) ) {
>   $this->Contact->cid = $id;
>   echo $this->Contact->cid;
>   if( $this->Contact->save( $this->request->data ) ) {
>   $this->Session->setFlash( __( 'Data Updated' ) 
> );
>   return $this->redirect( array( 'action' => 
> 'index' ) );
>   }
>   $this->Session->setFlash( __( 'Unable To update Data!' 
> ) );
>   }
>   
>   if( !$this->request->data ) {
>   $this->request->data = $contact;
>   }
>   }
> 
>  
> My question is how cakePHP knows the difference new post and update post
> -- 
> 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.

-- 
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: Can't get started with Console

2014-04-17 Thread Thomas von Hassel

On 16 Apr 2014, at 16:23, Jeff Riedl  wrote:

> I'm sure those of you who have been using Cake and other RAD tools for some 
> time have no idea what the learning curve looks like to us newbies.  The last 
> time I posted about this I got a very helpful "get over it" reply from some 
> Bobby Big-Brains, who then went on to suggest that maybe I (who has very 
> little experience with Shell Access) should write a php interface to replace 
> the "Console" as a good 'learning project'.  Is that really the attitude of 
> this community toward new users who have little experience?  If so, that 
> speaks volumes.
> 
> I'm still stuck.  Please offer CONSTRUCTIVE replies that will actually allow 
> me to get out of the starting blocks.  I think this project could be just 
> what I need to move forward with what I need to do - but it's not too useful 
> (or "Rapid") so far.  I can't access the Cake Console in order to "bake" 
> anything.  As you can see from the attached screen shot, I'm logged in as 
> ROOT user, and the lib directory IS permissioned as 777 (yes, I do try to 
> read other relevant posts before starting a new topic) ... but I still get 
> Permission denied.
> 
> 
> 
> 
> 
> Anyone?  
> 
> Thanks for whatever helpful info you can offer!

try
chmod 755 Console/cake

-- 
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: 3.0 - Fixtures ?

2014-04-14 Thread Thomas von Hassel
I'm using this to import them:

public $fixtures = [
'plugin.plugin_name.my_table'
];


and the fixture class is in 

Plugin/PluginName/Test/Fixture/MyTableFixture.php

but gives me this error when trying run the test:

Notice Error: Undefined offset: 1 in 
[/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureManager.php, line 143]



On 14 Apr 2014, at 11:39, José Lorenzo  wrote:

> No, they should work fine. What is the problem you are getting and how are 
> you importing them?
> 
> On Sunday, April 13, 2014 5:38:24 PM UTC+2, Thomas von Hassel wrote:
> am i right to assume that fixtures, in particular in plugins, are not working 
> in 3.x yet ? 
> 
> /thomas 
> 
> 
> -- 
> 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.

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


3.0 - Fixtures ?

2014-04-13 Thread Thomas von Hassel
am i right to assume that fixtures, in particular in plugins, are not working 
in 3.x yet ?

/thomas

-- 
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: Console/cake schema pitfalls ?

2014-03-24 Thread Thomas von Hassel
Ok, i remember now, i need to generate some cols as MEDIUMTEXT or  LONGTEXT but 
the Schema only saves those as "text"

Is there a good way around this ?

/thomas



On 24 Mar 2014, at 13:28, Thomas von Hassel  wrote:

> Last time i tried to use Console/cake schema (early days 2.x) to mange my 
> databases and their changes, there were some issues with field types. (i'm 
> sorry but i forgot what exactly was the problem)
> 
> Are there any pitfalls today ? ... and is this functionality going to make it 
> into 3.0 ?
> 
> /thomas
> 
> 
> -- 
> 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.

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


Console/cake schema pitfalls ?

2014-03-24 Thread Thomas von Hassel
Last time i tried to use Console/cake schema (early days 2.x) to mange my 
databases and their changes, there were some issues with field types. (i'm 
sorry but i forgot what exactly was the problem)

Are there any pitfalls today ? ... and is this functionality going to make 
it into 3.0 ?

/thomas

-- 
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 3.0.0 development preview 2 released

2014-03-13 Thread Thomas von Hassel
No, a PostsController will try to load a table class called PostsTable 
automagically

/thomas


On 13 Mar 2014, at 21:29, Christopher Castro  wrote:

> Hi,
> 
> I'm taking a look to the new ORM, and I've noticed there is no longer 
> Controller::$uses.
> we have to use loadModel() instead? No more model autoloading?  :(
> 
> Great work btw
> 
> 
> 2014-03-13 16:11 GMT+01:00 José Lorenzo :
> Sorry, I made a mistake in my previous paste, This is a new version 
> http://bin.cakephp.org/saved/120567
> 
> There was another thread with the same topic here in the group, you may want 
> to check it to know how it is supposed to work if you create your Entity 
> class.
> 
> 
> On Thursday, March 13, 2014 4:09:36 PM UTC+1, José Lorenzo wrote:
> Yeah, you need an entity class or do the following:
> 
> http://bin.cakephp.org/saved/120566
> 
> Check the modified lines in the add() method. This is just a workaround if 
> you don't want a custom entity. We hope to make this easier and more clear in 
> the future.
> 
> On Thursday, March 13, 2014 4:03:08 PM UTC+1, André Luis wrote:
> My Controller: http://bin.cakephp.org/saved/120565
> I didnt create any entity yet, but the index and view are working very well.
> 
> -- 
> 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.
> 
> 
> 
> -- 
> Christopher Castro.
> Analista Programador Senior PHP/MySQL
> Pamplona, España
> QuickApps CMS
> 
> 
> -- 
> 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.

-- 
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: Nested Templating?

2014-03-12 Thread Thomas von Hassel
You should look into elements and view blocks

http://book.cakephp.org/2.0/en/views.html#using-view-blocks

http://book.cakephp.org/2.0/en/views.html#elements


On 12 Mar 2014, at 00:22, Carlos Moreira  wrote:

> Hello All,
> 
> I am wondering if CakePHP has anything similar to what the .Net Framework has 
> with nested templates. 
> 
> This is what I am trying to do :
> 
> I want a specific menu to appear in all my views when I enter a certain 
> controller. What I am doing right now is placing the same navigation in all 
> my controllers views. So View,Edit,Delete etc... all have a special 
> navigation for that controller. But If I want to edit that navigation I need 
> to do it for as many views I have for that controller. 
> 
> 
> Is there a way to clean this up a bit? Maybe something I dont know about in 
> CakePHP,
> 
> Thank you
> 
> -- 
> 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.

-- 
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: Is Cake Dead Or Just Catching Up?

2014-03-11 Thread Thomas von Hassel
You can just do it the other way around: make the job into a CakePHP job 
(that's what i did)

/thomas

On 11 Mar 2014, at 13:29, Stephen S  wrote:

> OT: Pretty lucky really, I managed to land a job working with CakePHP last 
> November and where I live finding a CakePHP job is like finding a needle in a 
> haystack.
> 

-- 
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: Is Cake Dead Or Just Catching Up?

2014-03-11 Thread Thomas von Hassel
If you switch frameworks every 6 months you are doing it wrong.

So far CakePHP does what i need it to do, and i see no reason to shop around. 
Also, with the things coming in 3.0 I'm very optimistic about the direction the 
dev. team is taking.

In regards to traffic on the list/google group, i suspect a lot of newbies end 
up on Stack Overflow, and not here.

/thomas


On 11 Mar 2014, at 06:13, Advantage+  wrote:

> Looking at these stats is Cake dead?
>  
> http://www.sitepoint.com/best-php-frameworks-2014/
>  
> Can it keep up or catch up?
>  
> Over the years I would see 50 Cake messages a day, now it's lucky if you see 
> 2 topics with 1 response in the daily abridged update.
> Very few questions hit the inbox, less and less ever day.
>  
> Don't get me wrong I love Cake but is heading out to the pasture to call it a 
> day?
> Seems no longer a popular framework as others pop up.
>  
> Others are much faster, and have everything Cake has to offer and more.
>  
> Everyone has an opinion, let's see if anyone replies or too busy with other 
> frameworks J
>  
> 
> -- 
> 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.

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


  1   2   >