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
Multiple sites utilizing the same application, loading configurations from the database.
If it's that simple, maybe do the following: Setup a global database containing all your config stuff, and a database per subdomain. Define these two profiles in your database config. Add some logic to it to determine the database name of the…
Comment by
WanWizard
June 2011
permalink
Email Library
It would be nice to convert this into a driver architecture, and abstract these calls into the driver, so you can do class Controller_Testmail extends Controller { public function action_index() { $email = new \Email\Email::factory(…
Comment by
WanWizard
May 2011
permalink
file upload, save under different name
Register a "before" callback, it gives you access to the 'saved_to' and 'saved_as' fields of the file array, and allows you to alter both path and name before saving. You can also use the "after" callback, ha…
Comment by
WanWizard
June 2011
permalink
How to upload , resize and save an image
The image driver does an extension check to see if the filetype is valid. Since your file doesn't have an extension, the check fails and bails out with this error.
Comment by
WanWizard
May 2011
permalink
Autoloading class on FuelPHP needed
This looks to me like a rerun of your discussion with Jelmer on IRC, and you still don't seem to get it. How does an autoloader work? As soon as you reference a class, PHP will check if that class is already loaded in memory. If so, it will us…
Comment by
WanWizard
June 2011
permalink
Fuel::get_paths() and modules
Modules are not added to global search paths, because it would ruin module separation. Files are found in Fuel via the Fuel::find_file() method, using a relative name/path and a time. If you add a module to the global search path, all of a sudden e…
Comment by
WanWizard
June 2011
permalink
Basic named route example
Reverse routing is something experimental, and afaik not yet complete. The idea behind reverse routing is that you define a mapping between URL and controller/method in your routes. When you want to generate a link in a view, you don't use a h…
Comment by
WanWizard
June 2011
permalink
using a php framework vs. free-form coding
It's difficult to comment on someone else's code based on a single statement, without actually having seen any of it. See my statement in that light. In my experience, if you are facing the task of modernizing an old procedurally written …
Comment by
WanWizard
June 2011
permalink
Where clause on 2 Models
See the 'relations' page of the ORM documentation. You need to specify your related table on the query: Model_Ticket::find() ->related('match') ->where( 'match.start', '>', $time) ->ge…
Comment by
WanWizard
June 2011
permalink
CI-like MY_Controller
See the View class documentation. Your view object is stored in $this->template->content, so use $this->template->content->set() to set variables.
Comment by
WanWizard
June 2011
permalink
using a php framework vs. free-form coding
Functions, in the form of 'helpers', as best stored in a static class. // instead of this include 'helpers/functions.php'; $var = myfunction(); // do $var = Helpers::myfunction(); where, in this example, Helpers is a class i…
Comment by
WanWizard
June 2011
permalink
$_FILES validation?
So actually all you're after is an error message? Since you'll have to process (and possibly store) validation error messages as well, what's wrong with if (empty($_FILES)) { // no files uploaded message here } else } // use …
Comment by
WanWizard
June 2011
permalink
Default route not working
Routes are parsed and processed in the constructor of the Request class, which uses the Router class for the actual work. In the Router class, the find_controller() method is in charge of locating the controller to be loaded.
Comment by
WanWizard
June 2011
permalink
using a php framework vs. free-form coding
For me personally, the benefits of a framework are - you're using a standard, code can be maintained by others - typically uses several design patterns, promoting reusability and DRY - all dev time is spend working on app logic, not on &qu…
Comment by
WanWizard
June 2011
permalink
Default route not working
Either way, this is exactly how Fuel is configured out of the box, but with the welcome controller instead of your dashboard. I just installed RC3 here, and that works without problems, so it's not RC3 related. What was your previous fuel vers…
Comment by
WanWizard
June 2011
permalink
Parser problem with View location hardcoding
Fixed, it was indeed the pathinfo() that was behaving funny...
Comment by
WanWizard
June 2011
permalink
Idea: maintenance flag file
I wouldn't be for it, as it would mean extra file I/O for every page request, ever for users that are never going to use it. If such a feature would be part of the core, the information has to go into the config file. But I think this should …
Comment by
WanWizard
June 2011
permalink
oil refine migrate on ubuntu with xampp mysql server undefined function ..
Agreed, if PHPMyAdmin works, there's nothing wrong with your PHP installation. I've noticed in the error message that it tries to load the function from the \Fuel\Core namespace, which will not work, since all internal PHP functions are d…
Comment by
WanWizard
June 2011
permalink
Parser problem with View location hardcoding
I'm still clueless to where the './plugins/test' comes from. That even happens when you hard-code 'plugins::test'? What PHP version are you using? What platform? I've tested the result of the pathinfo() calls in the pa…
Comment by
WanWizard
June 2011
permalink
Parser problem with View location hardcoding
Module view loading is supported through View::find_file(), which is utilized by the parser as well. I don't have any problem loading module views, direct or via the parser, as long as the module is loaded first. Did you add the module before …
Comment by
WanWizard
June 2011
permalink
Problem with File::read_dir when using area
This time not all Fuel bugs: // create one file in each newly created directory $rval1 = \File::create($basepath.'level1', 'foo1.txt', 'contents of file foo1.txt'); $rval2 = \File::create($basepath.'level1'.D…
Comment by
WanWizard
June 2011
permalink
Problem with File::read_dir when using area
No trouble at all, I'm very happy that you've found these issues, it's difficult for us to test it all. This bug should now fixed...
Comment by
WanWizard
June 2011
permalink
oil refine migrate on ubuntu with xampp mysql server undefined function ..
installed the PHP mysql extensions? On Redhat I have to install those separately, same as with mbstring and mcrypt. Never used ubuntu, but something like 'apt-get php-mysql'? It works here, both with 'mysql' and 'mysqli…
Comment by
WanWizard
June 2011
permalink
Throwing an error
That's not an error (in the strict sense of the word), but an HTTP status code. You show the standard 404 page (defined in your routes.php config file) via \Request::show_404(); If you want to set a status code on your current page, use the…
Comment by
WanWizard
June 2011
permalink
Problem with File::read_dir when using area
Not you. I've found another bug, which is now fixed...
Comment by
WanWizard
June 2011
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,389
Last Active
8:47PM
Roles
Administrator