I created the report plugin using the cake command line:
cake bake plugin report
The folder structure for the plugin looks just like the main
application's one - views, controllers, models, etc.
So I created a view/controller for each report I want.
It's very simple. Be sure to read
Raisen - this looks ideal! Will try it out some time soon. Thanks for
sharing.
On 15 October 2010 04:28, Raisen weys...@gmail.com wrote:
I created the report plugin using the cake command line:
cake bake plugin report
The folder structure for the plugin looks just like the main
I have to do a similar thing in my Cake app, so I'm very interested to
hear how you go about it in the end. For the time being I've taken
your first approach of having a report-per-action in the one
controller.
I was thinking about defining each report in the Model layer however
(similar to what
What about a custom routing prefix ( ie. admin routing ) - just add
'reports' to the prefix array and then in the sales controller do a
reports_index function and in the customers controller define a
reports_index function and cakes default routing will give you the 2
urls you used as an example.
I've looked at the profiles routing before, and the reason I didn't
like was because I couldn't use the reports name for the top folder
hierarchy. So basically I have to create a sales_controller.php
instead of reports_sales_controller.php
But it looks like it's the only viable solution so far.
Oh yes, another question. According to the manual:
You can configure the Router to use multiple prefixes too:
Plain Text View
Router::connect('/profiles/:controller/:action/*', array('prefix' =
'profiles', 'profiles' = true));
1. Router::connect('/profiles/:controller/:action/*',
On Wed, Oct 13, 2010 at 12:43 PM, Raisen weys...@gmail.com wrote:
I've looked at the profiles routing before, and the reason I didn't
like was because I couldn't use the reports name for the top folder
hierarchy. So basically I have to create a sales_controller.php
instead of
On Wed, Oct 13, 2010 at 12:44 PM, Raisen weys...@gmail.com wrote:
Oh yes, another question. According to the manual:
You can configure the Router to use multiple prefixes too:
Plain Text View
Router::connect('/profiles/:controller/:action/*', array('prefix' =
'profiles', 'profiles' =
On 14 October 2010 07:17, cricket zijn.digi...@gmail.com wrote:
But let's back up a bit--do you have Sale Customer models? What I
was getting at in my earlier suggestion was that you could declare
options in each model for how its reporting would be conducted.
For my situation at least,
I did find a way to make a reports section the way I want - plugins!
Just create a reports plugin and then you can add the sales,
customers, etc... controllers/views. The url will look like:
http://url.com/reports/sales/
On Oct 13, 1:15 pm, Michael Tokar michael.to...@gmail.com wrote:
On 14
Interesting. Do you think you could post some sample code of your report
plugin?
On 14 October 2010 09:41, Raisen weys...@gmail.com wrote:
I did find a way to make a reports section the way I want - plugins!
Just create a reports plugin and then you can add the sales,
customers, etc...
Assume that I have a reports page where there would be multiple sub-
reports. I want the urls to look like:
/reports/sales/
/reports/customers/
One way I managed to do that was to create actions inside the reports
controller for each subreport, but I am trying to do something
different. I want
Why not just use a single controller that $uses each of the models in question?
Router::connect(
'/reports/:type',
array(
'controller' = 'reports',
'action' = 'view'
),
array(
'type' = '[a-z]+',
'pass' = array('type')
)
);
public function
13 matches
Mail list logo