-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[solved] extending the core - total noob stuff here #5
Comments
Hi gyoza, When you extend the PageController, you'll notice that the PageController has this vital line (highlighted): $this->data['page'] = $page; That is where $page is loaded into the $data array. The $data array is then passed to all views, because its elements are referenced everywhere. It also contains all messages (errors, success, etc.). For instance, when showing the title of the page in the front-end page blade you can see that $page is accessed: The page that is loaded is from the URL specified from this route variable here: Note that this route has a variable in its very base, letting us create pages for URLs like I'm available on Skype (JunkGrave) if you'd like to share your screen, I could walk you through anything you'd like to accomplish! Hope this helps. -Jacob |
Also, have you seen this tutorial I made? I don't think I've put the link in the docs yet, I'll have to do that. |
So pretty much i have to inject the database with the code of the page? as for the tutorial you kind of click and bop around in folders without the full path showing and you do this quickly so it is hard for me to keep up hehe. |
Maybe I just need to change my submit button to use your route then? |
You don't necessarily have to put any code in the database. In that video, I'm writing the As for your form, you can have it post to any route and controller you'd like and process it however you'd like! Angel doesn't modify Laravel in any way, it's just a set of controllers and models to add some basic CMS functionality. |
Well I have a page called page2 created in angel and my route takes my sanitized form data and send its through my route for my button and then pushes it to /page2 and i get the missing page error. |
home.blade.php
routes.php
get this error when i post the form.
i think thats everything.. |
The All you need to do to create a form in Laravel is... View:
Route:
Controller:
|
Well, i am not trying to make a contact page, I am trying to just post data from one page to pull it from the next page nothing fancy, nothing needs to be stored, its just like a choose your own adventure type thing, based on the values you pick on the first page will then display certain things on the next page. Aside from doing things wrong in your opinion, based on what i showed you, I am passing the right page data correct? This should be working? p.s. angelvision is like going out of business:) |
I really like angel and it would be cool if we could work together to make it so noobs like myself could easily get a page going and learn some laravel at the same time :P If it was a little bit user friendly to add custom code into the pages it would be a whole lot simpler. But I really do like it :) And yes your tutorial did help a bunch, i obviously got it extended and working but it just took me having to watch it a number of times:) |
I was merely using an example. You could do it with literally anything, not just contact forms. I honestly just don't understand your code. For instance:
I have never, in all my years of experience, seen someone passing an array as a 3rd paramater to And Angel is getting simplified quite a bit for Laravel 5... but, at the end of the day, anything as complex as a CMS does require some proficiency with Laravel. Angel is the simplest CMS I've seen so far, but everything could always be simpler! :) |
Long story short: In order to use the |
I was just fooling around trying to set that page variable trying anything I could muster thats all;) |
Ah I see. Cool cool... well I hope that you got all sorted! You can always copy the code from (Because you're not using the |
What file can I find that in? |
This is the PageController, where the |
Oh i guess i forgot that i extended the page controller as well..
which got me to where i am. |
I think I know what I did wrong now.. I never properly copied over the page controller code i guess lol. |
You shouldn't copy over the PageController code... you've already extended the \Angel\Core\PageController with your local PageController so you're all set, right? I definitely cover all of this in the videos. You don't copy code from the core, you simply extend the classes and overwrite or add any methods you need. |
So i guess I just need to jam in the show code into my returnmail() function? |
As it stands with the function returnmail() and me doing Route::post('/returnmail', 'PageController@returnmail'); i still get page variable errors. |
It's so much simpler than that. In your extended
Have your form post data here, to this method. |
And if you need to return a custom view, then in a separate method:
|
You are rad man! I think I should be able to figure out the rest now:) I am a little unorthodox in my learning,.. Sorry about that.. As for passing an array as a 3rd parameter, is a really bad idea? :P |
It's all good, I'm just glad to help. That All I know is that those functions only accept 2 parameters according to the documentation, so there's no reason to pass a 3rd. I gotta run for a while, good luck and feel free to hit me up on Skype if you need any more help bro! |
OMG IT WORKS. Thank you so much. But there is now another issue, my text from the page edited from the WYSIWYG editor is showing on the top left! |
Sweet! :) Can you paste me your |
I figured it out :) I was missing the @Stop at the end. We are in business boys! I'll make sure to highlight that we're using angel when my page goes live whenever it does for sure:) Thanks again for being patient with the noob! |
Most excellent! :) No problemo amigo, and thanks - I really appreciate any links back to Angel (though they're not required) and I hope you have fun with it! |
So I found another issue, Following the tutorial you say to customize a page you just change the Controller to
Now, yesterday you showed me how to load another page using using post, but I want to also customize the page as well and use modules from the admin page however, when I attempt to load the page which i created in the admin section and then its own page2.blade.php with
It ignores the page2.blade.php page completely. Am I doing something wrong? |
My page2.blade.php for edification
|
You're not using the I explain the method in detail both earlier in this very thread and also in the YouTube tutorial. It's also only 8 lines of really easy-to-understand code, if you'd prefer to just read it yourself. It's never a good idea to use methods before reading them. |
Shit my bad, i missed one of your updates :) Sorry to be a pain in the ass. |
Thanks again man! |
It's all good man, no problem... so you said it's like a choose-your-own-adventure game? Let me know if you toss it up online, I'd like to check it out! |
Hi, I am kind of new to laravel, I do web development for fun, its not my job, I am a sysadmin so I am learning still.
Ok, now that that is out there.
I am having issues with I believe are Routes not passing data properly when using angel. I've extended the angel core so i can have my own custom pages.
I am trying to create a form that routes data to a new page. I get the page to route fine and checking the post data i see my normal data but i get an error when it attempts to display the next page.
I am getting
Undefined variable: page (View: /var/www/email/app/views/pages/returnmail.blade.php)
which is essentially a modified copy of the main blade file with some small modifications.
There is a "pages" view added in pages. Any help would be REALLY appreciated, I love this project so far and we all love
The text was updated successfully, but these errors were encountered: