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
Force download external file
If you want it in code, you will fetch the file server side, which you can do with for example a cURL request. You then need to store it temporarily on the server, and then use Fie::download() to offer it to the user. There is no ready-made code av…
Comment by
WanWizard
November 2014
permalink
Problem with output_filter
The DB driver does: if ($as_object === false) { $result = $result->fetchAll(\PDO::FETCH_ASSOC); } elseif (is_string($as_object)) { $result = $result->…
Comment by
WanWizard
November 2014
permalink
Full Page Caching
To start with your last remark, that is correct. And Orm caching is not designed for performance, but for consistency. It ensures that when you query the same record multiple times, you get the same object returned, so a record can not exist in mult…
Comment by
WanWizard
November 2014
permalink
ORM select() and \DB::expr() error
DB::Expr() in Selects is only expirimentally supported in 1.8/develop. So you could try switching to that version. ORM is actually never designed to use select at all, the hydration process really expects all fields to be present.
Comment by
WanWizard
November 2014
permalink
OrmAuth Categories in scaffolded Admin controller
The Ormauth default groups are created here: https://github.com/fuel/auth/blob/1.8/develop/migrations/005_auth_create_authdefaults.php#L29 So: 1 - Banned 2 - Guest 3 - Users 4- Moderators 5 - Admins 6- Superadmins Note that these are only defaults…
Comment by
WanWizard
November 2014
permalink
OrmAuth Categories in scaffolded Admin controller
Yes. It also means you have to change all your code when you switch to Ormauth later, which is why it is coded this way. ;-)
Comment by
WanWizard
November 2014
permalink
Mustache don't work with Model::find()
That will give you an array of arrays. As Mustache (if I understand the docs correctly) uses a section to access an array, you need nested sections, one for the outer array of all books, one for each book. {{#books}} {{#book}} {{name}} …
Comment by
WanWizard
November 2014
permalink
task question
The run() method in Refine does: $return = call_fuel_func_array(array($new_task, $method), $args)); Which means it should not be static, and you'll get a message from 5.6 onwards: "Methods called from an incompatible context are now dep…
Comment by
WanWizard
November 2014
permalink
Mustache don't work with Model::find()
I don't know Mustache, but could it be it wants an array there? If so, you need to convert from objects to an array: if ($books = Model_Books::find('all')) { foreach($books as $key => $book) { $books[$key] = $book…
Comment by
WanWizard
November 2014
permalink
OrmAuth Categories in scaffolded Admin controller
users_groups is an Ormauth table. If you haven't configured that (up front), you won't get those tables. If you want to use Ormauth instead, you have to reverse your migrations: php oil refine migrate:down --packages=auth and repeat tha…
Comment by
WanWizard
November 2014
permalink
OrmAuth Categories in scaffolded Admin controller
You probably don't have the table because you haven't run the Auth migrations, which will create the required tables using your db config and your auth config. From the root of your installation, run php oil refine migrate --all
Comment by
WanWizard
October 2014
permalink
Full Page Caching
Those are mutually exclusive. Either you cache the full page (and return it on a hit without running any code), or you have dynamic data. You can't have both. We use a system where widgets are generated by HMVC calls to module controllers, a…
Comment by
WanWizard
October 2014
permalink
Composer
I simply haven't had time to test it, due to personal circumstances. If you are in a position to manually merge it in your repo's, and test it, I'm happy to accept the PR's.
Comment by
WanWizard
October 2014
permalink
Composer
Yes, that would start out as a git clone, so an update will just pull the updates in.
Comment by
WanWizard
October 2014
permalink
Composer
Assuming you've got the correct composer.json: composer update --prefer-source
Comment by
WanWizard
October 2014
permalink
Database exception whitelist
It won't throw an Exception on a missing db configuration, it probably throws an exception because you want to run a DB command while not having a db configuration. So the obvious answer is: don't do that. ;) Any idea what runs the DB co…
Comment by
WanWizard
October 2014
permalink
"Has many" relation conditions
I never use array syntax, so I have to dive into it. From the looks of it that should be ok. Are you sure you're on the latest version? DB::expr() for where() has been present for a while. You might want to reconsider using it as well, support…
Comment by
WanWizard
October 2014
permalink
Currect Asset file is not loading
As long as the directories are inside the main directories (js. css, img), that is no problem. Asset::css('in/a/directory/cssfile'); works without problems.
Comment by
WanWizard
October 2014
permalink
Currect Asset file is not loading
Other than use separate Asset instances, no.
Comment by
WanWizard
October 2014
permalink
Remember me doesn't work
It is set here https://github.com/fuel/auth/blob/1.8/develop/classes/auth/login/driver.php#L253 when the remember_me() method is called. If that is called, and you have a logged-in user, that should work. Just double checked here, and my apps don…
Comment by
WanWizard
October 2014
permalink
Remember me doesn't work
If you enable "remember_me" in the config, the session will be created. It will not have any content unless you call Auth::remember_me(), which actually stores the current users id in the session. So perhaps you have a logic error in yo…
Comment by
WanWizard
October 2014
permalink
Return a list of users except logged in user
In your custom method, $current_user is a local variable, but it's not set anywhere. Assuming you're using the Auth package for auhtentication, you can use \Auth::check() to see if someone is logged in or not, and \Auth::get('user…
Comment by
WanWizard
October 2014
permalink
Many-to-many relationship model
1. Your relation definition looks ok. 2. That depends. There are basically two schools of thought. One that says that the ORM is the model, and therefore Model method calls are done in the controller (you'll see this in most examples, it is …
Comment by
WanWizard
October 2014
permalink
"Has many" relation conditions
This is a class property definition, and you can not add function calls (or in this case class method calls) to it. You can work around this in the _init static method: public static function _init() { static::$_has_many['maintenance_task…
Comment by
WanWizard
October 2014
permalink
Managing Assets in Themes and Template
Ultimately a little bit, because when you want to load an asset, it will do a file_exists() to check if it exists, and if not, check the next path. If found it will also get the mtime() of the file. I don't think it's really noticable, un…
Comment by
WanWizard
October 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
3:53PM
Roles
Administrator