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
Help designing relating models
From a database design and normalisation poinf of view, designing it like that is an absolute nightmare, and will require you do code up everything manually. It will also mean that if you introduce a new service, you can change all the code you have…
Comment by
WanWizard
April 2013
permalink
REST application continues after $this->response is returned
You can not return anything in a before() method. The before is designed as a prepping method, not as something that alters the request flow. If you want that, use router(), which does allow you to return a response. Don't forget to call paren…
Comment by
WanWizard
April 2013
permalink
Best way to force https
If you're entire site has to be https, the best way to handle it is to use a rewrite rule in your servers virtual host. If it's only a couple of pages, then you have to check for it manually (for example in a before method), using Input::…
Comment by
WanWizard
April 2013
permalink
How to make Edit form
Yeah, I know. It's done this way because Oil generated code need to support both ORM and Model_Crud. And only ORM has validation built-in. If your using ORM, I would go for the validation as part of $_properties, use the validation feature fro…
Comment by
WanWizard
April 2013
permalink
Funny $this->response output
Not really, other then to get your debug pants on... sorry.
Comment by
WanWizard
April 2013
permalink
Funny $this->response output
All I can say is that I think there's something wrong with your server installation. If I create a RESTful method here with return array('user_id' => 1); I get the expected output in the browser {"user_id":1}without enc…
Comment by
WanWizard
April 2013
permalink
how to pass parameter in the Form from Views
You didn't mention you had nested views, otherwise I could have pointed this out directly. The standard Oil code (that generates the create/edit construction with the separate _form view) relies on global view variables, which solves the issue…
Comment by
WanWizard
April 2013
permalink
Help designing relating models
I would say: * List has_many Listuser * Listuser belongs_to List * Service has_many Listuser * Listuser belongs_to Service Where Listuser is the junction table (model) between List and Service, and contains user_id (and maybe other data related …
Comment by
WanWizard
April 2013
permalink
Doctrine 2 with FuelPHP
Yes.
Comment by
WanWizard
April 2013
permalink
How to get the updated ORM fields?
No, not after a save(). Before a save you can use is_changed() to see if there was a change, and get_diff() to get an array of the differences between the last original state (i.e. after get or the last save) and the current state. For changed rel…
Comment by
WanWizard
April 2013
permalink
How to make Edit form
Use oil to geneate an scaffold example, see http://docs.fuelphp.com/packages/oil/generate.html#scaffolding Then you'll have all components (controller, ORM model, migration and all crud views). The code generated is not the best, but it gives …
Comment by
WanWizard
April 2013
permalink
how to pass parameter in the Form from Views
In your controller: View::forge('myview', array('value' => 'please type in a name')); Every key you pass in the data array (like 'value' in this example) becomes a local variable in the view.
Comment by
WanWizard
April 2013
permalink
XML vs JSON response headers
The framework does not set either of those headers. Anywhere. The Rest controller only sets a "Content-Type" header.
Comment by
WanWizard
April 2013
permalink
Unexpected response from PUT request
You don't redirect on RESTful calls, you return an HTTP status, optionally including a message explaining the status. Not all RESTful clients don't support HTTP header redirect, so those are bound to fail. Besides that, what is that unau…
Comment by
WanWizard
April 2013
permalink
Log errors with permissions
Note that if you use oil, the files created will get the rights settings assigned to the current logged in user, which might conflict with your apache user. This might be the case here?
Comment by
WanWizard
April 2013
permalink
Cascade delete fails when extending Orm\Model_Soft
Not sure if that is support (yet). Best thing to do is to create an issue for it at https://github.com/fuel/orm/issues, and ping @uru, who created soft deletion.
Comment by
WanWizard
April 2013
permalink
Form::forge method
The documentation mainly touches the form helpers, the static method of the Form class. The Form instance is mainly used internally in the Fieldset class, used to generate forms, and supports built-in form validation. You can use it on it's ow…
Comment by
WanWizard
April 2013
permalink
How to set MySQL time zone?
No, that is not supported.
Comment by
WanWizard
April 2013
permalink
ORM additional fields in relationship table
If the through table has attributes, it's not a through table anymore, it needs a model, and your many-to-many will become two one-to-many's with the new model in the middle. For easy of use you can leave the many-2-many relation in place…
Comment by
WanWizard
April 2013
permalink
Many to Many within the same table
It's the same as any other many-2-many, just write out the relation definition both ways. There is currently no support for reciprocal relations, you if the relation has to be made both ways at the same time (if this is a child of a parent, th…
Comment by
WanWizard
April 2013
permalink
Is partial validation against a data model possible?
You can, but you'll have to remove the "required" rule after you've created the validation object: // create a validation object, and add the model rules to it $val = Validation::forge('userapi'); $val->add_model(…
Comment by
WanWizard
April 2013
permalink
Can I change the page number location in Pagination links?
This has been fixed in 1.6/develop (support for query strings in pagination URL's). Backporting it to a previous Fuel version should be possible, but not easy because it has changed quite a bit.
Comment by
WanWizard
April 2013
permalink
Some issue by using fieldset in combination with ORM
With regards to find(), as I wrote before, find($id) is fine, and will not be removed. The problem with find() is that $id might be NULL, in which case find() did something completely different than you would expect (which is to return no answers),…
Comment by
WanWizard
April 2013
permalink
Some issue by using fieldset in combination with ORM
There is no relation between a fieldset and how you query a model?
Comment by
WanWizard
April 2013
permalink
Some issue by using fieldset in combination with ORM
Then I don't see why your form would not be generated. What if you do a Debug::dump($form) in your view? Fieldset uses the form.php config file to generate the form layout. Did you modify that? Or forgot to upgrade it after a Fuel core upg…
Comment by
WanWizard
April 2013
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
7:12AM
Roles
Administrator