Regarding App.Namespace

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Regarding App.Namespace

Hari K T
Hi all,

I was using Cakephp orm as a standalone tool.

One thing that I need to do was configure the App.namespace .

Configure::write('App.namespace', 'App');

Recently I came across something. I need to build a package, and the namespace of the package is different.

Say Hkt\Blog . Now I could read it if I have put the App.namespace to Hkt .

But if I kept the App.namespace to App for my default application it will load the base Entity and base Table class . By base I mean (Cake\ORM\Entity , Cake\ORM\Table ) .

Application

src/App/Model/Table/UsersTable.php
src/App/Model/Entity/User.php

Library

vendor/hkt/blog/src/Model/Table/PostsTable.php
vendor/hkt/blog/src/Model/Entity/Post.php

TableRegistry::get('Users') => Need to load App/Model/Table/UsersTable
TableRegistry::get('Posts') => Need to load Hkt/Blog/Model/Table/PostsTable , currently this loads Cake\ORM\Table .

Is there is a way to achieve what I am trying to do so I can have many vendor libraries that work with Cake orm can be installed. I know there may be something I missed or can do for it works for plugins in cakephp framework.

Thank you

Hari KT

--
Like Us on FaceBook https://www.facebook.com/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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Regarding App.Namespace

Hari K T
Hi all,

So this is no longer a problem for I have found a solution via the https://github.com/cakephp/cakephp/pull/8055 .

I hope you guys will consider merging as soon as possible so I / others can benefit from it.

Thank you

Hari K T

You can ring me : +91 9388 75 8821

Skype  : kthari85
Twitter : harikt

On Sun, Jan 17, 2016 at 10:15 PM, Hari K T <[hidden email]> wrote:
Hi all,

I was using Cakephp orm as a standalone tool.

One thing that I need to do was configure the App.namespace .

Configure::write('App.namespace', 'App');

Recently I came across something. I need to build a package, and the namespace of the package is different.

Say Hkt\Blog . Now I could read it if I have put the App.namespace to Hkt .

But if I kept the App.namespace to App for my default application it will load the base Entity and base Table class . By base I mean (Cake\ORM\Entity , Cake\ORM\Table ) .

Application

src/App/Model/Table/UsersTable.php
src/App/Model/Entity/User.php

Library

vendor/hkt/blog/src/Model/Table/PostsTable.php
vendor/hkt/blog/src/Model/Entity/Post.php

TableRegistry::get('Users') => Need to load App/Model/Table/UsersTable
TableRegistry::get('Posts') => Need to load Hkt/Blog/Model/Table/PostsTable , currently this loads Cake\ORM\Table .

Is there is a way to achieve what I am trying to do so I can have many vendor libraries that work with Cake orm can be installed. I know there may be something I missed or can do for it works for plugins in cakephp framework.

Thank you

Hari KT

--
Like Us 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/FfZxFz6vaX8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

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

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