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 or aggregate
Something like: class Model_Carlabels extends \Orm\Model{ protected static $_table_name = 'cars_labels'; protected static $_belongs_to = array( 'logs' => array( 'model_to' => 'Model_C…
Comment by
WanWizard
September 2017
permalink
Logging class instance
Please make an issue for this feature request at https://github.com/fuel/core/issues
Comment by
WanWizard
September 2017
permalink
Logging class instance
The Log class is only intended for internal Fuel logging. It was never designed to serve other purposes, none of the other log functions support an instance either. You can easily do: $mylog = new \Monolog\Logger('mylog'); and do whatever …
Comment by
WanWizard
September 2017
permalink
Input::extension() doesn't work in HMVC request
Where exactly do you use this? If I do var_dump(Input::extension());die(); in action_index() of the welcome controller, and I use the URL http://fuel.dev/19develop/welcome/index.html it dumps "html" as it should?
Comment by
WanWizard
September 2017
permalink
Rest for AJAX, CSRF token and AJAX request
You're welcome. Let me know if it needs more tweaking.
Comment by
WanWizard
September 2017
permalink
Rest for AJAX, CSRF token and AJAX request
This should do it: https://github.com/fuel/core/commit/24b7e0fe9825e78525c3f11e83096b1ab13f44bd
Comment by
WanWizard
September 2017
permalink
Rest for AJAX, CSRF token and AJAX request
I get your point. I read in the config comments: "Expiry of the token in seconds. If zero, the token remains the same for the entire user session.". However, if you look at the code, it isn't implemented like that. Instead, this valu…
Comment by
WanWizard
September 2017
permalink
Several modules in module
It is important to have terminology right. A module is a self-contained group of classes, views, config, language files, etc., so its functionality can be re-used in different applications. There is no direct relation to the segments in the URL, oth…
Comment by
WanWizard
September 2017
permalink
PHP-DI integration
What do you want to use it for? Fuel itself won't be able to use it, and due to the heavy use of statics integration will be difficult.
Comment by
WanWizard
September 2017
permalink
Rest for AJAX, CSRF token and AJAX request
Make sure the _token field is updated before every POST?
Comment by
WanWizard
September 2017
permalink
Rest for AJAX, CSRF token and AJAX request
If you use the javascript functions, you always have the correct and valid token as stored in the cookie. You write "upload an image, than submit". That sounds like two POST requests. If that is the case, the first request will invalidate …
Comment by
WanWizard
September 2017
permalink
help me.., i'm blank :P
Enable the profiler in the config, enable database profiling in your db config, and check what SQL is generated, and how it differs from what you typed in manually.
Comment by
WanWizard
September 2017
permalink
Rest for AJAX, CSRF token and AJAX request
Your token variable name is configured as "_token"? You no only get this error when the token is wrong, but also if the token can not be found in the input. It is configured in app/config.php, security.csrf_token_key. If you haven't s…
Comment by
WanWizard
September 2017
permalink
Rest for AJAX, CSRF token and AJAX request
1:If you want to block non-ajax access, yes.You can force a return format by setting the $format propery in your controller to "json". This will disable the format autodetection.That depends on your needs. In general, you use the HTTP stat…
Comment by
WanWizard
September 2017
permalink
Orm Auth issue
If you can reproduce it, you can enable the profiler. It will show you a code backtrace of where the query originated. I can't imagine anything in the framework causing this, all our apps use Ormauth, and all always run on the latest develop (…
Comment by
WanWizard
September 2017
permalink
Orm Auth issue
There isn't anything in the Fuel code that would update data. Migration 005 of the Auth package will create an admin and guest account if they don't exist, but that code does not contain an update query, nor something that would update the…
Comment by
WanWizard
September 2017
permalink
Custom (http) exceptions
Can you try this closure in your index.php? https://bin.fuelphp.com/snippet/view/OS
Comment by
WanWizard
September 2017
permalink
How to setup these route(s)?
The route closure is executed at the same place a controller is normally called, in the execute() method. And the first thing that happens there is that "active" is set. I've just tested this with the following route, 'test…
Comment by
WanWizard
September 2017
permalink
Nestedset change item order
Which ones depend on your dropping mechanism. In general, we insert before, so we pass the id of the node to be moved, and the id of the node in front of which it should be dropped. You have to read the method call as "make $current the previou…
Comment by
WanWizard
September 2017
permalink
Custom (http) exceptions
I'll have to look into that, as I want to make sure not to break anything.
Comment by
WanWizard
September 2017
permalink
Custom (http) exceptions
The reserve_routes snippet is only relevant in case of modules with their own route file, and it is there to make sure that when module routes are loaded, routes like _404_ are not converted to module/_404_. It has nothing to do with what you are ex…
Comment by
WanWizard
September 2017
permalink
can not access to custom header variable
No, because text/plain is no data content type. How would you parse that data? Nothing says that is contains json. or multiform/data. or a posted image. or... We're not going to hardcode anything weird just because you happen to have a non-com…
Comment by
WanWizard
September 2017
permalink
can not access to custom header variable
Because in your plain PHP example you simply ignore the content type, you assume that whatever is input is in application/json format, and process it as such. Fuel can't do that. As the input can be in different formats (Fuel supports all obiou…
Comment by
WanWizard
September 2017
permalink
can not access to custom header variable
logical, json data should be of type application/json? You have to set the correct content type on your ajax call.
Comment by
WanWizard
September 2017
permalink
Nestedset change item order
I didn't describe a swap, I described the move of a node. Which is exactly what drag and drop does, we have plenty of apps that use that kind of operation, which the type of URL I used. We only pass two id's, you don't need more to mo…
Comment by
WanWizard
September 2017
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,366
Last Active
April 29
Roles
Administrator