Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
WanWizard
a.k.a. WanWizard
Discussions
4
Comments
8242
Activity
I wrote an article on Medium: Configuring Twig with FuelPHP
Cool. You can send us a PR on https://github.com/fuel/docs/blob/1.9/develop/installation/external.html if you want it added to the links in the docs (under blog posts).
Comment by
WanWizard
September 2017
permalink
Nestedset advanced breadcrumbs
The model can't generate URI's, and imho it shouldn't. The reason for the path being there is exactly for this purpose, so you can generate it. It will be present in the result of dump_tree(), so it doesn't require additional que…
Comment by
WanWizard
September 2017
permalink
i need a better example of the upload class
Not sure I understand what you mean or want. Can you be more specific? The Upload class is basically a wrapper around $_FILES, with validation and processing methods. It doesn't really care what is in $_FILES.
Comment by
WanWizard
September 2017
permalink
SaaS in FuelPhP
That depends on how you organize it. If you have a monolithic design, and (for example) you want to be able to have the same username for every tennant (say 'admin'), it obviously needs some changes. Which depend on your architecture. For …
Comment by
WanWizard
August 2017
permalink
Would v2 have a router like Laravel's?
You can already do that, see https://fuelphp.com/docs/general/routing.html#/inline_routes In case of your static page // routes.phpreturn array( 'about' => function () { return View::forge('about'); },}; Where do …
Comment by
WanWizard
August 2017
permalink
SaaS in FuelPhP
Yes, not a problem. You need to properly design it, look at how you are going to separate your tenants when it comes to RBAC, data, etc. But you need to do that for every platform you choose.
Comment by
WanWizard
August 2017
permalink
SaaS in FuelPhP
What do you mean exactly? A SaaS provider offfering FuelPHP? Writing a SaaS application in FuelPHP? I'd say both is not an issue, we do both. ;-)
Comment by
WanWizard
August 2017
permalink
Error 22001 When object->save();
If you develop in development mode, it should display the error in the exception. It should also be present in the app log. How exactly is your column defined, and how big is this file you are trying to store? A column of type BLOB is on 64KB big. S…
Comment by
WanWizard
August 2017
permalink
Must i add action to every method i create?
Because that would call action_index(), and that doesn't exist? And yes, you must add the "action_" prefix to every method that is routeable. Not only because that allows you to create non-routeable public methods too (methods that yo…
Comment by
WanWizard
August 2017
permalink
Error 22001 When object->save();
It would have helped to post the error message as well, saved me looking it up. PDO Exception SQLSTATE[22001] means "String data, right truncated". In other words, your database is running in strict mode, and you are trying to save more da…
Comment by
WanWizard
August 2017
permalink
Could the forum be moved to a software like Discourse?
The website will get a complete overhaul and will move to fuelphp.org with the release of v2.
Comment by
WanWizard
August 2017
permalink
Getting nested tree of the result
That depends on how you use it. If you store multi-level menu's (for things like drop-downs and so), it is logical that each menu is a separate tree, as they are not related to each other, and you use them seperately. If you look at for exampl…
Comment by
WanWizard
August 2017
permalink
How can i use Twig on FuelPHP?
Make sure you load the parser package in the always_load section of your app config.Create a twig view the same way you would make a normal (php) view. Save the file with a ".twig" extension.Use it in your code: View::forge('someviewn…
Comment by
WanWizard
August 2017
permalink
Getting nested tree of the result
You could ask yourself why you have created 6 seperate trees, while it seems clear you want them all to be part of the same tree? Any particular reason you made 6? Seperate trees are not supposed to have any relation...
Comment by
WanWizard
August 2017
permalink
Getting nested tree of the result
If you don't want to in there, remove it from your function, and add them only before and after you call our function? Our closure is written specifically for the theme system we use, you will have to adapt the HTML generation to whatever you …
Comment by
WanWizard
August 2017
permalink
Getting nested tree of the result
There is no "whole" tree, there are 6 different trees, which just happen to be stored in the same table? So you have 1 query to get the id's of the trrees, and 1 query for each of the trees. making n+1. And as with any other object, y…
Comment by
WanWizard
August 2017
permalink
Getting nested tree of the result
Yeah? If you want the tree structure, you'll have to. I thought the question was "can I retrieve the tree so I can cache it"? If you just want a flat list, you can also use $category->decendants()->get() which gives you all obje…
Comment by
WanWizard
August 2017
permalink
Getting nested tree of the result
If you want to minimize the interaction with the DB, you could look at the dump_tree() method, which can return the entire tree in a flat array or in an object tree structure, depending on your requirements. We use this a lot for generating menu…
Comment by
WanWizard
August 2017
permalink
Getting nested tree of the result
No, because I don't know your code. As for the sorting, the Fuel NestedSets architecture has a previous/next pointer design, which means every node has a fixed place in the tree. If you want to sort that, you need to fetch every branch of the t…
Comment by
WanWizard
August 2017
permalink
Getting nested tree of the result
I told you what the Fuel way of doing things are. Since I have no clue what you build, and what your code does, it's a bit difficult to comment on either of them.
Comment by
WanWizard
August 2017
permalink
File POST from form after submit
No, you need the Upload class to process and validate your uploaded file. This results of that will be a file on disk (preferably not in DOCROOT, but in a more secure place). Then you need to read the file into a variable, properly escape it, then a…
Comment by
WanWizard
August 2017
permalink
File POST from form after submit
Plain PHP example: http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/uploading-files-to-mysql-database.aspx For Fuel, you would ofcourse use the Upload class instead of accessing $_FILES directly.
Comment by
WanWizard
August 2017
permalink
Getting nested tree of the result
tree_id is not required, it is used when the table contains multiple trees. But you can't just swap 'id' and 'parent' by 'left' and 'right', the two systems are completely different. You will have to crea…
Comment by
WanWizard
August 2017
permalink
Getting nested tree of the result
Possible. From the little information you have given, I think your table only uses a parent pointer. Which isn't really sufficient for a nested set, as you don't have a children list, which means next() and previous() can never work proper…
Comment by
WanWizard
August 2017
permalink
Value of select field depend another value of select field.
REST methods need to return an array of data. The response methods in the Hybrid or REST controllers will convert that array to the required output format. Note that by default, it uses the HTTP Accept header to determine the return result. Which me…
Comment by
WanWizard
August 2017
permalink
More Comments
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
About
Username
WanWizard
Joined
January 2011
Visits
2,366
Last Active
April 29
Roles
Administrator