Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller composition #46

Open
mescalito opened this issue Oct 24, 2011 · 3 comments
Open

Controller composition #46

mescalito opened this issue Oct 24, 2011 · 3 comments

Comments

@mescalito
Copy link

Hi again!! this is not an issue, is more a question
I'm glad you liked the bug I catched last week!
Here is something I would like to ask you, maybe (just maybe) you can figureout...

I want to add some new code and functionalities to the user's controller but I don't want to change the "main" plugin files.

I was thinking if it is possible leave the "main" plugin controller as it (unchanged) "\app\plugins\spark_plug\controllers\users_controller.php" and create a secondary controller with all the new code and functionalities, something like this "\app\controllers\users_controller.php" and extends the plugin "main" controller.

Is that possible? and how achieve that?

Or do you think is there any other way to do what I want?

Thanks!
http://stackoverflow.com/questions/7878636/extends-cakephp-plugin

@steinkel
Copy link
Collaborator

hi. dependening on the features you want to add i could know better the
way to do it. we could also change the core to add some callback hooks in
the auth process to extend it easier.
El 24/10/2011 19:14, "mescalito" <
[email protected]>
escribi:

Hi again!!
I'm glad you liked the bug I catched last week!
Here is something I would like to ask you, maybe (just maybe) you can
figureout...

I want to add some new code and functionalities to the user's controller
but I don't want to change the "main" plugin files.

I was thinking if it is possible leave the "main" plugin controller as it
(unchanged) "\app\plugins\spark_plug\controllers\users_controller.php" and
create a secondary controller with all the new code and functionalities,
something like this "\app\controllers\users_controller.php" and extends the
plugin "main" controller.

Is that possible? and how achieve that?

Or do you think is there any other way to do what I want?

Thanks!
http://stackoverflow.com/questions/7878636/extends-cakephp-plugin

Reply to this email directly or view it on GitHub:
#46

@mescalito
Copy link
Author

Hi steinkel!
Thanks for the message, I'm thinking about wrap all the authentication process on a modal window, that means that all the client-request and server-response will be AJAX-JSON.

In the other hand I would like to update the plugin every time you make an update/commit on the main branch, therefor my idea is to leave alone your "spark_plug" pluginas as it is just right out-of-the-box, while I add new functions to handle the JSON response etc.

I was thinking to add a new file on app/controllers/user.php then extends "spark_plug" plugin and add new features.

Thanks for your time!

@steinkel
Copy link
Collaborator

If you need to build an alternate login system, you can use the
Authsome::login directly and set the user in the session. Spark uses
Authsome internally and will recognize the user to check permissions. This
way you can keep the static login page AND the new modal login.

2011/10/27 mescalito <
[email protected]>

Hi steinkel!
Thanks for the message, I'm thinking about wrap all the authentication
process on a modal window, that means that all the client-request and
server-response will be AJAX-JSON.

In the other hand I would like to update the plugin every time you make an
update/commit on the main branch, therefor my idea is to leave alone your
"spark_plug" pluginas as it is just right out-of-the-box, while I add new
functions to handle the JSON response etc.

I was thinking to add a new file on app/controllers/user.php then extends
"spark_plug" plugin and add new features.

Thanks for your time!

Reply to this email directly or view it on GitHub:
#46 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants