Tuesday, September 30, 2014

Re: i18n base language and database fields

Hi!

I suggest you use your solution c), so make everything in English by __()  and do the translation when your application is ready by extracting the .pot files. Extremely easy.

Regards,

Luc

On Monday, September 29, 2014 5:55:20 PM UTC+2, Radharadhya Dasa wrote:
Hi,

I follow cakePHP conventions, so my database tables and fields have english names, as it so for cake's default error messages. I am building a webapp for a Hungarian client. I would like to use i18n as I think later the client will need internationalizing and localizing. But for now they do not need it.

So I do not want to create all my view files strings in English and than translate to Hungarian, but I want to use translate behaviour to translate database field names to Hungarian.

What is the best approach for this scenario?

rrd

--
Like Us on FaceBook https://www.facebook.com/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+unsubscribe@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 autocomplete

Yes, you should have a form template called autocomplete which your widget is using.


HTH

T

On Wed, Oct 1, 2014 at 10:01 AM, Radharadhya Dasa <rrd@krisna.hu> wrote:


> Show us the from template for autocomplete

I do not have anything else. Should I?

Rrd

>
> T
>
> On Tue, Sep 30, 2014 at 7:59 PM, Radharadhya Dasa <rrd@1108.cc> wrote:
>>
>> 1. /src/View/Widget/Autocomplete.php
>>
>> <?php
>> namespace App\View\Widget;
>>
>> use Cake\View\Widget\WidgetInterface;
>> use Cake\View\Form\ContextInterface;
>>
>> class Autocomplete implements WidgetInterface {
>>
>>     protected $_templates;
>>
>>     public function __construct($templates) {
>>         $this->_templates = $templates;
>>     }
>>
>>     public function render(array $data, ContextInterface $context) {
>>         $data += [
>>             'name' => '',
>>         ];
>>         return $this->_templates->format('autocomplete', [
>>             'name' => $data['name'],
>>             'attrs' => $this->_templates->formatAttributes($data, ['name'])
>>         ]);
>>     }
>>    
>>     public function secureFields(array $data){
>>        return [];
>>     }
>> }
>> ?>
>>
>> 2. /src/Controller/AppController.php
>>
>> <?php
>> namespace App\Controller;
>>
>> use Cake\Controller\Controller;
>> use Cake\Event\Event;
>>
>> class AppController extends Controller {
>>
>>     public $components = [
>>         'Flash',
>>         'Auth' => [
>>             'loginRedirect' => [
>>                 'controller' => 'users',
>>                 'action' => 'view'
>>             ],
>>             'logoutRedirect' => [
>>                 'controller' => 'Pages',
>>                 'action' => 'display',
>>                 'home'
>>             ]
>>         ]
>>     ];
>>    
>>     public $helpers = [
>>         'Form' => [
>>             'widgets' => [
>>                 'autocomplete' => [
>>                     'App\View\Widget\Autocomplete',
>>                     'text',
>>                     'label'
>>                 ]
>>             ]
>>         ]
>>     ];
>>
>>     public function beforeFilter(Event $event) {
>>         $this->Auth->deny();
>>     }
>> }
>>
>>
>>
>> 3. /src/Template/Contacts/add.ctp
>>
>> <div class="actions columns large-2 medium-3">
>>     <h3><?= __('Actions') ?></h3>
>>     <ul class="side-nav">
>>         <li><?= $this->Html->link(__('List Contacts'), ['action' => 'index']) ?></li>
>>     </ul>
>> </div>
>> <div class="contacts form large-10 medium-9 columns">
>> <?= $this->Form->create($contact) ?>
>>     <fieldset>
>>         <legend><?= __('Add Contact'); ?></legend>
>>     <?php
>>         echo $this->Form->autocomplete('name');
>>     ?>
>>     </fieldset>
>> <?= $this->Form->button(__('Submit')) ?>
>> <?= $this->Form->end() ?>
>> </div>
>>
>>
>>
>> Result: In the generated html there is no input for name at all.
>>
>> rrd
>>
>>
>> 2014. szeptember 30., kedd 14:33:24 UTC+2 időpontban Radharadhya Dasa a következőt írta:
>>>
>>> Hi,
>>>
>>> I am trying to make an autocomplete input work on Cake 3.0
>>>
>>> The current 3.0 cookbook gives a code example here : http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html
>>>
>>> If I try it I get an error message:
>>> Fatal error: Declaration of App\View\Widget\Autocomplete::render() must be compatible with Cake\View\Widget\WidgetInterface::render(array $data, Cake\View\Form\ContextInterface $context) in /home/rrd/public_html/sanga/src/View/Widget/Autocomplete.php on line 6
>>>
>>> If I change my render function to
>>> public function render(array $data, Cake\View\Form\ContextInterface $context) {
>>>
>>> Still I get the same error message.
>>>
>>> Any idea how to solve this?
>>>
>>> rrd
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/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+unsubscribe@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+unsubscribe@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+unsubscribe@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+unsubscribe@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 autocomplete


> Show us the from template for autocomplete

I do not have anything else. Should I?

Rrd

>
> T
>
> On Tue, Sep 30, 2014 at 7:59 PM, Radharadhya Dasa <rrd@1108.cc> wrote:
>>
>> 1. /src/View/Widget/Autocomplete.php
>>
>> <?php
>> namespace App\View\Widget;
>>
>> use Cake\View\Widget\WidgetInterface;
>> use Cake\View\Form\ContextInterface;
>>
>> class Autocomplete implements WidgetInterface {
>>
>>     protected $_templates;
>>
>>     public function __construct($templates) {
>>         $this->_templates = $templates;
>>     }
>>
>>     public function render(array $data, ContextInterface $context) {
>>         $data += [
>>             'name' => '',
>>         ];
>>         return $this->_templates->format('autocomplete', [
>>             'name' => $data['name'],
>>             'attrs' => $this->_templates->formatAttributes($data, ['name'])
>>         ]);
>>     }
>>    
>>     public function secureFields(array $data){
>>        return [];
>>     }
>> }
>> ?>
>>
>> 2. /src/Controller/AppController.php
>>
>> <?php
>> namespace App\Controller;
>>
>> use Cake\Controller\Controller;
>> use Cake\Event\Event;
>>
>> class AppController extends Controller {
>>
>>     public $components = [
>>         'Flash',
>>         'Auth' => [
>>             'loginRedirect' => [
>>                 'controller' => 'users',
>>                 'action' => 'view'
>>             ],
>>             'logoutRedirect' => [
>>                 'controller' => 'Pages',
>>                 'action' => 'display',
>>                 'home'
>>             ]
>>         ]
>>     ];
>>    
>>     public $helpers = [
>>         'Form' => [
>>             'widgets' => [
>>                 'autocomplete' => [
>>                     'App\View\Widget\Autocomplete',
>>                     'text',
>>                     'label'
>>                 ]
>>             ]
>>         ]
>>     ];
>>
>>     public function beforeFilter(Event $event) {
>>         $this->Auth->deny();
>>     }
>> }
>>
>>
>>
>> 3. /src/Template/Contacts/add.ctp
>>
>> <div class="actions columns large-2 medium-3">
>>     <h3><?= __('Actions') ?></h3>
>>     <ul class="side-nav">
>>         <li><?= $this->Html->link(__('List Contacts'), ['action' => 'index']) ?></li>
>>     </ul>
>> </div>
>> <div class="contacts form large-10 medium-9 columns">
>> <?= $this->Form->create($contact) ?>
>>     <fieldset>
>>         <legend><?= __('Add Contact'); ?></legend>
>>     <?php
>>         echo $this->Form->autocomplete('name');
>>     ?>
>>     </fieldset>
>> <?= $this->Form->button(__('Submit')) ?>
>> <?= $this->Form->end() ?>
>> </div>
>>
>>
>>
>> Result: In the generated html there is no input for name at all.
>>
>> rrd
>>
>>
>> 2014. szeptember 30., kedd 14:33:24 UTC+2 időpontban Radharadhya Dasa a következőt írta:
>>>
>>> Hi,
>>>
>>> I am trying to make an autocomplete input work on Cake 3.0
>>>
>>> The current 3.0 cookbook gives a code example here : http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html
>>>
>>> If I try it I get an error message:
>>> Fatal error: Declaration of App\View\Widget\Autocomplete::render() must be compatible with Cake\View\Widget\WidgetInterface::render(array $data, Cake\View\Form\ContextInterface $context) in /home/rrd/public_html/sanga/src/View/Widget/Autocomplete.php on line 6
>>>
>>> If I change my render function to
>>> public function render(array $data, Cake\View\Form\ContextInterface $context) {
>>>
>>> Still I get the same error message.
>>>
>>> Any idea how to solve this?
>>>
>>> rrd
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/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+unsubscribe@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+unsubscribe@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+unsubscribe@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-beta2 released

What is the link to the Migrations plugin?

T

On Tue, Sep 30, 2014 at 4:44 AM, Reuben <reuben.helms@gmail.com> wrote:
Super excited for separate packages, and using components inside other applications.


On Sunday, 28 September 2014 23:49:02 UTC+10, José Lorenzo wrote:

The CakePHP core team is proud to announce the second beta release for CakePHP 3.0.0.
It's been a month since our first beta release, and we are excited by the big welcome the community has given to the new version. All the positive feedback and help has been a great motivation for the core team to work harder on improving the developer experience for 3.0.

This will be the last beta release for 3.0, this means that the API is already stabilizing and we're mostly focusing on polishing the current features, performance optimizations, documentation and quickly solving any issues reported in Github.

We've had a very busy month implementing a few missing features we had in our roadmap and upgrading some of the popular plugins for CakePHP.

Below the list of new features and changes that made it into 3.0.0-beta2:

DebugKit

Debugging CakePHP 3.0 applications is even better. The new DebugKit is easier to install, faster and looks gorgeous.

DebugKit is a application toolbar that collects useful statistics about your code such as time and memory, executed queries, log messages and view variables. To install Debugkit just use

composer require cakephp/debug_kit "3.0.*-dev"  

And add this line to your bootstrap.php file:

Plugin::load('DebugKit', ['bootstrap' => true]);  

If you install a new application using the app skeleton, DebugKit will be automatically installed for you.

Database Migrations

Migrations is now an official CakePHP plugin. It wraps the excellent Phinx library into a CakePHP shell to avoid repeating configuration strings and add some of the cake experience. A database migration generated by this plugin would look like:

<?php  use Phinx\Migration\AbstractMigration;  class CreateUsersTable extends AbstractMigration {      /**       * Change.       */      public function change() {          // create the table          $table = $this->table('users');          $table->addColumn('id', 'integer')              ->addColumn('username', 'string')              ->addColumn('password', 'string')              ->addColumn('created', 'datetime')              ->create();      }  

Migrations are reversible. This means that with the same code you can create or rollback the changes done to the database schema.

To install the Migrations plugins run:

composer require cakephp/migrations "dev-master"  

And add this line to your bootstrap.php file:

Plugin::load('Migrations');  

New Logger interface

CakePHP has adopted the PSR-3 recommendation for loggers. Now all log engines implement the Prs\Log\LoggerInterface interface. This means that the entire logging system can easily be replaced by other implementations, such as the popular Monolog library.

Integration Tests and Data Integrity

Testing controllers has always been problematic. While ControllerTestCase solved some of the problems, we identified this class as a source of problems and confusion among our users. We decided to implement the new IntegrationTestCase class as a way totest all aspects of an HTTP request in your application without much mocking being involved. This should help you improve code quality and ensure that your application and routes are working as expected.

We also made the fixtures system better, allowing developers to define and work with foreign key constraints in their database. The fixtures system will now correctly load all data and enable constraints right before your test code is executed.

New Bake templates

With the date for a stable release getting closer and closer we decided to give a new look to default baked applications. Hopefully the new look will feel fresher, more modern, and easier to work with.

Separate packages

We've seen an increasing interest in using the new ORM outside the framework or within older CakePHP applications. One of our goals since the start has been making this possible. We have already begun the work to split the framework into various standalone components that can be reused and installed with composer. While the ORM has not yet been extracted into its own repository, most of the necessary pre-requisites are complete. As a product of this work, we have already extracted several components out of the main code base:

  • Collections: Provides a set of tools to manipulate arrays or Traversable objects in an efficient and elegant way.
  • Validation: The excellent and flexible validation library can now be used in any project!
  • Utility: Provides the Hash, Inflector, String and Xml classes.
  • Event: Our Signal-Slot (or Observer Pattern) implementation.
  • Core: The CakePHP core, containing the Configuration and Plugin management classes.

It is important to note that the these repositories are read-only, development will continue in the main CakePHP repository and code will be synchronized regularly to these splits. Please open any ticket or pull request directly in the main github repository.

ORM Related Improvements

  • Added Query::autoFields(). This controls whether the fields for the main table are automatically selected.
  • Ability to pass finder options to custom finders from the paginator by using the finderOptions key.
  • It is now possible to get the default column values out of the database using the Schema\Table::defaultValue().
  • Added accessibleFields as an option key for newEntity() and patchEntity(). This will allow finer grain control for mass-assignment.
  • TranslateBehavior automatically finds translations based on the current application locale.
  • Table::findOrCreate() was added.
  • Ability to override the join type for an association using contain()

Plugin Shells

Shells in plugins can now be called without prefixing with the plugin name. For example for a do_stuff shell living in the Tools plugin, you can execute:

bin/cake do_stuff  

Other improvements

  • New uploadedFile validation rule.
  • Made String::uuid() 3 times faster.
  • Better exception reporting on fatal errors.
  • Inflector was optimized for better performance.
  • Several optimizations in the Hash class.
  • Added Collection::buffered() to transform non-rewindable iterators in rewindable ones.

Community Plugins

More plugins for version 3.0 are starting to pop. Here's a list of what we found interesting:

  • TwigView Use Twig as the default templating engine.
  • Imagine Image manipulation plugin
  • Geo Contains utility libraries and behaviors for working with geo data.
  • Blame Records the user id who modified a row in the database.
  • CakePdf Generates PDF files using different engines
  • Authenticate Authorization and Authentication adapters
  • TinyAuth A lightweight authorization system.
  • TwitterBootstrap A plugin to generate Boostraped interfaces
  • Whoops Replaces the default exception renderer with a nice debugging interface.
  • Assetic Minifies and pre-processes CSS and Javascript We'd like to thank again everyone who has contributed thoughts, code, documentation or feedback to 3.0 so far.

--
Like Us on FaceBook https://www.facebook.com/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+unsubscribe@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+unsubscribe@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 autocomplete

Show us the from template for autocomplete

T

On Tue, Sep 30, 2014 at 7:59 PM, Radharadhya Dasa <rrd@1108.cc> wrote:
1. /src/View/Widget/Autocomplete.php

<?php
namespace App\View\Widget;

use Cake\View\Widget\WidgetInterface;
use Cake\View\Form\ContextInterface;

class Autocomplete implements WidgetInterface {

   
protected $_templates;

   
public function __construct($templates) {
        $this
->_templates = $templates;
   
}

   
public function render(array $data, ContextInterface $context) {
        $data
+= [
           
'name' => '',
       
];
       
return $this->_templates->format('autocomplete', [
           
'name' => $data['name'],
           
'attrs' => $this->_templates->formatAttributes($data, ['name'])
       
]);
   
}
   
   
public function secureFields(array $data){
       
return [];
   
}
}
?>

2. /src/Controller/AppController.php

<?php
namespace App\Controller;

use Cake\Controller\Controller;
use Cake\Event\Event;

class AppController extends Controller {

   
public $components = [
       
'Flash',
       
'Auth' => [
           
'loginRedirect' => [
               
'controller' => 'users',
               
'action' => 'view'
           
],
           
'logoutRedirect' => [
               
'controller' => 'Pages',
               
'action' => 'display',
               
'home'
           
]
       
]
   
];
   
   
public $helpers = [
       
'Form' => [
           
'widgets' => [
               
'autocomplete' => [
                   
'App\View\Widget\Autocomplete',
                   
'text',
                   
'label'
               
]
           
]
       
]
   
];

   
public function beforeFilter(Event $event) {
        $this
->Auth->deny();
   
}
}



3. /src/Template/Contacts/add.ctp

<div class="actions columns large-2 medium-3">
   
<h3><?= __('Actions') ?></h3>
   
<ul class="side-nav">
       
<li><?= $this->Html->link(__('List Contacts'), ['action' => 'index']) ?></li>
   
</ul>
</div>
<div class="contacts form large-10 medium-9 columns">
<?= $this->Form->create($contact) ?>
   
<fieldset>
       
<legend><?= __('Add Contact'); ?></legend>
   
<?php
        echo $this
->Form->autocomplete('name');
   
?>
   
</fieldset>
<?= $this->Form->button(__('Submit')) ?>
<?= $this->Form->end() ?>
</div>



Result: In the generated html there is no input for name at all.

rrd


2014. szeptember 30., kedd 14:33:24 UTC+2 időpontban Radharadhya Dasa a következőt írta:
Hi,

I am trying to make an autocomplete input work on Cake 3.0

The current 3.0 cookbook gives a code example here : http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html

If I try it I get an error message:
Fatal error: Declaration of App\View\Widget\Autocomplete::render() must be compatible with Cake\View\Widget\WidgetInterface::render(array $data, Cake\View\Form\ContextInterface $context) in /home/rrd/public_html/sanga/src/View/Widget/Autocomplete.php on line 6

If I change my render function to
public function render(array $data, Cake\View\Form\ContextInterface $context) {

Still I get the same error message.

Any idea how to solve this?

rrd

--
Like Us on FaceBook https://www.facebook.com/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+unsubscribe@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+unsubscribe@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: The (bad) perception and image of CakePHP in the public

#1 Mature and consistent 
#2 An active and friendly developer community
#3 Does not break backward compatibility every few months (I am looking at you Laravel 5)

T



On Wed, Oct 1, 2014 at 3:55 AM, Reuben Helms <reuben.helms@gmail.com> wrote:
My 3 reasons:

1. CakePHP can integrate with legacy code. It only takes a little bit of fiddling, but it was one of the primary reasons I went for it.
2. Convention over configuration, but not at the expense of no configuration. Working with legacy databases, it was good that Models in CakePHP could be configured to work with tables that didn't fit the ideal convention.
3. Documentation / code readability. Whilst separate, if I can't work out how a feature works in the documentation, I can go to the code and work it out from there.  With the exception of the events system, I find the code easy to read and navigate.

Those are 3 that come to mind. Now that I've been using it for several years, there are additional reasons to stay, like my investment in learning, community, approachability of the core team.

On Tue, Sep 30, 2014 at 6:28 PM, José Lorenzo <jose.zap@gmail.com> wrote:
Before giving my own view into this problem, you you guys list the reasons why you think CakePHP is a cool or productive framework to work with? Just give me 3 reasons, no comparisons with other frameworks


On Tuesday, September 30, 2014 6:24:30 AM UTC+2, Jeremy Burns wrote:
This is so true. I'm a huge fan of Cake but we do feel like the whipping boys sometimes. I recently hired someone into a project and the first thing he tried to do was change the framework for a whole bunch of vague reasons like 'Laravel is just so much better'.

Perhaps someone can devise some simple benchmarking challenges that the guardians of the various frameworks can take up themselves and then compare the actual results, rather than letting a random person do it out of the box. A competition, if you will. So, for example, write a thousand records to a database, read them back, perform some function and render them to screen. Yes, yes, I know there would need to be some element of a level playing field with server spec and the like, but it could be done. Then each framework can show it's own best efforts and - importantly - will have no excuses about not understanding the framework or setting it up correctly.

I haven't had a 'job' for the past six years, but on the odd time that I decide a regular income would be nice I rarely - if ever - see CakePHP as a requirement. It's always Symfony, Zend, Drupal, Code Ingniter, sometimes Laravel, sometimes ROR and sometimes something else. That's awkward and I just can't help wondering if I am swimming against a tide. Perhaps everyone else is right and I am wrong? TBH, I'm not clever enough to be able to explain why Cake is the right choice compared to others; some help there would be cool.

On 30 Sep 2014, at 00:43, Reuben <reuben.helms@gmail.com> wrote:

My apologies, dereuromark, for the incorrect spelling of your handle.

On Tuesday, 30 September 2014 09:40:31 UTC+10, Reuben wrote:
The few times that I've seen CakePHP compared to other PHP frameworks is in performance tests, and it never looks pretty.  Usually the test is a very simple Hello World test, or an action that reads/writes a bunch of records to the database.  Not really real work tests, and no effort to configure the application to make sure it's doing the best that it can (i.e. appropriate cache options, etc).  

There have been a few articles written on CakePHP and performance, and all the stuff you can do before complaining about the framework itself.

Unfortunately, when people are comparing PHP frameworks, they just look for that performance index, and don't take too much notice of the merits of the performance test taken.

My perception is that at last check, there might be room for improvement in the event model, but I don't do all the other things that can be done to get better performance out of CakePHP, before going there, so it's never been an issue for me.  I also understand that start up times have been improved with CakePHP 3, and the routing configuration required.

Of course, CakePHP is more than just performance of the framework.  The documentation is great, the community is great and the core development team are very approachable, via groups, irc and github issues. And the code itself, should you need to look at it, is very readable.  The only part that makes my brain hurt a little is the event system, especially when trying to work out, when this event is fired, what is listening for it in the CakePHP core.  

Maybe there could be some articles written about the CakePHP core, to make TheBakery a little more attractive to read. I'm more likely to read CakePHP articles from Mark Story, AD7six or deuromark than peruse the 1 or 2 paragraph articles on TheBakery.

Regards
Reuben Helms

On Tuesday, 30 September 2014 07:15:54 UTC+10, Florian Krämer wrote:
In the official CakePHP Facebook group Yanuar Nurcahyo asked about opinions on that link http://www.quora.com/Why-isnt-Cakephp-popular-despite-being-one-of-the-earliest-php-framework-to-be-written

I'll quote my own comment I've added to that posting:

I'm a little shocked about the wrong information people spreading there as well as the amount of false information. Especially the one that got 4 up-votes. Most of the answers there read like FUD or written by people who can't or won't read documentation. Also I really don't get why people always "need" bleeding edge php support. There is no urgent need or do you migrate you app / server to a new php version just because it's cool? The only problem that CakePHP has is an image problem.

What I would like to discuss in this thread is reasons and solution to them. Why has CakePHP such a negative perception? The thing that bothers me personally the most is why the *uck do people say it has a bad documentation? Seriously, I don't get it. Can't they find the documentation? Can't they use it? Or is it really just FUD by some <random-framework> fanboys?

The "stone age php version" isn't a very valid argument IMHO. Yes, I agree, CakePHP felt behind other frameworks for at least ~2 years and I've missed the namespace support more than one time. But that was really the only language feature I was really missing. Everything else is sugar on top of the cake. I don't know if other people update their servers and apps for fun and if they do the required testing for free for their clients...but well, looks like some guys out there have more a cowboy-coder attitude than a professional one.

Also I don't get why people complain about the architecture of CakePHP, yes it is different, yes it gives you everything out of the box and isn't a package made of 100 loose libs and then glued together. This is IMHO actually an advantage and makes it easy to get started with it. And seriously, how often do you change the ORM stack of <random-framework> in reality? And on top of that, CakePHP 3.0, as far as I can tell, is more decoupled than 2.0 was. For example the face pattern in Laravel is, as far as I've worked with it and understood it, just one way you can use for dependency injection. The face seems to works like a proxy. I might be wrong, I haven't spent much time with it yet. SF2 is using a container object to deal with the dependencies. However, my point here is other frameworks appear to be more fancy and by this attract people who are looking for fancy things, "interesting" design patterns and architecture. Which brings us back to the cowboy-coder attitude. Something doesn't has to be fancy to just work.

I know that for example Symfony gets a lot attention and exposure through having virtually one domain per component of their framework and a nice design for these sites and for whatever reason Symfony manages it somehow to get massive funding. Creating all these pages and a fancy design takes time and money. So I don't think doing something similar would be an option for CakePHP. Honestly I have no ideas what could be done to help making CakePHP look better (and stop these silly guys from spreading FUD). I would not mind all their critics at all if they would bring valid and detailed arguments. But everybody complaining about CakePHP is just repeating other peoples FUD about a bad documentation and not exactly mentioning what is wrong with the architecture. Going into a discussion is like going into a fight without a weapon. But well, the problem here is nobody fights these false "arguments". :(

I personally don't mind using Symfony2 or Laravel, they're good frameworks as well, but I don't think that CakePHP 3.0 has to hide in any aspect, nor had Cake2 when it was new. But CakePHP has a completely different philosophy than SF2 and Laravel, obviously one that people are not used to.

So, has anyone constructive critics about that? Maybe others here don't even think CakePHP has a problem with it's perception?

--
Like Us on FaceBook https://www.facebook.com/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+unsubscribe@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 a topic in the Google Groups "CakePHP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/NXgTsZ0COjc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cake-php+unsubscribe@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+unsubscribe@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+unsubscribe@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: The (bad) perception and image of CakePHP in the public

My 3 reasons:

1. CakePHP can integrate with legacy code. It only takes a little bit of fiddling, but it was one of the primary reasons I went for it.
2. Convention over configuration, but not at the expense of no configuration. Working with legacy databases, it was good that Models in CakePHP could be configured to work with tables that didn't fit the ideal convention.
3. Documentation / code readability. Whilst separate, if I can't work out how a feature works in the documentation, I can go to the code and work it out from there.  With the exception of the events system, I find the code easy to read and navigate.

Those are 3 that come to mind. Now that I've been using it for several years, there are additional reasons to stay, like my investment in learning, community, approachability of the core team.

On Tue, Sep 30, 2014 at 6:28 PM, José Lorenzo <jose.zap@gmail.com> wrote:
Before giving my own view into this problem, you you guys list the reasons why you think CakePHP is a cool or productive framework to work with? Just give me 3 reasons, no comparisons with other frameworks


On Tuesday, September 30, 2014 6:24:30 AM UTC+2, Jeremy Burns wrote:
This is so true. I'm a huge fan of Cake but we do feel like the whipping boys sometimes. I recently hired someone into a project and the first thing he tried to do was change the framework for a whole bunch of vague reasons like 'Laravel is just so much better'.

Perhaps someone can devise some simple benchmarking challenges that the guardians of the various frameworks can take up themselves and then compare the actual results, rather than letting a random person do it out of the box. A competition, if you will. So, for example, write a thousand records to a database, read them back, perform some function and render them to screen. Yes, yes, I know there would need to be some element of a level playing field with server spec and the like, but it could be done. Then each framework can show it's own best efforts and - importantly - will have no excuses about not understanding the framework or setting it up correctly.

I haven't had a 'job' for the past six years, but on the odd time that I decide a regular income would be nice I rarely - if ever - see CakePHP as a requirement. It's always Symfony, Zend, Drupal, Code Ingniter, sometimes Laravel, sometimes ROR and sometimes something else. That's awkward and I just can't help wondering if I am swimming against a tide. Perhaps everyone else is right and I am wrong? TBH, I'm not clever enough to be able to explain why Cake is the right choice compared to others; some help there would be cool.

On 30 Sep 2014, at 00:43, Reuben <reuben.helms@gmail.com> wrote:

My apologies, dereuromark, for the incorrect spelling of your handle.

On Tuesday, 30 September 2014 09:40:31 UTC+10, Reuben wrote:
The few times that I've seen CakePHP compared to other PHP frameworks is in performance tests, and it never looks pretty.  Usually the test is a very simple Hello World test, or an action that reads/writes a bunch of records to the database.  Not really real work tests, and no effort to configure the application to make sure it's doing the best that it can (i.e. appropriate cache options, etc).  

There have been a few articles written on CakePHP and performance, and all the stuff you can do before complaining about the framework itself.

Unfortunately, when people are comparing PHP frameworks, they just look for that performance index, and don't take too much notice of the merits of the performance test taken.

My perception is that at last check, there might be room for improvement in the event model, but I don't do all the other things that can be done to get better performance out of CakePHP, before going there, so it's never been an issue for me.  I also understand that start up times have been improved with CakePHP 3, and the routing configuration required.

Of course, CakePHP is more than just performance of the framework.  The documentation is great, the community is great and the core development team are very approachable, via groups, irc and github issues. And the code itself, should you need to look at it, is very readable.  The only part that makes my brain hurt a little is the event system, especially when trying to work out, when this event is fired, what is listening for it in the CakePHP core.  

Maybe there could be some articles written about the CakePHP core, to make TheBakery a little more attractive to read. I'm more likely to read CakePHP articles from Mark Story, AD7six or deuromark than peruse the 1 or 2 paragraph articles on TheBakery.

Regards
Reuben Helms

On Tuesday, 30 September 2014 07:15:54 UTC+10, Florian Krämer wrote:
In the official CakePHP Facebook group Yanuar Nurcahyo asked about opinions on that link http://www.quora.com/Why-isnt-Cakephp-popular-despite-being-one-of-the-earliest-php-framework-to-be-written

I'll quote my own comment I've added to that posting:

I'm a little shocked about the wrong information people spreading there as well as the amount of false information. Especially the one that got 4 up-votes. Most of the answers there read like FUD or written by people who can't or won't read documentation. Also I really don't get why people always "need" bleeding edge php support. There is no urgent need or do you migrate you app / server to a new php version just because it's cool? The only problem that CakePHP has is an image problem.

What I would like to discuss in this thread is reasons and solution to them. Why has CakePHP such a negative perception? The thing that bothers me personally the most is why the *uck do people say it has a bad documentation? Seriously, I don't get it. Can't they find the documentation? Can't they use it? Or is it really just FUD by some <random-framework> fanboys?

The "stone age php version" isn't a very valid argument IMHO. Yes, I agree, CakePHP felt behind other frameworks for at least ~2 years and I've missed the namespace support more than one time. But that was really the only language feature I was really missing. Everything else is sugar on top of the cake. I don't know if other people update their servers and apps for fun and if they do the required testing for free for their clients...but well, looks like some guys out there have more a cowboy-coder attitude than a professional one.

Also I don't get why people complain about the architecture of CakePHP, yes it is different, yes it gives you everything out of the box and isn't a package made of 100 loose libs and then glued together. This is IMHO actually an advantage and makes it easy to get started with it. And seriously, how often do you change the ORM stack of <random-framework> in reality? And on top of that, CakePHP 3.0, as far as I can tell, is more decoupled than 2.0 was. For example the face pattern in Laravel is, as far as I've worked with it and understood it, just one way you can use for dependency injection. The face seems to works like a proxy. I might be wrong, I haven't spent much time with it yet. SF2 is using a container object to deal with the dependencies. However, my point here is other frameworks appear to be more fancy and by this attract people who are looking for fancy things, "interesting" design patterns and architecture. Which brings us back to the cowboy-coder attitude. Something doesn't has to be fancy to just work.

I know that for example Symfony gets a lot attention and exposure through having virtually one domain per component of their framework and a nice design for these sites and for whatever reason Symfony manages it somehow to get massive funding. Creating all these pages and a fancy design takes time and money. So I don't think doing something similar would be an option for CakePHP. Honestly I have no ideas what could be done to help making CakePHP look better (and stop these silly guys from spreading FUD). I would not mind all their critics at all if they would bring valid and detailed arguments. But everybody complaining about CakePHP is just repeating other peoples FUD about a bad documentation and not exactly mentioning what is wrong with the architecture. Going into a discussion is like going into a fight without a weapon. But well, the problem here is nobody fights these false "arguments". :(

I personally don't mind using Symfony2 or Laravel, they're good frameworks as well, but I don't think that CakePHP 3.0 has to hide in any aspect, nor had Cake2 when it was new. But CakePHP has a completely different philosophy than SF2 and Laravel, obviously one that people are not used to.

So, has anyone constructive critics about that? Maybe others here don't even think CakePHP has a problem with it's perception?

--
Like Us on FaceBook https://www.facebook.com/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+unsubscribe@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 a topic in the Google Groups "CakePHP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/NXgTsZ0COjc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cake-php+unsubscribe@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+unsubscribe@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: Upload Plugin

I'm not entirely certain of "show" (embed, download, link?), but there is a MediaView for the purpose of displaying/downloading files.

http://book.cakephp.org/2.0/en/views/media-view.html

On Monday, September 29, 2014 6:12:49 PM UTC-4, Rafael Queiroz wrote:
Hi guys,

I'm using Upload Plugin 2.0 (https://github.com/josegonzalez/cakephp-upload), it works ridiculous automagic, it's perfect.
I need show upload file in my view, my model is User and field is photo, what is the best practice in this case?


--
Regards,

Rafael F. Queiroz

--
Like Us on FaceBook https://www.facebook.com/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+unsubscribe@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: The (bad) perception and image of CakePHP in the public

So I am a little afraid to jump into this, but I do feel like I can perhaps shed some light on the perception issue because I have a bit of a negative perception myself - but just about the documentation.  I have to admit that I am surprised that this seems like a mystery to some. 

I decided a couple of years ago to abandon Zend based on the direction it was going with ever increasing abstraction (and configuration complexity).  As a quick aside, I might be what you call a Cowboy Coder, but I've have been writing applications, front ends, back ends, tiered web applications, etc. for over 20 years in more languages than I care to count at the moment.  Cake PHP seemed to be the perfect complement of simplicity and flexibility for my needs.  Plus, you can stand up a CRUD application in minutes and it just works out of the box.

So, what's not to like?  Well, most of my applications are not simple CRUD apps and I am usually connecting to data sources (either databases or service APIs) that I don't control.  So of course that leads to custom configs and solutions that I need to code from scratch.  No problem, I like to code.  So maybe I am not looking in the right place for documentation, but I very rarely find what I need in the documentation.  If you stick to very simple apps using the standard conventions, you can find documentation for most things and examples for a few less things.  But there is nowhere (that I can find) a place to find an exhaustive doc on all of the available options (and how to set them) let alone examples of how to do so.  So thank God for stackoverflow where about 50% of the time I can find something that will point me toward a solution, but most of the time I end up just hacking away at options or looking at the CakePHP source code to figure how how things work.  My biggest issues have been with complex lookups using either custom queries, foreign keys that don't follow CakePHP conventions, multi-table joins, and the like. 

So for now I love the framework for all of its other features enough to stick with it.  Sometimes, though,  when it takes me more time just to figure out how CakePHP would want me to appraoch my problem that to have just coded the whole thing from scratch, I wonder if it is a good thing to stick with it.

I suspect that at least one big issue may be that the documentation is written in the DRY philosophy where nothing is repeated.  This is great for coding, but hard for a CakePHP newby when they have to hyperlink to six or seven different places to try to wrap their head around a concept.

On Monday, September 29, 2014 5:15:54 PM UTC-4, Florian Krämer wrote:
In the official CakePHP Facebook group Yanuar Nurcahyo asked about opinions on that link http://www.quora.com/Why-isnt-Cakephp-popular-despite-being-one-of-the-earliest-php-framework-to-be-written

I'll quote my own comment I've added to that posting:

I'm a little shocked about the wrong information people spreading there as well as the amount of false information. Especially the one that got 4 up-votes. Most of the answers there read like FUD or written by people who can't or won't read documentation. Also I really don't get why people always "need" bleeding edge php support. There is no urgent need or do you migrate you app / server to a new php version just because it's cool? The only problem that CakePHP has is an image problem.

What I would like to discuss in this thread is reasons and solution to them. Why has CakePHP such a negative perception? The thing that bothers me personally the most is why the *uck do people say it has a bad documentation? Seriously, I don't get it. Can't they find the documentation? Can't they use it? Or is it really just FUD by some <random-framework> fanboys?

The "stone age php version" isn't a very valid argument IMHO. Yes, I agree, CakePHP felt behind other frameworks for at least ~2 years and I've missed the namespace support more than one time. But that was really the only language feature I was really missing. Everything else is sugar on top of the cake. I don't know if other people update their servers and apps for fun and if they do the required testing for free for their clients...but well, looks like some guys out there have more a cowboy-coder attitude than a professional one.

Also I don't get why people complain about the architecture of CakePHP, yes it is different, yes it gives you everything out of the box and isn't a package made of 100 loose libs and then glued together. This is IMHO actually an advantage and makes it easy to get started with it. And seriously, how often do you change the ORM stack of <random-framework> in reality? And on top of that, CakePHP 3.0, as far as I can tell, is more decoupled than 2.0 was. For example the face pattern in Laravel is, as far as I've worked with it and understood it, just one way you can use for dependency injection. The face seems to works like a proxy. I might be wrong, I haven't spent much time with it yet. SF2 is using a container object to deal with the dependencies. However, my point here is other frameworks appear to be more fancy and by this attract people who are looking for fancy things, "interesting" design patterns and architecture. Which brings us back to the cowboy-coder attitude. Something doesn't has to be fancy to just work.

I know that for example Symfony gets a lot attention and exposure through having virtually one domain per component of their framework and a nice design for these sites and for whatever reason Symfony manages it somehow to get massive funding. Creating all these pages and a fancy design takes time and money. So I don't think doing something similar would be an option for CakePHP. Honestly I have no ideas what could be done to help making CakePHP look better (and stop these silly guys from spreading FUD). I would not mind all their critics at all if they would bring valid and detailed arguments. But everybody complaining about CakePHP is just repeating other peoples FUD about a bad documentation and not exactly mentioning what is wrong with the architecture. Going into a discussion is like going into a fight without a weapon. But well, the problem here is nobody fights these false "arguments". :(

I personally don't mind using Symfony2 or Laravel, they're good frameworks as well, but I don't think that CakePHP 3.0 has to hide in any aspect, nor had Cake2 when it was new. But CakePHP has a completely different philosophy than SF2 and Laravel, obviously one that people are not used to.

So, has anyone constructive critics about that? Maybe others here don't even think CakePHP has a problem with it's perception?

--
Like Us on FaceBook https://www.facebook.com/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+unsubscribe@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.

BindModel on Instantiated model

i'm trying do that, but with no success... if someone can help me or just say if it is possible.

class myModel extends AppModel {

public function addmodel() {

$Model= new Model(); 

        $Model->bindModel(array(
            'HasMany' => array(
                'otherModel'
            )
                )
        );

}
}

returns this error: 

 Indirect modification of overloaded property Model::$HasMany has no effect [APP\Vendor\cakephp\cakephp\lib\Cake\Model\Model.php, line 938]


--
Like Us on FaceBook https://www.facebook.com/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+unsubscribe@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.