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
Hooks in Fuel
I don't expect that to be implemented in the current codebase, the 2.0 event library already supports priorities within an event.
Comment by
WanWizard
September 2015
permalink
Is it possible to write multiple SELECTs using DB::select() than raw DB::query()?
You can just construct two queries, and use one in the other as a subquery: $subquery = DB::select('id')->from('table'); $result = DB::select()->from('othertable')->where('foreignkey', 'in'…
Comment by
WanWizard
September 2015
permalink
my route code not work
You're welcome, happy coding! :-)
Comment by
WanWizard
September 2015
permalink
my route code not work
Can't imagine that it has to do with the operating system version. The variable is created in $fieldset = \Fieldset::forge('form'); If that fails, the ->add() call on the next line with give you a PHP error (call on a non-obje…
Comment by
WanWizard
September 2015
permalink
my route code not work
It is impossible that $this->formfieldset() would ever return false.
Comment by
WanWizard
September 2015
permalink
my route code not work
With the code I gave you the var_dump() can't return false?
Comment by
WanWizard
September 2015
permalink
my route code not work
PHP applications are stateless, you can't carry anything from one request to the next, unless you store it into the session. So if you split the action into a separate get and post, you end up duplicating some of your "prepping" code…
Comment by
WanWizard
September 2015
permalink
my route code not work
Normally you post a form to the same URL, and after processing the form, redirect away, which will prevent users reloading the form in the browser. If you want to split the logic for displaying the form and processing it in the controller, you can …
Comment by
WanWizard
September 2015
permalink
my route code not work
What is exactly the problem? The form loads fine here, and if I request the URI directly, I get a 404. If I replace your Controller_hmvc before() method with a var_dump(\Request::is_hmvc()), it returns true when I request the root and your form is…
Comment by
WanWizard
September 2015
permalink
my route code not work
You should not return an exception, you should throw an exception. My point is that return array( 'articles/comments/addcomments/(:any)' => function () { return \Request::forge('articles/comment/add/$1')->…
Comment by
WanWizard
September 2015
permalink
prevent session data lost when image not found
BTW: the reason this isn't there by default is that a missing image is a coding error that should be fixed. If you had used the Asset class to access the image, you would have had a not-found error.
Comment by
WanWizard
September 2015
permalink
prevent session data lost when image not found
Change your .htacess rewrite rules. The default rules rewrite everything that isn't a file or a directory to index.php, you may want to exclude the public assets folder, so you get a webserver 404 instead of a rewrite to your app.
Comment by
WanWizard
September 2015
permalink
my route code not work
Where in the docs does it state that inline routes support any parameters? And why use an inline route for this, you're not adding any logic, so a normal route mapping would work fine too?
Comment by
WanWizard
September 2015
permalink
Fuel\Core\Date vs \DateTime
We wrote an entire new Date class, that was interface compatible with PHP's DateTime class (so you could also use it in any function or method that uses DateTimeInterface as a typehint. See https://github.com/fuelphp/common/blob/master/src/Date…
Comment by
WanWizard
September 2015
permalink
Auth package migrations with changed models
If you extend, you should make sure to remain compatible. You obviously havent, so that is what you need to fix. Since you have extended, migrations will use your extended version, that is the entire idea behind framework class extensions in Fuel..…
Comment by
WanWizard
September 2015
permalink
Send a notify email when fatal error happens
Yes. If you're on 1.8-dev, it's very easy as the Log class now has an initialize() method you can overload. If you're on 1.7+, you should be able to either backport the Log class, or to upgrade to 1.8-dev. Once done, this is an exam…
Comment by
WanWizard
September 2015
permalink
Send a notify email when fatal error happens
You can also use a custom log handler. Monolog has quite a lot of ready-made handlers (https://github.com/Seldaek/monolog/tree/master/src/Monolog/Handler) and you can roll your own pretty easily.
Comment by
WanWizard
September 2015
permalink
Passing functions to views error !!
Are you up to date? This has been addressed here: https://github.com/fuel/core/issues/1881
Comment by
WanWizard
September 2015
permalink
validate elements of array
Use array_reduce() with a closure: $checknumeric = function($carry, $value) { return $carry and is_numeric($value); }; $result = (is_array($input) and array_reduce($input,$checknumeric,true)); $result will be true if $input is an array and al…
Comment by
WanWizard
September 2015
permalink
File upload problems
Read up on the use of composer: https://getcomposer.org/ Change 2.0.3 to 2.0.4 and run a composer update. That will install the new version.
Comment by
WanWizard
September 2015
permalink
File upload problems
This is the one in the core folder. I meant the composer.json in the root of your application installation (the directory in which you find 'oil'. The latest 1.7 release should contain 2.0.2: https://github.com/fuel/fuel/blob/1.7/master…
Comment by
WanWizard
September 2015
permalink
why did i obtain tow results from my query while i expected to get only one result.
get() gets everything so the result is an array with zero, one or more objects. Your initial post said that you got more results while you were sure the database contained only one, which is why I responded the way I did. If you meant to say it re…
Comment by
WanWizard
September 2015
permalink
AJAX Session Rotation
All our apps use db sessions, and rely on ajax a lot, and I can't recall the last time we had an issue with this. Not with recent Fuel versions at least...
Comment by
WanWizard
September 2015
permalink
skip for duplicate row
Make sure your table has a primary key, and catch the duplicate key exception on INSERT? Or do a SELECT first if you have a lot of duplicates.
Comment by
WanWizard
September 2015
permalink
How to return to user, and perform computation in the background
Normally you would use a queue mechanism, and a queue processor you can run via a task and a cron job so it can run server side in the background. For example something like https://bitbucket.org/codeyellow/queue if you want something simple. Note…
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,368
Last Active
7:53AM
Roles
Administrator