Hi all,
I'm trying to write an Application. I'm using http://vanillaforums.org/docs/appquickstart as my guide.
I copy/pasted the applications/skeleton/ directory and changed everywhere the word 'skeleton' existed in that directory to my application name (agvanilla), paying attention to case.
I also changed an erroneous line at the top of class.skeletoncontroller.php from:
$this->Uses = array('Form');
to:
public $Uses = array('Database', 'DiscussionModel', 'Form');
...to mimic the a similar line at the top of the /applications/vanilla/class.discussionscontroller.php file
When I navigate to http://< ip >/agvanilla/homepage/index.php, I get:
[begin] Page Not Found The page you were looking for could not be found. [end]
If I add var_dump calls to trace the code in class.agvanillacontroller.php, the code in its __construct() and Initialize() function is clearly being executed through to the end of each function.
Help?
I finally figured out what was going on. Here's how the file structure needs to be:
After copying the skeleton application and renaming all references to 'skeleton' to whatever the new controller will be known as ('agvanilla' in this situation) -- paying attention to case -- to be able to go to any of the following eqiuvalent URLs:
http://<ip>/agvanilla/index.php
one must create an index method in the class.agvanillacontroller.php:
public function index() {
$this->Render();
}
and then create the following file:
applications/agvanilla/views/agvanilla/index.php
Fill that index.php with whatever HTML you'd like.
Now navigate to one of those URLs above. Voila, it works!
you're the man.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
Answers
I've never written a new application for Vanilla, so I can only help you think in the right direction.
Maybe, just maybe the problem has to do with routing, but I'm not sure. Let's focus on another thing first.
Before you get the, let's call it 404 error, do you see in which code block the 404 error is generated? You said you did a var_dump(backtrace), can you post that backtrace or will it reveal too much of the code you do not want to reveal?
Did you doublecheck the .htaccess file to reflect your IP address instead of the hostname?
What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •Results of debug_print_backtrace() in the :
No code executes in the agvanilla/controllers/homepage.php file, nor in the agvanilla/views/homepage/index.php file
>
I'm using the default .htaccess file:
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Before you wrote your application and modified various programs, what was the exact url that took you to the discussions page and did it work?
The reason I ask, when i added an application, i just added it to the menu options it may not be the correct way but this is what I did I wrote a plugin and put this inside it.
on second thought mine just read some rss feeds and didn't really interact with the vanilla database per se other than to get some feeds, so it might not work for you.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •If I just go to:
http://<ip>/It takes me to the discussions front page.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Can you do exactly the same, but then for the 404 error page, please :-)
What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •Ok:
That's at the line just before:
in class.dispatcher.php (line 329)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Aah, we're getting somewhere. This is for later moment to look at:
if (!$PluginManagerHasReplacementMethod && ($this->_ControllerMethod == '' || !method_exists($Controller, $ControllerMethod))) { **some code** } else { Gdn::Request()->WithRoute('Default404'); return $this->Dispatch(); }So what I usually do is figure out why that top statement isn't 'active' and therefore the code generates a 404 error. It means looking at the $PluginManagerHasReplacementMethod variable, the _ControllerMethod variable, etc, etc
If you have time, look at those variables using your var_dump method (which is great). I'll look at it also at my next opportunity
What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •Yep, that's where I'm digging right now :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •thanks nice overview
so you created
applications/agvanilla
Sounds like you know what you are doing it would be great if you put an annotated version in the vanillawiki, if it is not too proprietary or just put in some stubs for the application code. It would probably be very helpful.
http://vanillawiki.homebrewforums.net/index.php/Main_Page/
@philAG
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
3 • Off Topic Insightful 3Awesome LOL •Done: http://vanillawiki.homebrewforums.net/index.php/Hello_World_Application
- Spam
- Abuse
- Troll
3 • Off Topic Insightful 3Awesome LOL •Thanks for the article. I have a question:
Does that mean that the skeleton application lacks a method in the controller called index() ? Wow, so the skeleton application wasn't complete!
What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •Yep basic idea of model controller view is every view has an associated controller method.
By that I don't mean helper views, which are included by other views.
Don't PM about development, I'm not currently taking on clients.
grep is your friend.
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •Not only is the skeleton application not complete, it has a bug in the code which causes PHP to throw an error. You have to either comment out this erroneous line at the top of class.skeletoncontroller.php :
$this->Uses = array('Form');Or you have to change it; I used this line from the main Vanilla application controller:
public $Uses = array('Database', 'DiscussionModel', 'Form');@hbf -- watch out for that...
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •As I answered my own question, how should I proceed with all of the other posts in this topic? Am I doing the correct thing in liking, but rejecting each of them?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I would only reject if it was explicitly unhelpful.
Don't PM about development, I'm not currently taking on clients.
grep is your friend.
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •I thought you had to choose either reject or accept. And choose reject if the message doesn't answer the question. Confusion here. I think if you answer your own question the moderator will mark it as solved.
my concept is you click like if it seems like the person put some effort into making a response and it kinda helped you on your way.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •I wouldn't reject an answer until, like x00 says it's explicitly unhelpful. It keeps popping up that annoying message that I should accept or reject an answer, but I take that for granted.
The like is exactly like peregrine says, if it seems like the user made an effort, click the like button.
Here's a (small) thread about the 'like etiquette' : http://vanillaforums.org/discussion/19424/like-etiquette we could put our thoughts in there...
I'll accept your answer for you, if you like, send me a PM or tell me here in the thread please :-)
What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •@UnderDog: yes, please accept this answer: http://vanillaforums.org/discussion/comment/157786#Comment_157786
My thing is that Vanilla keeps popping up a Growl-ish box saying "you must accept or reject comments". I answered my question, I've liked the helpful comments, please ask Vanilla to stop bugging me :)
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •I remain in your camp philAG I think if you solve your own problem, I just click reject, and be done with it, if you want it to remain a "question" or if you want to it be an answer "just pick a random message or the last message and click accept. I think this is all a logic flaw - we need a solve button for a user that solves there own problem and dismisses the reject and accept and marks the question answered. if you ask me, but you didn't :).
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •In the meantime, feel free to send me PM's asking to accept specific comments as answered, as Phil just did. I don't mind, besides, I can mark the topic title as 'Solved' while I'm accepting the answer anyways.
What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
2 • Off Topic Insightful 2Awesome LOL •Thanks @UnderDog :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •