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
Can I use tasks to do photo manipulation in the background?
Not directly, and it won't really run async. This sounds like a job for a message queue mechanism, where the frontend inserts new assignments into the queue for background workers to pick up and process. There are (afaik) two fuel packages fl…
Comment by
WanWizard
March 2013
permalink
App Modules extends of Global Modules
That indeed doesn't work. The route should work, providing it's defined in the app and not in the module. Routes defined in modules are only used when something in the module is loaded via the URL. I can't judge wether or not your de…
Comment by
WanWizard
March 2013
permalink
App Modules extends of Global Modules
Yes, as I said you need to load the module before you can access it. If you don't, the autoloader doesn't know the namespace, and doesn't know where to load the class from.
Comment by
WanWizard
March 2013
permalink
App Modules extends of Global Modules
Not this way. Every module must have it's own namespace, and the namespace must be unique. If not the autoloader doesn't know what to load. If your module names are unique, you can extend like any other class, providing the module that h…
Comment by
WanWizard
March 2013
permalink
email
Afaik there is no verification possible with SMTP, it's a send-and-forget protocol.
Comment by
WanWizard
March 2013
permalink
[Newbie] ErrorException 4096 when trying to query the database
If you want to build an API, have your controller extend Controller_Rest (for API only) or Controller_Hybrid (for a mix of REST and HTML output). It will take care of the output conversion for you (json, xml, etc). In this case the response need to…
Comment by
WanWizard
March 2013
permalink
[Newbie] ErrorException 4096 when trying to query the database
When you set a response, the Reponse class will have to convert your response to a string to be able to echo it to the browser. The error message says you can't echo out a database response object. You can't echo any object, unless that o…
Comment by
WanWizard
March 2013
permalink
[ORM] How to use view tables
Note that you can only SELECT from a view, INSERT/UPDATE are not supported.
Comment by
WanWizard
March 2013
permalink
[ORM] How to use view tables
Yes, you can. You define your views in the model: protected $_views = array( 'viewname' => array( 'columnA', 'columnB', 'columnC', ), ); Then in the query you use Model_…
Comment by
WanWizard
March 2013
permalink
Database documentation generator
Nice. If would be very cool if it could "read" ORM models, and add the relations between the tables to it...
Comment by
WanWizard
March 2013
permalink
Creating a Model including trasnlation
Ah, ok. If this is not static data, I would create an i18n table: menu: id;menu;link menutitle: id;menu_id;language;title You can then define a condition on the relation which will act like a permanent filter on language. This does require that…
Comment by
WanWizard
March 2013
permalink
Creating a Model including trasnlation
What exactly do you want to translate? If this is about property labels (for fieldsets), that already supports i18n, just define the language key as the label.
Comment by
WanWizard
March 2013
permalink
Call a function within another class from another class within the same module.
Correct. If it is routable. And don't forget to execute() it, this will only create the request, If it is not routable (i.e. there is another route that captures this URI), you need to pass FALSE are parameter to prevent a redirect to another …
Comment by
WanWizard
March 2013
permalink
Call a function within another class from another class within the same module.
A module doesn't have a bootstrap. You call a controller method via a Request, you should not call the method directly. If it's a support method (and not an action), it should not be in a controller but in a separate class, which you can …
Comment by
WanWizard
March 2013
permalink
this may be a jst php quection
Store it in a session?
Comment by
WanWizard
March 2013
permalink
this may be a jst php quection
I don't understand a word you're saying. Can you be more specific? Code example perhaps?
Comment by
WanWizard
March 2013
permalink
Work with database
If it's not a relation, but individual columns, there's no other option then to do it by hand. There's nothing to loop over. If you have a lot of these properties, you might want to look at an EAV container, which is more flexible wh…
Comment by
WanWizard
March 2013
permalink
Work with database
Isn't that what this does? if ($model->property_1) echo "Property 1"; ?
Comment by
WanWizard
March 2013
permalink
Work with database
I don't understand the question. Something like if ($model->property_1) echo "Property 1"; ?
Comment by
WanWizard
March 2013
permalink
Question how to handle relations
Easiest to remember: belongs_to is in the model that has the foreign key. So if State has one Country, then: Model_County -> has_many -> Model_State Model_State -> belongs_to -> Model_Country because Model_State contains country_id.
Comment by
WanWizard
March 2013
permalink
Help designing relating models
Ah, ok. Then we're saying the same thing. ;-)
Comment by
WanWizard
March 2013
permalink
Help designing relating models
Correct. What do you mean by "nested" structure? Designing your database is a normal normalisation process. If you have users, and users have zero or more lists, and every list has zero on more items, then define those tables, and the r…
Comment by
WanWizard
March 2013
permalink
lang class
Let me guess: it picks the wrong language. In FuelPHP, Views by default are lazy rendered. This means a View object is only converted to HTML when it's being send to the browser. This happens long after the Request has finished, in your index.…
Comment by
WanWizard
March 2013
permalink
lang class
Looks fine. And the problem is?
Comment by
WanWizard
March 2013
permalink
Help designing relating models
Ideally, you would use migrations to maintain your database schema. It forces you to work in a structured way, and also allows you to easily recreate your database (on the same or another server). In your migrations you use DBUtil calls. As to ORM:…
Comment by
WanWizard
March 2013
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,390
Last Active
7:35AM
Roles
Administrator