Groups
Groups
Sign in
Groups
Groups
日本Symfonyユーザー会
Conversations
About
Send feedback
Help
指定したパスに存在する Entity を利用する
29 views
Skip to first unread message
yuki
unread,
Apr 24, 2014, 9:13:31 PM
4/24/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to symfony-...@googlegroups.com
Symfony2 勉強中の yuki です。
Entity の読み込みについて、特定の prefix の Entity を指定したパスから読み込むようにしたいのですが、
そのようなことは可能でしょうか。
たとえばですが、
use Common\Entity\User;
という指定をした場合は、/var/www/common/entity/User.php を読み込み利用するようにしたいのです。
ご助言いただけましたらうれしいですm(_ _)m
hiromi hishida
unread,
Apr 24, 2014, 9:25:57 PM
4/24/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to symfony-...@googlegroups.com
composerのautoloadを使うか、Symfony\Component\ClassLoaderを使うことで実現できると思います。
ClassLoaderのドキュメントは少し古いですが
http://docs.symfony.gr.jp/symfony2/components/class_loader.html
にあります。
composerのautoloadのドキュメントはここにあります。特に依存ライブラリがなくてもautoloadだけ使うことができます。
https://getcomposer.org/doc/01-basic-usage.md#autoloading
2014年4月25日 10:13 yuki <
iphones...@gmail.com
>:
> --
> --
> -------------------
> Symfonyに関する疑問・質問、ユーザー会の活動やサイトに対するご意見、その他雑談など、お気軽にMLへ投稿してください!
>
>
> 日本Symfonyユーザー会
>
http://www.symfony.gr.jp/
>
> 日本Symfonyユーザー会メーリングリスト
>
http://groups.google.com/group/symfony-users-ja
>
> ---
> このメールは Google グループのグループ「日本Symfonyユーザー会」に登録しているユーザーに送られています。
> このグループから退会し、グループからのメールの配信を停止するには
>
symfony-users-...@googlegroups.com
にメールを送信してください。
> その他のオプションについては
https://groups.google.com/d/optout
にアクセスしてください。
--
-------------------------------
菱田裕美
-------------------------------
yuki
unread,
Jun 9, 2014, 1:48:57 AM
6/9/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to symfony-...@googlegroups.com
菱田さま
ご返答いただきましてありがとうございます。
いただいたアドバイスをもとに autoload にて設定をおこなったところ、
希望どおりの動作をさせることができました。
大変ご丁寧に関連ドキュメントもご教示いただき、誠にありがとうございます。
お礼が遅くなり大変申し訳ありませんでした。
2014年4月25日金曜日 10時25分57秒 UTC+9 77web:
Reply all
Reply to author
Forward
0 new messages