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
How to render image when asset autorender is false?
You can not render an individual asset instance by default if you don't auto-render, that is what that setting controls. So if you switch it off... You can work around it by using some dummy group: echo Asset::img('some.png', array(…
Comment by
WanWizard
August 2015
permalink
E-mail is not unique?
This is because Auth::login() accepts both a username and an email address as valid login credential. Lots of applications use email for login these days. This means email has to be unique. Nobody is stopping you from removing this restriction, but…
Comment by
WanWizard
August 2015
permalink
Must tables in ORM have an 'id' column?
You always define a relation both ways. As for the table name, I'm not sure, I always explicitly define it. Just try, if it works differently it will tell you the name of the missing "through" table.
Comment by
WanWizard
August 2015
permalink
Model query() function looks for column not defined in model
If you want to use the relation properly using ORM. And while you're at it, remove the constraints, ORM doesn't release like those on foreign keys. The ORM is smart enough not to join the child table if you run a query on a foreign key.
Comment by
WanWizard
August 2015
permalink
Must tables in ORM have an 'id' column?
You haven't defined the primary key in your model. If you don't, it defaults to "id".
Comment by
WanWizard
August 2015
permalink
Model query() function looks for column not defined in model
Every ORM Model must have a primary key, and if you haven't set one, the model defaults to "id". What is your intention with this model? This seems to be a relation table in a many-to-many relation between users and groups, which the…
Comment by
WanWizard
August 2015
permalink
What is the difference between $_belongs_to and $_has_one
technically there is no difference, but the ORM uses the difference to determine where the foreign key is. If you have a one-to-one relation, one side is a has_one, the other side is the belongs_to, and the belongs_to side always has the foreign ke…
Comment by
WanWizard
August 2015
permalink
How to get data from model associated with foreign key?
Stop using find(), it's only useful for simple queries, but gets very messy quickly when you want related data, which is the case here. First, make sure both models define the correct relation: users has_many group, group belongs_to user. Onc…
Comment by
WanWizard
August 2015
permalink
Modules routing nightmare
Use \Request::is_hmvc() to check?
Comment by
WanWizard
August 2015
permalink
Session expiration caused by ajax requests
If you're using Auth, it will already manually rotate the session id on login, so you don't have to do that.
Comment by
WanWizard
August 2015
permalink
model ::find_by() method giving error
I don't know where you got the idea from that it would work like this. A find_by() always does a value lookup, you can not use any other operator. If you want that, code a normal find() with a where clause. And what are the 5 and 10 arguments?…
Comment by
WanWizard
August 2015
permalink
How do I add a "select" input type to a form?
You set the type to "select" instead of "text". And you can use ->set_options() to define the option list for the dropdown.
Comment by
WanWizard
August 2015
permalink
How to creating REST API subresources and without subresources?
If you want to keep the code in a single controller, you can also give your controller a router() method. It gets both the method called and the arguments, so you can use that to dispatch the request to different methods.
Comment by
WanWizard
August 2015
permalink
Session expiration caused by ajax requests
You can't completely safeguard against it, sessions are not atomic. It can happen when you have a lot of concurrent ajax requests two requests simultaneously rotate the session id. When that happens you have a double rotation which is somethi…
Comment by
WanWizard
August 2015
permalink
How to creating REST API subresources and without subresources?
You could use a route to rewrite /api/users/1/posts/1 to /api/userposts/1/1 and use a different controller for it?
Comment by
WanWizard
August 2015
permalink
Implement auth driver (if i not mistaken) for joomla 3
I wouldn't know why not. Define a db config entry for the joomla database so you can access the tables, and write your Joomla compatible auth system. I don't know how it works or how it is implemented, so I can't comment whether or…
Comment by
WanWizard
August 2015
permalink
search in model relation
Remember, an ORM is not a query builder, the ORM is an object representation of your database, and it should not contain partial information. Although the ORM supports the select() method, using it has a lot of side effects since it will generate i…
Comment by
WanWizard
August 2015
permalink
XML Attributes?
I know. It is very difficult to represent and node info, and attributes, in a standard array structure, without it becoming the same complicated mess as XML itself.
Comment by
WanWizard
August 2015
permalink
Validation
There is nothing in your rule configuration that allows these characters, you only allow alphabetic characters [a-z][A-Z], numeric values [0-9], an underscore and a dash. "utf8" is a flag, and says the input is in utf8, not that it shoul…
Comment by
WanWizard
August 2015
permalink
how to execute a specific migration
You should not alter anything in a migration that has run. Either locally or after deployment (and that includes team members that work on the same code and have a local db too). If you haven't deployed yet, and you only have local code and a …
Comment by
WanWizard
August 2015
permalink
XML Attributes?
to_xml() has no support for attributes. If you have complex XML structures, it's virtually impossible to represent them as an array. You may have to write your own generator. Check PHP's simplexml extension.
Comment by
WanWizard
August 2015
permalink
Modules routing nightmare
Don't know, I'm not a native speaker either. ;-). We use the phase "a second pair of eyes". I personally find it very important to provide as much support as you can, when you maintain an open source product other people rely on…
Comment by
WanWizard
August 2015
permalink
Modules routing nightmare
Only route to self-sufficient controller methods. If you have a mix between controller actions that can be called directly and actions that produce widgets and need to be called by your front controller, make sure your routes are as specific as po…
Comment by
WanWizard
August 2015
permalink
Modules routing nightmare
It must be a route, otherwise your catch-all would have caught the request for your dashboard. I can't judge your architecture, but either your controller has a route and can act autonomous (being called directly) or it doesn't, but you c…
Comment by
WanWizard
August 2015
permalink
Modules routing nightmare
This is the route config in all our apps: /** * Global application routes. */ return array( '_root_' => 'webengine/loader', // The default route '_403_' => 'webengine/loader/403', …
Comment by
WanWizard
August 2015
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,369
Last Active
10:21AM
Roles
Administrator