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
File upload problems
Which version of Fuel, and of the Upload package are you using (check composer.json)? It should be 2.0.2 or 2.0.4, and not 2.0.3 (which has bugs in it).
Comment by
WanWizard
August 2015
permalink
why did i obtain tow results from my query while i expected to get only one result.
If you get two, there are two. The ORM does not have a habbit of inventing data. And it's really a bad idea to ignore an issue with your code or data, and work around it. The fact that get_one() gives you only one result doesn't mean your…
Comment by
WanWizard
August 2015
permalink
multiple search
rows_offset() is an ORM method, you're constucting a query by hand, you should not do that, it's complex, difficult to maintain, and the way you are doing it, VERY insecure. Read up on ORM crud queries, plenty of select examples in the do…
Comment by
WanWizard
August 2015
permalink
File upload from mobile
$_POST and $_FILES are server side variables, constructed by the PHP SAPI. Totally irrelevant with regards to the type of HTTP client used. PHP expects multipart/form data on a POST, so the app has be be compliant with that, but if the app uses a s…
Comment by
WanWizard
August 2015
permalink
Namespace using class not found
Ah, but that is not importing the namespace, but aliasing it. I looked at and tried: use \Controller\Rest\Exceptions;throw new Tokenexpiredexception(); //My rest exception While you do: use \Controller\Rest\Exceptions;throw new Exceptions\Tokene…
Comment by
WanWizard
August 2015
permalink
What's wrong with this validation object?
You're using incorrect syntax. As the example (http://docs.fuelphp.com/classes/validation/validation.html#rules) shows, there are two ways to define rules for a field: using add_field(), in which you define all rules in a single string (the s…
Comment by
WanWizard
August 2015
permalink
Namespace using class not found
How do you manage to import a namespace (which is option 3)? Which PHP version? Can you post your exact test code at http://bin.fuelphp.com and post the link here? I tried on 5.6.12, and there it really doesn't work, your example fails with E…
Comment by
WanWizard
August 2015
permalink
model to json (only specific fields)
Only on a per-object bases. You can define a static property in your model called "$_to_array_exclude" which is an array of model properties you don't want to expose (so it acts like a filter). Then do foreach ($result as $key =>…
Comment by
WanWizard
August 2015
permalink
Where do I add a non fuel git submodule to my project, what do I need to do to make it work?
You can copy it into app/vendor, and do something like \Autoloader::add_namespace('Parse', APPPATH.'vendor'.DS.'parse-php-sdk'.DS.'src'.DS.'Parse'.DS, false); in your app bootstrap to map the "…
Comment by
WanWizard
August 2015
permalink
Route everything after?
Case 2 should be: 'v1/session(:any)' => 'rest/session$1'
Comment by
WanWizard
August 2015
permalink
Namespace using class not found
Option 3 is invalid, you can not import a namespace in PHP, only classes. Option 4 is something to avoid if you want to keep your code maintainable. So left are options 1 and 2. I personally am in favour of option 1. More typing, but looking at t…
Comment by
WanWizard
August 2015
permalink
Using template without extending Controller_Template
Extend Controller_Hybrid instead?
Comment by
WanWizard
August 2015
permalink
Development of 2.0
Very slowly. We've started a review of the architecture, since the world has moved on since we've started with the blueprints for 2.0. So it could well be that 2.0 is going to look different from what it looks now. Given my illness of t…
Comment by
WanWizard
August 2015
permalink
Namespace using class not found
It's where you defined the class. FuelPHP uses a cascading file system, in which the namespace and classname reflect the path and filename of the file that stores the class. So if you have a file called /fuel/classes/controller/rest/exception…
Comment by
WanWizard
August 2015
permalink
How to look at SQL code generated by Orm\Model?
@philipptempel, build_query() isn't intended to be called from "userland", and get_query() doesn't have any arguments, you use it where you would normally use get() or get_one(), to get the query object instead of the query resu…
Comment by
WanWizard
August 2015
permalink
How to look at SQL code generated by Orm\Model?
Or enable the profiler, and enable db profiling in your db definition. It not only shows you the SQL, but also the performance, the result, and the analysis (only for MySQL backends). @philliptempel, you mean get_query() ? That will return a Datab…
Comment by
WanWizard
August 2015
permalink
Namespace using class not found
Path: \fuel\controller\rest\awesome\authentication.php Is incorrect too, all classes have to be in a "classes" folder, either in app, in a module, or a package. Otherwise the autoloader can't find them. So this should be: \fuel\app\…
Comment by
WanWizard
August 2015
permalink
Fuelphp based web-app
I can't judge what works for you and what not, I can only tell you how I would approach it. As they say, there are a lot of roads leading to Rome, if your solution works for you, who am I to say different?
Comment by
WanWizard
August 2015
permalink
Fuelphp based web-app
Come to think of it., you would have a bit of a challenge with migrations in this scenario, so you might have to combine this with different environments too, so you get: - fuel | - clients | | - clientA | | | - config | | | | - c…
Comment by
WanWizard
August 2015
permalink
Fuelphp based web-app
I understood that is was the same app for different clients, and only the config for these clients is different. With a setup like you propose, it might be a bit more complex, since environments are inside your config folder. Perhaps a different ap…
Comment by
WanWizard
August 2015
permalink
Cache_Storage_Redis Performance for cached DB queries
As long as the functionality of the interface doesn't change, any solution will do. So the tree structure of the identifier must remain, it can't be changed from a tree to a list, that would cause you to loose the ability to delete a par…
Comment by
WanWizard
August 2015
permalink
Fuelphp based web-app
An entire list of questions, I'll try to answer them all... ;-) - One Fuel dir. Not a problem, we only use one Fuel dir for every server, simply change the COREPATH in the index.php and oil files. And if you use phpunit you'll have to c…
Comment by
WanWizard
August 2015
permalink
Cache_Storage_Redis Performance for cached DB queries
It was originally created to mimic the already existing cache classes, and I think it started out as a copy of an existing class, probably the File class. The index is there because the identifier represents a tree structure, like the folder struct…
Comment by
WanWizard
August 2015
permalink
Create custom Cache Storage Driver?
Nope, that is fine, how it should be. This easy extendibility is the main reason why Fuel aliases it's classes.
Comment by
WanWizard
August 2015
permalink
Form won't work when submit button is within "col-md-12"
Since that is purely frontend, HTML and CSS, it can not be a Fuel issue? Form::submit() just generates some HTML, no rocket science at all. Bootstrap uses tags, not tags for buttons, so I suggest using Form::button() instead, and pass "type&…
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
9:34AM
Roles
Administrator