How to setup Custom and Default Modules to work no matter which one you need?
4 years ago
4 years ago
#1
Hello all, I am very new to the Trongate Framework. I recently stumbled across an issue that seems kind of out of place to me. The config.php file in Trongate only has an option for the default module but nothing that I can deceiver, as to how we are to use the custom module directory. It seems like a pretty large oversight to me for there to be a directory dedicated to custom modules, but no mention anywhere in the config files as to how to interact with them. I know I can set up one of the custom modules to be the default module, but that kind of defeats the purpose of them being organized in two different directories. Also, when I install a new version of Trongate for a new project, I would like to leave all the preinstalled stuff where it is, and just work out of my own custom modules and code. Does anyone out there have a solution to this weird issue? Thank you all!
4 years ago
#2
Hello Josh and Welcome,
1. The config.php file in Trongate only has an option for the default module but nothing that I can deceiver, as to how we are to use the custom module directory.
Are you referring to the Module Directory? Or perhaps the Custom Routing directory?
Trongate modules by design are meant to be self containing, so that the module you create can be used in other projects.
2. Also, when I install a new version of Trongate for a new project, I would like to leave all the preinstalled stuff where it is, and just work out of my own custom modules and code. Does anyone out there have a solution to this weird issue?
For this you can just copy the main project folder and change the config files to your new project.
When you update the trongate framework you only update the engine forlder.
Hope this helps. Post any other questions you have.
Dan
1. The config.php file in Trongate only has an option for the default module but nothing that I can deceiver, as to how we are to use the custom module directory.
Are you referring to the Module Directory? Or perhaps the Custom Routing directory?
Trongate modules by design are meant to be self containing, so that the module you create can be used in other projects.
2. Also, when I install a new version of Trongate for a new project, I would like to leave all the preinstalled stuff where it is, and just work out of my own custom modules and code. Does anyone out there have a solution to this weird issue?
For this you can just copy the main project folder and change the config files to your new project.
When you update the trongate framework you only update the engine forlder.
Hope this helps. Post any other questions you have.
Dan
4 years ago
#3
Hello and thank you for your quick response. After some thought, I realize my question may not have been very clear. So, I will clarify. What I am asking is when you first install Trongate into a project directory, you are presented with two module directories:preinstalled and custom. My question should have been, am I supposed to work on new modules out of the custom module directory for new modules? Sorry for the convoluted question earlier!
4 years ago
#4
Are you installing trongate by using the trongate desktop app?
Or are you downloading a zip copy from github?
Are you asking where you start creating your code? If so start in the welcome controller.
Still not sure what if you are asking about two module directories, preinstalled and custom.
Do you mean preinstalled -- the welcome module ? and custom a module you create?
When you install trongate from the desktop app. you access your app through the welcome module, welcome controller, and welcome view file.
If you create your own module and want it to load when accessing your website, you change the Module, Controller to your custom module
Or are you downloading a zip copy from github?
Are you asking where you start creating your code? If so start in the welcome controller.
Still not sure what if you are asking about two module directories, preinstalled and custom.
Do you mean preinstalled -- the welcome module ? and custom a module you create?
When you install trongate from the desktop app. you access your app through the welcome module, welcome controller, and welcome view file.
If you create your own module and want it to load when accessing your website, you change the Module, Controller to your custom module
4 years ago
#5
Time out!
I've been Josh. I know EXACTLY what's happening and how to solve it.
Josh, you are making the classic intelligent person's mistake by over-thinking this framework. So... step back, take a deep breath and don't worry. We'll get you up and running. You have my word.
SO, LET'S GET YOU UP AND RUNNING
Here's my advice:
* If you haven't done so already, go through the Beginners' Training at the Trongate Learning Zone. Everything that you need to know is in the section called 'Understanding Routing'. It's free and it covers all of this in detail. Please note - the intermediate and advanced training sections aren't up yet. They're on the way. However, please do check out 'Understanding Routing'. Here's the URL:
https://trongate.io/pathways/display/beginner/understanding_routing
* Once you've gone through that training, it's for you to decide if you're happy or not. If you still have issues then I think the best course of action would be for you to install Skype and consider arranging a one-on-one call with either Simon (dafa), Dan, myself or anyone else who is familiar with the framework.
I can absolutely assure you, this framework is easy and solid as a rock.
So, give the Learning Zone a shot. If you have any issues then come right back and let's get you on Skype.
DC
I've been Josh. I know EXACTLY what's happening and how to solve it.
Josh, you are making the classic intelligent person's mistake by over-thinking this framework. So... step back, take a deep breath and don't worry. We'll get you up and running. You have my word.
SO, LET'S GET YOU UP AND RUNNING
Here's my advice:
* If you haven't done so already, go through the Beginners' Training at the Trongate Learning Zone. Everything that you need to know is in the section called 'Understanding Routing'. It's free and it covers all of this in detail. Please note - the intermediate and advanced training sections aren't up yet. They're on the way. However, please do check out 'Understanding Routing'. Here's the URL:
https://trongate.io/pathways/display/beginner/understanding_routing
* Once you've gone through that training, it's for you to decide if you're happy or not. If you still have issues then I think the best course of action would be for you to install Skype and consider arranging a one-on-one call with either Simon (dafa), Dan, myself or anyone else who is familiar with the framework.
I can absolutely assure you, this framework is easy and solid as a rock.
So, give the Learning Zone a shot. If you have any issues then come right back and let's get you on Skype.
DC
4 years ago
#6
I think I get it now. The "custom" module must have been left over from when I created a "custom" module when I was new to the Trongate desktop app and wasn't sure what a module even was. I had never heard of that type of coding approach before. I come to Trongate from a CodeIgniter background and new frameworks are always difficult, especially when you are exclusively used to one framework which is as DC put it is DEAD. After CodeIgniter 4, I started to have to really start to reassess my options for frameworks, CI4 would require me to re-code every site I had ever built just to bring it up to the "CI4" standard. So, that is what brought me here to Trongate. I do not want anyone to misunderstand myself or my posts. I think what Mr. Connelly and others have created, is leaps and bounds more promising than other frameworks I have seen! I just have to wrap my head around this new way of doing things. I posted on DC's recent CodeIgniter video that differences are helpful but it would be helpful if he could walk us through the way CodeIgniter developers can do the same things in Trongate. In any event, I appreciate everyone's help on this topic.
Thank you all!
Thank you all!
4 years ago
#7
Hi Josh,
Welcome to the revolution!
I was just about to ask your back story and you answered it in your last post, thank you. I too come from a CI3 background and have been following DC for many years before Trongate; where you will not find another YouTube channel that covers CI3 more than what DC did - excluding the ones he deleted.
Please go through the beginners' learning zone as DC suggested - it will open your eyes to how Trongate works and how quickly you can get an app running.
As for your obscure original post and the following post; I think I can sum it up in a few sentences:
What you are calling the 'default module' is defined in config.php, so when you enter the path in a browser it will automatically load the welcome modules, Welcome controller, index, and load the view file, as long as you haven't changed it from its original state.
When you create a custom module with either the desktop app or manually with or without the VS Code extension the URL in your browser will need to be changed to access it, for example, this is the use of the 'Simple Members Module' which is available from the Module Market free of charge:
Being from a CI3 background you should understand the segments of the URI.
- 'BASE_URL' = 'http://localhost/your_app/' < this is your hostname plus your app name
- segment(1); = 'members' < from the URI and this is the name of your module and so happens to be the name of the controller class that extends Trongate
- segment(2); = 'login' < on the URI, is the method name inside your class of your controller's module.
So, when you ask Trongate to load the above custom module, you are asking it to look in the 'members' module and invoke the 'login' method which will then serve up the 'login' view file to display the appropriate $data[] and HTML/CSS/JS form.
The power of Trongate's HAVC architecture is so much more flexible than the MVC structure of CodeIgniter, and I'm sure you will grasp fully it in no time at all. Please also go through each of the 'Key Features' cards on https://trongate.io/ as most have accompanying videos which will be very helpful for you too.
Cheers,
Simon
ps. as DC has already mentioned - I'm open to a Skype call or whatever floats your boat method of chatting ?
Welcome to the revolution!
I was just about to ask your back story and you answered it in your last post, thank you. I too come from a CI3 background and have been following DC for many years before Trongate; where you will not find another YouTube channel that covers CI3 more than what DC did - excluding the ones he deleted.
Please go through the beginners' learning zone as DC suggested - it will open your eyes to how Trongate works and how quickly you can get an app running.
As for your obscure original post and the following post; I think I can sum it up in a few sentences:
What you are calling the 'default module' is defined in config.php, so when you enter the path in a browser it will automatically load the welcome modules, Welcome controller, index, and load the view file, as long as you haven't changed it from its original state.
When you create a custom module with either the desktop app or manually with or without the VS Code extension the URL in your browser will need to be changed to access it, for example, this is the use of the 'Simple Members Module' which is available from the Module Market free of charge:
Being from a CI3 background you should understand the segments of the URI.
- 'BASE_URL' = 'http://localhost/your_app/' < this is your hostname plus your app name
- segment(1); = 'members' < from the URI and this is the name of your module and so happens to be the name of the controller class that extends Trongate
- segment(2); = 'login' < on the URI, is the method name inside your class of your controller's module.
So, when you ask Trongate to load the above custom module, you are asking it to look in the 'members' module and invoke the 'login' method which will then serve up the 'login' view file to display the appropriate $data[] and HTML/CSS/JS form.
The power of Trongate's HAVC architecture is so much more flexible than the MVC structure of CodeIgniter, and I'm sure you will grasp fully it in no time at all. Please also go through each of the 'Key Features' cards on https://trongate.io/ as most have accompanying videos which will be very helpful for you too.
Cheers,
Simon
ps. as DC has already mentioned - I'm open to a Skype call or whatever floats your boat method of chatting ?
4 years ago
#8
Well, that's great and thank you - Dan and Simon - for helping out with this one.
To be clear, it's perfectly okay to not like Trongate. I'm sure there are some developers out there who may prefer using other things (the fools!). That's okay. It's normal. However, to give up on Trongate because you had difficulty getting out of the starting blocks is not acceptable to me.
Personally speaking, I've had times in the past where I've wanted to learn something - spent a few hours on it - and then given up because I couldn't get out of the blocks. When that type of thing happens I think it represents ultimate failure for framework makers. It simply CANNOT happen with Trongate. Nobody gets left behind.
You can see that Simon and Dan have that energy too. THIS is why Trongate is a revolution. Here, we don't tell people "it's in the docs, stupid". Instead, we treat people like human beings - with compassion and respect. That's because we've ALL been there and we know how it feels. Our philosophy of 'no developer gets left behind' is our greatest strength and I'm so grateful to Simon, Dan and the others for going the extra mile here.
I'd love to do a 'switching from [framework x] to Trongate' cheatsheet or video series. Unfortunately, I'm snowed under until Feb next year. I have to re-record Speed Coding Academy, finish the Learning Zone and do a whole bunch of other things. If I can raise the revenue I'd like to pay to have other developers produce that kind of content. It's a great idea.
To be clear, it's perfectly okay to not like Trongate. I'm sure there are some developers out there who may prefer using other things (the fools!). That's okay. It's normal. However, to give up on Trongate because you had difficulty getting out of the starting blocks is not acceptable to me.
Personally speaking, I've had times in the past where I've wanted to learn something - spent a few hours on it - and then given up because I couldn't get out of the blocks. When that type of thing happens I think it represents ultimate failure for framework makers. It simply CANNOT happen with Trongate. Nobody gets left behind.
You can see that Simon and Dan have that energy too. THIS is why Trongate is a revolution. Here, we don't tell people "it's in the docs, stupid". Instead, we treat people like human beings - with compassion and respect. That's because we've ALL been there and we know how it feels. Our philosophy of 'no developer gets left behind' is our greatest strength and I'm so grateful to Simon, Dan and the others for going the extra mile here.
I'd love to do a 'switching from [framework x] to Trongate' cheatsheet or video series. Unfortunately, I'm snowed under until Feb next year. I have to re-record Speed Coding Academy, finish the Learning Zone and do a whole bunch of other things. If I can raise the revenue I'd like to pay to have other developers produce that kind of content. It's a great idea.
4 years ago
#9
Thank you all for your assistance in this. I must say the respect shown to newcomers is yet again another thing other frameworks are missing. I have posted countless questions in the CodeIgniter, StackOverflow, etc coding communities just be treated very rudely and harshly, for no reason. So DC that certainly is a welcomed change of tone and pace for any new framework.
I have one question/comment though if I may. Simon mentioned the format of the URL was something like:
http://localhost/your_app/members/login
I don't know if you all are aware, but in XAMPP you can use Virtual Hosts to set up direct URLs to your projects for easier, cleaner and simpler navigation.
Inside Apache's config folder there is a folder called "etc" Inside of that, there is a file called "httpd-vhosts" where you can specify the project DocumentRoot and chosen ServerName. Then you would simply add that server name to your windows/mac "hosts" file and reroute all your http requests to something like:
http://your_app/members/login.
No need to specify localhost every single time you want to access a new/different project. This is the development convention I always use. So, every one of my projects always has it's own "server".
This way, you shorten a lot of typing, to point your browser directly to your project instead of having to declare localhost every time. It also allows you to spend more time on code and less on dev navigational structure. Hope that helps someone.
I have one question/comment though if I may. Simon mentioned the format of the URL was something like:
http://localhost/your_app/members/login
I don't know if you all are aware, but in XAMPP you can use Virtual Hosts to set up direct URLs to your projects for easier, cleaner and simpler navigation.
Inside Apache's config folder there is a folder called "etc" Inside of that, there is a file called "httpd-vhosts" where you can specify the project DocumentRoot and chosen ServerName. Then you would simply add that server name to your windows/mac "hosts" file and reroute all your http requests to something like:
http://your_app/members/login.
No need to specify localhost every single time you want to access a new/different project. This is the development convention I always use. So, every one of my projects always has it's own "server".
This way, you shorten a lot of typing, to point your browser directly to your project instead of having to declare localhost every time. It also allows you to spend more time on code and less on dev navigational structure. Hope that helps someone.
4 years ago
#10
Hi Josh,
I get what you mean with using a virtual host and that is fine if that makes you feel good, personally, I don't use them. Once you become more familiar with Trongate, you will also learn how to use custom routes, but that may be a topic for later on.
https://trongate.io/docs/information/advanced-custom-routing
I get what you mean with using a virtual host and that is fine if that makes you feel good, personally, I don't use them. Once you become more familiar with Trongate, you will also learn how to use custom routes, but that may be a topic for later on.
https://trongate.io/docs/information/advanced-custom-routing