Hey,

> Only one thing : A gentleman.
> I a person use a forum It's for learn and not to say that your
> framework is a crap.
Who said something about crap ?
> If I use Cakephp maybe it's because I think that is light-years ahead
> of other frameworks.
You're right here ;)
> I post my code so you can see if I use good coding practices.
>
>
>
> class User extends AppModel
> {
>    var $useDbConfig = "myDb";
>    var $name = 'User';
>    var $useTable ="user";
>
>
>    var $primaryKey ="username";
>
>
>    var $hasAndBelongsToMany = array('Network' =>
>
> array('className'    => 'Network',
>                                          'joinTable'    => 'utente_gruppo',
>                                  'foreignKey'   => 'username',
>                                  'associationForeignKey'=> 'gruppo_id',
>
> 'order'        => 'gruppo_nome ASC'
>                                ));
>
>
>    var $hasMany = array('Ente' =>array('className'    => 'Ente',
>                                 'foreignKey'   => '',
>
> 'finderQuery'  => 'SELECT ........'
>                            ),
>                                     'Team' =>array('className'    =>
> 'Team',
>                                   'foreignKey'   => '',
>
> 'finderQuery'  => 'SELECT .......'
>                             )
>                    );
apart from that you don't use bind/unbind/contain whatever, you don't
set the needed field in the associations (really need all ?)

>
>
>
>
> }
>
>
>
>
> class UserController extends AppController
> {
>    var $name = 'User';
>
>   var $uses=array('Ente','Network','User','Team');
this is certainly_not_ good coding practice especially if they are associated.
you only need User there - and since its default then you can drop the
whole line.
$this->Model->AssociatedModel->find()

>   var $components = array('Auth');
>
>   function index($username="")
>    {
>      $utente = $this->User->read('',$username);
aren't you find-ing a user with a username ? or read.ing the username
with the it ? (there is a difference- api)

>     echo "<pre>";
>     pr($utente);
>     echo "</pre>";
>
>     $this->set('utente',$utente);
>    }
>
> }
>
>  The view is empty.
if you don't have a view = $this->autoRender = false;


And people code in English for a reason - so other people can
understand the code ;)

HTH,

-- 
Marcin Domanski
http://kabturek.info

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to