Recently I added a telegram bot extension in my Yii2 application to use it. but actually it is not a Yii2 extension but its a normal php namespace structured files and classes.
the name of this telegram extension is irazasyed/telegram-bot-sdk
actualy its the name that added to my composer.json
. I want to know how can I make some classess like this extension?
the irazasyed/telegram-bot-sdk
structure is like this:
vandor >>
irazasyed
telegram-bot-sdk
composer.json
license
src
class1.php
class2.php
and the class files can be accessed from the namespace like \Telegram\Bot\Api
from any controller in my application.
i want to know how can I make something like this myself. I want this structure:
vendor >>
myCustomName
myCustomPakageName
composer.json
license
src
Class1.php
Class2.php
and access the class files from this namespace \something\somethingElse\Class1;
how can I do this?