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
Users and permissions
That is odd. On all action columns, the Orm Typing observer is active to automatically serialize on save, and unserialize on read. I checked the code, and it will convert a NULL value to array(), so I'm very curious to see why that doesn'…
Comment by
WanWizard
November 2013
permalink
FuelPHP runing in WAMP with php 5.4.16
The interesting thing here is that it says "undefined method". So it can load the class, otherwise the error would be different. Now, add_namespace() is a method that has been there since day 1, so could it be possible that you have somet…
Comment by
WanWizard
November 2013
permalink
Users and permissions
The actions column in the join table act like a filter. So on the permission record you define all possible actions for that permission, say array(0 => 'A', 1 => 'B", 2 => 'C"). Then in the action of the join…
Comment by
WanWizard
November 2013
permalink
Users and permissions
The Auth models use the Observer_Typing to automatically serialize/unserialize the action arrays. This has been in there since day one, so why in your case it isn't unserialized I don't know. I can't reproduce it here, so I don'…
Comment by
WanWizard
November 2013
permalink
Twig with FuelPHP
From a FuelPHP point of view, it doesn't matter with template engine you use to render your views, they all work identical. Only the PHP engine itself is (obviously) included in the core, to add support for other engines you need to always_load…
Comment by
WanWizard
November 2013
permalink
ManyMany with model in the middle (with attributes)
They are very sparsely documented here: http://docs.fuelphp.com/packages/orm/relations/intro.html, under configuration options. Basically, in the relation definition in your model, you can add a 'conditions' section, which is an array tha…
Comment by
WanWizard
November 2013
permalink
How to change query results from protected to public
You can't, it's a row collection (even if there is only one row). If it contains only one record, you can use $query->current() to get it. On the result of that you can use ['id'] to access individual fields of the row.
Comment by
WanWizard
November 2013
permalink
How to change query results from protected to public
How would you traverse any other result? foreach ($query as $row) { // do something with $row } The object implements Traversable and ArrayAccess so you can treat it like it was an array.
Comment by
WanWizard
November 2013
permalink
How to change query results from protected to public
p.s. just to be clear, this has nothing to do with ORM, this is a resultset of a DB query.
Comment by
WanWizard
November 2013
permalink
Routing Problem
$this->template->content = View::forge('calendar\index'); should be $this->template->content = View::forge('calendar/index'); Note the forward slash ! It is not a path, so don't use the stupid Windows backsla…
Comment by
WanWizard
November 2013
permalink
Routing Problem
A route defines a uri to controller/action mapping. The error is not that your controller can't be found, or that a controller action is missing, so this is not route related. The error is "The requested view could not be found: calendar/…
Comment by
WanWizard
November 2013
permalink
Users and permissions
The PK of \Auth\Model\Auth_Userpermission is (user_id, perms_id). Which are assigned by you when you forge the object. So when it's time to create the record, the ORM will try to create the relation by adding the keys, which it can't, be…
Comment by
WanWizard
November 2013
permalink
ManyMany with model in the middle (with attributes)
That example is indeed complete rubbish. ;-) The most straitforward is my first example in my previous post, with a many-many relation, which you can ignore the presence of your join table model until you actually need it. You can even define cond…
Comment by
WanWizard
November 2013
permalink
Fatal error when using Image
If you have a local fuel/core folder that contains a clone of the git repository (i.e. it contains a .git folder), go into the fuel/core folder, and type: git pull git checkout 1.8/develop Now your applications fuel core should be switched to 1.8/…
Comment by
WanWizard
November 2013
permalink
Removing some validation rules from a fieldset
The entire fieldset system as it exists today is very inflexible to begin with, which is why all these add, delete, enable and disable methods exist. There was even discussion about move methods (to re-arrange fields) in the past! We dislike it so …
Comment by
WanWizard
November 2013
permalink
ManyMany with model in the middle (with attributes)
The "belongs_to" is always the side that has the foreign key. So, assuming the many-many between User and Agency, I would define: User many_many Agency ($user->agencies) Agency many_many User ($agency->users) User has_many Agency_…
Comment by
WanWizard
November 2013
permalink
HMVC Request Uri string problem
This is correct. The Uri class (to be exact the static methods "string", "segment" and "segments") is "context-aware", which means it returns information about the current request. If you want information ab…
Comment by
WanWizard
November 2013
permalink
Database prefix problem
I've looked into it, but although it might solve your particular problem, this doesn't solve THE problem. It creates one. Issue is that if in quote_identifier() you get a string "this.that", can you tell that "this" is…
Comment by
WanWizard
November 2013
permalink
Removing some validation rules from a fieldset
That should work just fine, I use it all the time: $fieldset->field('client_id')->delete_rule('required'); Disabling a field from a fieldset was designed so you could generate the fieldset in the view in different section…
Comment by
WanWizard
November 2013
permalink
Fatal error when using Image
There is a bug in the 1.7 release, which is fixed in the current development code. You can just backport Fuel\Core\Image_Gd from the 1.8/develop branch, or wait for 1.7.1, which is due towards the end of the month.
Comment by
WanWizard
November 2013
permalink
Querying a query. How does it work?
The ORM documentation is unfortunately very sparse, in part caused because the ORM designer is no longer with the team, and his code is *very* complicated. If you have suggestions on how to improve the documentation, please let us know. Or even bet…
Comment by
WanWizard
November 2013
permalink
ManyMany with model in the middle (with attributes)
What do you mean by CRUD way? CRUD is an abbreviation of a computer principle that applies to a single object (create, read, update, delete). If you want to apply that to a one-to-many relation, you'll need a form with two sections: an upper…
Comment by
WanWizard
November 2013
permalink
Redirect back infinite loop
I understand the use case. The problem here is that when you get to step 6, your original "previous" page is lost, so you need to - store your version of a previous page somewhere - have a custom redirect_back that uses that first, referr…
Comment by
WanWizard
November 2013
permalink
problem creating a simple Request Curl object
You get that because twitter responds with an HTTP STATUS 400, and the curl driver sees that as a NOT FOUND. So you need to catch that to avoid the framework taking over. try { $curl = Request::forge('https://api.twitter.com/1.1/search/twe…
Comment by
WanWizard
November 2013
permalink
Customizing form output?
If you use ORM, it can automatically generate the fieldset and the validation rules from it.
Comment by
WanWizard
November 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,373
Last Active
6:41PM
Roles
Administrator