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
Format:forge() decoding dose not work
Works fine here. You see escaped unicode because that is the default behaviour of json_encode(). PHP 5.4+ has an option to disable that behavior, but as that makes the result less portable, the Format class doesn't use it. Test code:
Comment by
WanWizard
September 2019
permalink
Save form data with redirect on validation failure
That dependents. If you have a hardcoded forum, either in HTML or using the Html / Form classes, you need to pass the data back to the view, and hardcode the mapping between that data and form field values. If you use a fieldset, it has a populate(…
Comment by
WanWizard
September 2019
permalink
Item confirmation application
Ok, not a problem, it only means you have to code everything manually. The process flow in the action method still applies.
Comment by
WanWizard
September 2019
permalink
Item confirmation application
Normally you don't use GET variables, Fuel uses URL segments that map to method arguments. Say you have Controller Test{ public function action_go($parm1, $parm2 = null) { }} If you request "/test/go", you will get an error (as…
Comment by
WanWizard
September 2019
permalink
Item confirmation application
What do you mean with "post to work"? Processing post data? Populating a form? Repopulating a form after a post?
Comment by
WanWizard
September 2019
permalink
What's wrong with \File class or with me?
Fixed this: https://github.com/fuel/core/commit/639d766486ed90bcb6fd1e737a9374ee7345daa9
Comment by
WanWizard
August 2019
permalink
What's wrong with \File class or with me?
The short answer: I have absolutely now clue. I can see that the array is created, and is passed to File_Handler_Directory, where it is stored in the "content" property. But there is no code in that class that does anything with that prope…
Comment by
WanWizard
August 2019
permalink
Item confirmation application
Yes, as long as it is below where $view is created. As for the Model, I think this will do: public static function get_results() { $result = DB::query('SELECT substring(cat.item_class_cd,1,1), cat.class_name from MAS…
Comment by
WanWizard
August 2019
permalink
redis, temp dir, swoole
For File handling you might want to look at Frank's FlySystem (https://flysystem.thephpleague.com/docs/) which is great in abstracting File I/O to different storage backends, we use it for both archiving and for publishing public files to a sep…
Comment by
WanWizard
August 2019
permalink
Item confirmation application
It looks like you are missing even the basic knowledge of PHP. "use" imports a classname into the current namespace, it doesn't do anything else, it is a declaration. Your code does $view->data = $result; while $result is never def…
Comment by
WanWizard
August 2019
permalink
Model_Temporal::find() throwing incompatible definition error
It is related to the PHP version, which now emits an error when this happens. Fixed here: https://github.com/fuel/orm/commit/c21fe18f5cfaa32a2aebf07eb05c8c7735b60b54, you can switch to the 1.9/dev codebase for the ORM, backport the fix yourself, or…
Comment by
WanWizard
August 2019
permalink
redis, temp dir, swoole
Fuel uses monolog for all logging. In order to use a different monolog handler, you need to extend the Log class in your app, and overload the static function initialize(), where you can configure the static::$monolog instance any which way you want…
Comment by
WanWizard
August 2019
permalink
Item confirmation application
If you want to send data to a view, you can simply assign it to the object: $view->content->data = $result; and then in the view iterate over it and generate the HTML.
Comment by
WanWizard
August 2019
permalink
Item confirmation application
Start with a var_dump($result), so you can see what actually is returned. Depending on your config, it might be an array of records, or a Database result object. Which one it is defines how you access the data. If it is a database object, you can i…
Comment by
WanWizard
August 2019
permalink
Item confirmation application
Your question is "how do I implement this application function", which is very difficult to anwer because it depends on the application. - You need to have a user interface- The user needs to use that to post the category number- Your cont…
Comment by
WanWizard
August 2019
permalink
Item confirmation application
There are basically four ways to constuct models, and which one depends on your architecture choices. 1) Use direct DB calls Which is what your example is using. In this case, a model is a class like all others, you have defined a static method &quo…
Comment by
WanWizard
August 2019
permalink
This morning I got an error from connection.php
Does the server run a dual stack, or is IPv6 completely disabled? If not, change it to 'dsn' => 'mysql:host=127.0.0.1;dbname=mydb', If you develop on a Mac, you should do the same.
Comment by
WanWizard
July 2019
permalink
This morning I got an error from connection.php
It means PDO can't connect to the database, so either your DB config is wrong, or your programme can't find the correct config. Most common error are:* using a socket while you need to connect to an IP* using "localhost" instead …
Comment by
WanWizard
July 2019
permalink
Module routes config issue in 1.8.2
You don't need to "always load" routes, routes are automaticly loaded when needed, the app routes always (see row 190), the module routes when needed. If you have none-module routes in a module routes.php config file, you've misu…
Comment by
WanWizard
July 2019
permalink
Module routes config issue in 1.8.2
Even it they are module routes, they still go in routes.php, in this case in your module's config directory.
Comment by
WanWizard
July 2019
permalink
Module routes config issue in 1.8.2
Yes, you define routes in routes.php, not in config.php.
Comment by
WanWizard
July 2019
permalink
How to Select only specific model fields and not ALL related fields?
Yes, it is still the case, the ORM is not a query builder.
Comment by
WanWizard
July 2019
permalink
Is there any way to set RedisException as 500?
> I just want let you know that 500 seems dose not work Works fine here. If I add throw new HttpServerErrorException(); In the action_index() of a controller, I get the 500 view, no problem.
Comment by
WanWizard
July 2019
permalink
Is there any way to set RedisException as 500?
Have to retract that last remark, the current code works as intended if there is no route defined for the exception, which is the intended behavior.
Comment by
WanWizard
July 2019
permalink
Is there any way to set RedisException as 500?
I see by the way that the current index.php doesn't reflect how it is supposed to work. It should be: // Generate the request, execute it and send the output.try{ // Boot the app... require APPPATH.'bootstrap.php'; // ... an…
Comment by
WanWizard
July 2019
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,372
Last Active
1:43AM
Roles
Administrator