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
8243
Activity
NestedSet: $tree['children'] not working in dump_tree()
It's a tree structure, so you need to recurse over it. We use this logic to retrieve the tree and display it: http://bin.fuelphp.com/snippet/view/HY And it's view looks like this: http://bin.fuelphp.com/snippet/view/HZ Note that this is…
Comment by
WanWizard
October 2014
permalink
Auth::get_user_id() should not return empty array when guest user config is disabled?
If there is nobody logged in, and there is no guest user account, what would you suggest it returns? array(false,false) is a bit weird too, it's better to modify the method signature. If only because changing this will break every application …
Comment by
WanWizard
October 2014
permalink
Can modules routes be reverted?
It's about in which controller you use Router::get(). That you can only do in controllers in the dashboard module. In other words, Router::get() can only find global routes, or routes in the current module. You can not do Router::get("lo…
Comment by
WanWizard
October 2014
permalink
Routes sending parameters
As a parameter of the action method. If you provide a default: public function action_index($category = null) { } then the value is optional (i.e. "institucional/index/category" will work too), but of you don't public function act…
Comment by
WanWizard
October 2014
permalink
Can modules routes be reverted?
That only works inside the module, when the module is loaded. Modules are designed to be loosly coupled, if you have a view in module A that needs a link to a controller in module B, you violate that design, since you tightly integrate A and B (A w…
Comment by
WanWizard
October 2014
permalink
Bug with ORM?
The problem with this PDO option is that it creates the object, stores the properties, and then runs the constructor. So there is some wizardry in the model constructor to deal with this. Secondly, any properties that are being set, that are not de…
Comment by
WanWizard
October 2014
permalink
Can modules routes be reverted?
What do you mean by "reverse"? Can you give an example?
Comment by
WanWizard
October 2014
permalink
Routes sending parameters
Do you mean GET variables? Like "institucional/index?category=1"? Fuel doesn't work with GET variables, it works with URI segments for parameters, like "institucional/index/category/1" which can be routed without problems.
Comment by
WanWizard
October 2014
permalink
Bug with ORM?
Then the only thing I can think of is the property name collision. I've got php-mysqlnd installed as well. This method isn't really meant for joins (it will not do any hydration and create related objects). Does it work if you do: DB::s…
Comment by
WanWizard
October 2014
permalink
Bug with ORM?
Not sure what happened there. Model looks fine. Can you add a limit(1) to that query and try again? I've seen issues like this, but not with MySQL. The only other thing I can think of, is that your query result returns a column name that happ…
Comment by
WanWizard
September 2014
permalink
How to use ORM with same relations? (table_from_id and table_to_id related to same table.table_id)
Just define your relations as you would always do? ORM doesn't care what the target table of the relation is. And if you have multiple relations, just use different relation names.
Comment by
WanWizard
September 2014
permalink
A Detailed Info of Nested Set is Required
"name" was just an example, you can put anything in it, as long as the table has a left and right pointer, and optionally a tree_id. ORM models must always have a unique key. Just have it auto_increment, you don't need to use it. Usi…
Comment by
WanWizard
September 2014
permalink
Bug with ORM?
Your Model_Movie is an ORM model? That extends \Orm\Model? And does not define it's own constructor?
Comment by
WanWizard
September 2014
permalink
Error in a validation::forge using in HMVC structure
Because you're using a template controller. These are for complete webpages, where you define a page template, and inject widgets (or only a content body) in it. This is not what you're looking for. Your controller need to extend \Contro…
Comment by
WanWizard
September 2014
permalink
Error in a validation::forge using in HMVC structure
It dependent on what you intend to build. If you intend to build a single app, and you need widgets containing simple blocks of HTML for a section of your page, I would use Presenters, yes. If your widgets need to be self-contained (i.e. not only …
Comment by
WanWizard
September 2014
permalink
Error in a validation::forge using in HMVC structure
Made your post readable, and please use a pastebin for your code to keep this forum tidy. ;-) What goes wrong there, is that this is a template controller, it sets template sections, it is not designed to return data, what you want with your HMVC c…
Comment by
WanWizard
September 2014
permalink
Error in a validation::forge using in HMVC structure
That alone won't give you the error, unless that code get executed twice. And you create instance with forge(), you retrieve instances with instance(). Some instance() methods still have a legacy feature that creates the default instance if yo…
Comment by
WanWizard
September 2014
permalink
Error in a validation::forge using in HMVC structure
The Form class is a multiton, it allows you to create multiple named instances and use them concurrently. If you don't specify an instance name. forge() uses the name "_default_". Which works fine if you only need a single instance …
Comment by
WanWizard
September 2014
permalink
Backend/Frontend with the same app folder and different index.php
No, one "index.php" maps to one APPPATH. So while it is possible to map: http://mysite/app1/something => app1.php => ./app1 http://mysite/app2/something => app2.php => ./app2 (where app1 and app2 are copies of index.php with a…
Comment by
WanWizard
September 2014
permalink
A Detailed Info of Nested Set is Required
Yes, you can create multiple tree structures in a single table, using the 'tree_id' column to uniquely identify the tree. You can use if field as a foreign key to a parent table that defines the trees (give them a name, etc), but you don…
Comment by
WanWizard
September 2014
permalink
ORM not saving relations
The relation definition should be the other way around. Easiest to remember: the model that contains the Foreign Key (here: Customer) has the belongs_to() side of the relation definition.
Comment by
WanWizard
September 2014
permalink
Bug with ORM?
That is how normally a limit on a join works, yes. Which for pagination would not be a problem, since that would display 10 lines, 5 for movie one, 5 for movie two. What you want is a hierarchical model structure with a flat display, you want to re…
Comment by
WanWizard
September 2014
permalink
A Detailed Info of Nested Set is Required
Just to be clear, do you really mean "a second menu", for example one for a sidebar instead of a navbar, of do you mean "a submenu"? A second menu would mean a second tree structure with a new root, a submenu means inserting chi…
Comment by
WanWizard
September 2014
permalink
Is the module name lowercase?
Yes, everything in the "Fuel file structure" is lowercase. The module directory name is the lowercase version of the namespace. That paragraph in the docs needs to be better formulated. If your module has the namespace "Admin", …
Comment by
WanWizard
September 2014
permalink
Bug with ORM?
It can't move the other where's because they are encased in parentheses. And it isn't fool-proof in the sense that in this case it would have been better to have the disabled filter on the outer query too. But if you use rows_limit(2…
Comment by
WanWizard
September 2014
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,399
Last Active
12:09AM
Roles
Administrator