Yii Framework Forum: Rbam - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Rbam include a module class into another module Rate Topic: -----

#1 User is offline   firefly 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 21-May 12

Posted 29 October 2012 - 08:20 AM

Hello everybody,

In main.php file I have something like this:

'modules'=>array(
    'users' => array(
    ),
   'rbam'=>array(
       'userClass'=>'Users',
   ),
)


But the Users class is inside module users.
What should userClass property contain in order to include correctly the users class...

Of course, users class path is: modules/users/models/Users.php

Also I need to specify that:
users.Users
application.users.Users
application.modules.users.models.Users
modules/users/models/Users.php
are not working...

so:
'userClass'=>'application.users.Users'
,
produces :
include(application.users.Users.php): failed to open stream: No such file or directory warning
0

#2 User is offline   firefly 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 21-May 12

Posted 01 November 2012 - 05:54 AM

View Postfirefly, on 29 October 2012 - 08:20 AM, said:

Hello everybody,

In main.php file I have something like this:

'modules'=>array(
    'users' => array(
    ),
   'rbam'=>array(
       'userClass'=>'Users',
   ),
)


But the Users class is inside module users.
What should userClass property contain in order to include correctly the users class...

Of course, users class path is: modules/users/models/Users.php

Also I need to specify that:
users.Users
application.users.Users
application.modules.users.models.Users
modules/users/models/Users.php
are not working...

so:
'userClass'=>'application.users.Users'
,
produces :
include(application.users.Users.php): failed to open stream: No such file or directory warning


ok, I've figured it out... The main thing is that RBAM property userClass must be a class name not a path, something like:
'rbam'=>array(
            'userClass'=>'Users',
        ),


and the Users class, that it is in a module should be included separately like:
'import'=>array(
            'application.modules.users.models.Users',
	),

in to the main configuration file. Now everything is working as it should.

Hope that this will help someone.

PS If there are better solutions I am waiting for your reply.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users