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 use Orm Model $_to_array_exclude on the fly.
That is what that array is for, see also my answer to your related question.
Comment by
WanWizard
September 2015
permalink
Model_Crud::to_array($custom)
Ah, ok. The ORM model uses the from_array() method. It optionally takes three boolean's as arguments, whether or not to include custom model properties, whether or not to recurse, and whether or not to include EAV values. If you enable recurs…
Comment by
WanWizard
September 2015
permalink
Any way to remove requirement for lowercase paths?
Fuel doesn't support PSR-4, and using the composer autoloader to load Fuel specific classes is a bad idea. So it's rather pointless converting your class filenames.
Comment by
WanWizard
September 2015
permalink
FuelPHP not logging in correctly through ajax REST.
Auth uses the session to store the logged-in credentials, and the cookie to track the session. So your client must support cookies, and be able to send them back and forth. If your client doesn't, the session class supports several alternative…
Comment by
WanWizard
September 2015
permalink
Model_Crud::to_array($custom)
We're talking about Model_Crud, right? In that case to_array() doesn't have any parameters, see https://github.com/fuel/core/blob/1.8/develop/classes/model/crud.php#L712
Comment by
WanWizard
September 2015
permalink
How to use Orm Model $_to_array_exclude on the fly.
If you mean you want to be able to filter the result of to_array(), like the ORM equivalent can, it's probably best to create a Model_Crud base model, add a method to define the filter, and overload the to_array() method to honour the defined f…
Comment by
WanWizard
September 2015
permalink
How to check if new data is added in my database using fuelphp?
An observer executes a specific task, at a specific event. Fuel comes with a few standard observers, like created_at and updated_at. The last_login column is specific to Auth, and is not used for this purpose, it's used to detect and block con…
Comment by
WanWizard
September 2015
permalink
How to check if new data is added in my database using fuelphp?
Add an observer that is triggered on insert, and have that do something? It's the closest you can get, and always accurate.
Comment by
WanWizard
September 2015
permalink
Processing file uploads using controller_rest
If you want to read up about it, I can recommend a publication of ex-Fuel dev Phil Sturgeon: http://apisyouwonthate.com/
Comment by
WanWizard
September 2015
permalink
Gathering errors from models
You can't, that was the point. The validation is done by the observer, on the model. Observers are event driven, the model is not aware the observer exists. But you can probably "mis-use" the observer. Create a base-model class that …
Comment by
WanWizard
September 2015
permalink
Gathering errors from models
At the moment you can't, the models are not aware of each other, and validation happens as part of the save operation. The first save that triggers a validation error throws the exception.
Comment by
WanWizard
September 2015
permalink
How to Send email to 1000+ users
'mail' is about the worst choice you can make, it uses php's mail() function, which spauns a sendmail instance for every email. If you have a local mail server running, or have a provide that provides you with a mailserver, use the &…
Comment by
WanWizard
September 2015
permalink
How to handle fieldset, multiple models and validations
1. The problem here is multiple columns with the same name. This is an issue that can't be avoided when using add_model. The easiest way out is to use two fieldsets, one for each model, and send them both to the view for form generation. An a…
Comment by
WanWizard
September 2015
permalink
How come when I save a user their user_id changes to the id of whomever is logged in.
By default fuel models use the 'id' column as the auto_increment column, which for the users table represents the users' id.
Comment by
WanWizard
September 2015
permalink
how to delete questions?
You can't. Just ask this in the topic, and I'll arrange for it to be removed.
Comment by
WanWizard
September 2015
permalink
How come when I save a user their user_id changes to the id of whomever is logged in.
That should not be a problem, in that case, the user_id column is there to store the last-updated user, and nothing else. In other words, the "user_id" column is NOT the id of the user defined by that record.
Comment by
WanWizard
September 2015
permalink
How come when I save a user their user_id changes to the id of whomever is logged in.
I can't comment on it being odd, you should ask the developer about why it was implemented like this. Observers are standard ORM functionality, and very useful if you want event driven actions on ORM objects. Since Observer_Self is used, the m…
Comment by
WanWizard
September 2015
permalink
How come when I save a user their user_id changes to the id of whomever is logged in.
Most obvious candidate is an observer that runs on save, and updates it. So check the model for defined observers. It's possible if the developer has used some of our examples, that use this in addition to updated_at to store the last update …
Comment by
WanWizard
September 2015
permalink
Query result returns '500 Internal Server Error'
Check your logs for error messages in the application logs, and make sure you develop with Fuel in "development" environment so you can see error messages instead of the generic production errors. p,s.: your queries are VERY insecure, and…
Comment by
WanWizard
September 2015
permalink
Routing to a controller or model function?
You always route to a controller method. You should not have control logic in a model, so there is no need to route to a model.
Comment by
WanWizard
September 2015
permalink
Need help to install a parser, please
I assumed that had already happened. In the first post it said "And this is where my twig folder (installed via composer) is located"...
Comment by
WanWizard
September 2015
permalink
Need help to install a parser, please
You don't have to, if you want to use twig as the parser for all your templates, and you will never use standard templates anymore, you can also configure the parser to map the .php extension to twig. But that means you also have to create twig…
Comment by
WanWizard
September 2015
permalink
Need help to install a parser, please
There is no "twig" package, the package is called "parser". If you installed twig using composer, it will be able to find and use it automatically, if you give your views the ".twig" extension.
Comment by
WanWizard
September 2015
permalink
example for creating module in fuelphp
I give you the link? I can not be more public than that?
Comment by
WanWizard
September 2015
permalink
Can i use wordpress like plugins system in FuelPHP?
Wordpress is a CMS. FuelPHP is an application development framework. Hooks and Plugins are application level functionality, and FuelPHP is not an application. Your mixing two different things.
Comment by
WanWizard
September 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,368
Last Active
3:49AM
Roles
Administrator