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
New and Learning
With whatever response you want to return. Because it's not always about display, it could be an HMVC request that returns a response to the calling controller.
Comment by
WanWizard
October 2011
permalink
SSL
What have you defined as your base_url in the config? It wil be added to the URI you pass to redirect(), and if it contains 'http', that is what will happen. Either have FuelPHP autodetect the base_url (which takes the protocol into accou…
Comment by
WanWizard
October 2011
permalink
New and Learning
Returning anything but a Reponse object is deprecated. In previous versions, a string was exepected. Returning a view worked because it contains a __toString() magic method, which renders the view to a string when requested.
Comment by
WanWizard
October 2011
permalink
Common Pages
In general it's pointless having one in every class. 404's are triggered in FuelPHP by throwing a HttpNotFoundException, which is caught in your applications index.php, which then either loads your custom 404 controller, or shows the defa…
Comment by
WanWizard
October 2011
permalink
How to get controller name in views
You have the controller name available. \Namespace\Controller_Name IS the controller name. What you want is the URI segment. You get that using \Request::active()->uri->segments(). If you want to extract the 'Name' part of the contr…
Comment by
WanWizard
May 2011
permalink
New and Learning
Returning nothing or string values (or anything that evaluates to string) was standard in v1.0, but is deprecated in v1.1. Because we don't remove deprecated functionality until the next release, you can currently still use the old method, as …
Comment by
WanWizard
October 2011
permalink
Code question
Correct.
Comment by
WanWizard
October 2011
permalink
How to get controller name in views
As the property name indicates, it contains the name of the controller (as in the class name). It includes the namespace, because you need that to uniquely identify the controller. \Controller_Name is different from \Module\Controller_Name. For the…
Comment by
WanWizard
May 2011
permalink
Error in FuelPHP v1.1 RC1: Fuel\Core\FuelException [ Error ]: The requested view could not be found
All methods in Fuel that need to find files use Finder::search(). If you start the filename with a slash, the finder will assume it's a fully qualified path, and will not look for it at all. This will trigger your "no such file" erro…
Comment by
WanWizard
October 2011
permalink
Model Calls - Non static
What do you mean by "bind a few together"? Can you give an example (or write it out)?
Comment by
WanWizard
October 2011
permalink
Code question
This looks like old code from the index.php. The idea here was that you could specify your app_path relative to the website docroot, instead of a fully qualified path. By default, it is defined relative.
Comment by
WanWizard
October 2011
permalink
Page rank checker
That is presumably by design. In this case both http and https work without changes to your html.
Comment by
WanWizard
July 2011
permalink
i get trailing dot after the domain name on Response::redirect
Thanks for the email, I haven't had time to check it out. I thought it was an issue in the auto detect code, but you're referring to generate_base_url()? I'll try to find the time tonight.
Comment by
WanWizard
October 2011
permalink
Best practise / advices: Using the cache
Ok, I already wondered. I added an issue for this: https://github.com/fuel/core/issues/613
Comment by
WanWizard
October 2011
permalink
FuelPHP.com 404 Page
Looks like a parsing issue in Pyro, the CMS used for the homepage.
Comment by
WanWizard
October 2011
permalink
ViewModel vs View
You use a viewmodel in two different cases: 1) you want to abstract the view from the controller 2) you want to abstract view logic from the controller An example of case 1: your controller just loads the viewmodel, while in the view model you ma…
Comment by
WanWizard
October 2011
permalink
Nesting Views
In the example, a view object is passed, forged on the spot. But you can pass anything when you create a response object. // Carregar a página. // $view = View::factory('empresa/inicio'); // Carregar os views. // $view->topo = …
Comment by
WanWizard
October 2011
permalink
question about pagination
If your database is properly designed, and the correct indexes are defined, a separate COUNT query is almost always faster. If not, well, then you're doing something wrong...
Comment by
WanWizard
October 2011
permalink
i get trailing dot after the domain name on Response::redirect
Can you the following in your app (for example in config.php) and email me the result at wanwizardfuelphp.com? echo serialize($_SERVER);die(); I can then see if there is something wrong with our autodetect code.
Comment by
WanWizard
October 2011
permalink
question about pagination
Caching might be a solution, but then again, it might not be. If you have a fast database server with lots of memory, and slow or busy local disks, caching might even slow things down. For me, optimizing an application is an iterative process. You …
Comment by
WanWizard
October 2011
permalink
Best practise / advices: Using the cache
In case of the file driver, the expiration timestamp is part of the cache file header, so it should be possible to detect the expiration, delete the cache file, and return false. Sounds like a fix for 1.1, so it behaves similar to the other drivers…
Comment by
WanWizard
October 2011
permalink
connecting to two different DB ( migration)
Correct. It's the only way to define your database in FuelPHP, you can define as many as you need, the ones in there are just examples that map to the different FuelPHP environments.
Comment by
WanWizard
October 2011
permalink
connecting to two different DB ( migration)
Create a second database instance for the second DB, and use that in your queries. See http://fuelphp.com/dev-docs/classes/database/usage.html#/running-queries
Comment by
WanWizard
October 2011
permalink
question about pagination
You will always need to run two queries, one to get the total count, and one to get the records of the current page. First thing I notice is that your two queries are not identical, so that can't be right. Only the select part should be differ…
Comment by
WanWizard
October 2011
permalink
Uri::segment(n, 'test'); using the $default doesnt work
You don't mention the version of FuelPHP you're using, but in 1.1/develop it works as advertised.
Comment by
WanWizard
October 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,369
Last Active
2:12AM
Roles
Administrator