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
8245
Activity
How to manage an oil generated app with GIT
It depends a bit what you want, because there are a lot of options. The only repository that is relevant for you is fuel/fuel, as this is where your application will like. All others are git submodules, and I would leave them like that so you can e…
Comment by
WanWizard
May 2012
permalink
Where condition on related table
Like all other items that have a notion of hierarchy, ORM also uses dot-notation: ->or_where('author.name', 'like', $search)
Comment by
WanWizard
May 2012
permalink
no layout class
You don't have to do all that, Fuel will take care of that for you. If you have a controller that only contains REST methods (that in your example return json), extend Controller_Rest instead of Controller_Template. If you want to mix interact…
Comment by
WanWizard
May 2012
permalink
Black images when using image class for image processing
This can happen when using GD if you have an indexed-colored PNG image instead of a true-color image with an alpha channel, and you combine it with an image that has transparency. So the problem is in the original image. I don't know enough ab…
Comment by
WanWizard
May 2012
permalink
Incorrect example in Model_Crud documentation?
No, both syntaxes lead to the same result, we don't promote one over the other so the examples use both.
Comment by
WanWizard
May 2012
permalink
Example of Model method and the controller that calls it
CRUD is a common acronym for Create, Read, Update, Delete, a set of operations you do on a database to maintain the data. Both Model_Crud and ORM models provide methods that allow you to execute these functions, but in a different way, and with a d…
Comment by
WanWizard
May 2012
permalink
How do I make a task for a cronjob
Through cron? Or through some kind of control panel that tries to fool you into believing it is cron? Because those tasks don't run in a commandline context at all, which is what oil is build for.
Comment by
WanWizard
November 2011
permalink
Example of Model method and the controller that calls it
You pick a solution based on the requirements that you have: Query Builder: - Use it if you want to write your own queries, either by coding SQL yourself, use by using the helper methods. - Create model classes as standard classes, no extension n…
Comment by
WanWizard
May 2012
permalink
Class 'finfo' not found
Point your provider to http://www.php.net/manual/en/fileinfo.installation.php This extension is enabled by default as of PHP 5.3.0. Before this time, fileinfo was a PECL extension but is no longer maintained there. However, versions prior to 5.…
Comment by
WanWizard
April 2012
permalink
Example of Model method and the controller that calls it
Why use the ORM model, and then write your own queries? public static function get_beer() { return static::find()->where('beer', '=', 'delish')->get(); } And I would make it more generic, instead of hard…
Comment by
WanWizard
May 2012
permalink
FuelPHP and PDO prepared statement with named placeholders
You can access the PDO connection created using // get the connection id for the default DB instance $db = \Database_Connection::instance()->connection(); // $db now contains the PDO object $db->prepare('your query here');
Comment by
WanWizard
May 2012
permalink
FuelPHP and PDO prepared statement with named placeholders
The current PDO driver is generic, and doesn't support PDO specific methods. The param() or bind() method doesn't use them as well, they simply do a string replace. Most people don't code their queries manually, but use either the Qu…
Comment by
WanWizard
May 2012
permalink
NinjAuth - Error if user hits Cancel at Facebook/Google auth page
I do, but i haven't implemented a Facebook or Google login as of yet.
Comment by
WanWizard
April 2012
permalink
Translating exception messages
You have a point, this is not handy, these should be separate exceptions. Can you create an issue at http://github.com/fuel/auth/issues so it can be picked up?
Comment by
WanWizard
April 2012
permalink
try...catch a /Database_Exception not working
You mean try { \DB::query('select * from ZZZ')->execute(); } catch (\Database_Exception $e) { echo $e->getMessage(); } The slash has to be a backslash, it's a namespace separator.
Comment by
WanWizard
April 2012
permalink
Relation Database ORM Design
I see you've asking the same question in the CodeIgniter forum. I think you need to understand that a framework doesn't teach or help you to learn programming, it just provides you the tools to do things better and quicker. The questions …
Comment by
WanWizard
April 2012
permalink
How to dynamically change a view using ajax
Better and more future proof is class Controller_RoomsRest extends Controller_Rest { public function post_filter_list() { $this->format = 'html'; $this->response(View::forge('rooms/list_iterator',…
Comment by
WanWizard
April 2012
permalink
Routing Full URL's and double slashes
That is an illegal URL, so you should encode it. This way, the slash will be seen as a directory/path separator, so FuelPHP will split it. The double slash itself is already stripped by apache. Just var_dump($_SERVER) to see that: 'PATH_INFO…
Comment by
WanWizard
April 2012
permalink
Does Fuel project still live??
FuelPHP has been around since October 2010, so while it's not as old as some other frameworks, it didn't exactly start yesterday either. Lack of activity here could also mean other things. It might be that the framework is so easy to use …
Comment by
WanWizard
April 2012
permalink
How to dynamically change a view using ajax
The Controller_Rest doesn't use $this->template (obviously), so that is indeed not going to work. As documented (http://fueldevdocs.exite.eu/general/controllers/rest.html), you need to use the response() method to set your response value(s)…
Comment by
WanWizard
April 2012
permalink
try...catch a /Database_Exception not working
Are you sure it's an exception, and not a PHP error? Exceptions can be caught, PHP errors can only be reported...
Comment by
WanWizard
April 2012
permalink
Problem with oil rename field
As far as I know this has been fixed some time ago, is your code up to date (i.e. are you using 1.1/develop)?
Comment by
WanWizard
April 2012
permalink
Relation Database ORM Design
See http://fueldevdocs.exite.eu/packages/orm/creating_models.html You'll have to define $_primary_key for every model because they deviate from the standard. In terms of relations, AdClassifieds has a 'has_many' to all other tables, …
Comment by
WanWizard
April 2012
permalink
Grouping fields together in Fieldset class
You can pass a custom config to a fieldset using set_config(). A snippet from one of my applications: // fetch the defined form config $formdata = \Config::get('form'); // add a form header $formdata['form_template'] = str_repl…
Comment by
WanWizard
April 2012
permalink
Grouping fields together in Fieldset class
multi_field_template is used for radio button and checkbox collections (= that have multiple options). It is possible to add a fieldset to another fieldset (nest them). So what you can try is to create a second fieldset for the group of date fields…
Comment by
WanWizard
April 2012
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,409
Last Active
3:44AM
Roles
Administrator