Re: get render output

2009-01-12 Thread mmm

what i want to do is to make Swift Component work with 1.2

http://bakery.cakephp.org/articles/view/swiftmailer-component-tutorial

unfortunately requestAction() is not exactly what i need..


it has a nice feature to assign layouts to HTML emails, currently this
is not working with 1.2(stable).

On Jan 10, 1:23 am, Miles J mileswjohn...@gmail.com wrote:
 Why do you need to do that?

 Look at requestAction().
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



get render output

2009-01-09 Thread mmm

hi group,
i wounder how can i render content to buffer, what i have so far is:

ob_start();
$this-controller-render(null, $this-layout, $view);
$html_msg = ob_get_contents();
ob_end_clean();

however $this-controller-render() always prints content directly to
the browser. my cakephp version is 1.2.0.7962, any ideas?

thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to return a json object from a controller?

2008-11-20 Thread mmm

Hi group,
i used the following code in my view:

$ajax-submit()

which generated something like:

input type=submit url=/posts/mymethod value=Search
id=submit881124296 onclick=event.returnValue = false; return
false; //divscript type=text/javascript
//![CDATA[
Event.observe(submit881124296, 'click', function(event) { new
Ajax.Updater('resultDiv','/posts/mymethod', {asynchronous:true,
evalScripts:true, onComplete:function(request, json) { alert(json);
myfunction(json); }, parameters:Form.serialize(Event.element
(event).form), requestHeaders:['X-Update', 'resultDiv']}) }, false);
//]]
/script

all works as expected, however what i want i to get some data from
mymethod (defined in posts controller) as a Json object and use it in
my JavaScript function myfunction(json); i can see that object
called json is already there, however it is set to NULL!!!

please help!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



need help with forms and ajax

2008-11-19 Thread mmm

hi group,
i'm missing something really simple and i need your help, i have a
simple form in my view, when a user presses submit button i want to
send form data to controller( or view) and get the result back in the
ajax callback, updating one singe div on the view. how can actually do
that?

please help!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: need help with forms and ajax

2008-11-19 Thread mmm

already found a solution to it! thanks anyway!

On 19 Nov., 13:15, mmm [EMAIL PROTECTED] wrote:
 hi group,
 i'm missing something really simple and i need your help, i have a
 simple form in my view, when a user presses submit button i want to
 send form data to controller( or view) and get the result back in the
 ajax callback, updating one singe div on the view. how can actually do
 that?

 please help!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



url parameters in cake1.2

2008-11-17 Thread mmm

hi group.
i'm new to cake, just installed 1.2 rc3 and found it really cool! what
i'm trying to find out know is how can i processes custom parameters
in URL, for example if i pass:

http://myhost.com/app/posts/view/711?myparam=1

is it possible for me to ready this myparam? or another example:

http://myhost.com/app/mypathentry/posts/view/711

can i get mypathentry?

the reason why i want all that is that i'm trying to find a way how to
switch a theme based on path/parameter. Example:

http://myhost.com/app/mypathentry/posts/view/711 - rendered as Theme1
http://myhost.com/app/posts/view/711 - rendered as Theme2

if i'm able to find mypathentry i would just switch the theme in my
controller and the content will be rendered using corresponding theme,
or am i missing something here and there is a better solution for
that?

thanks in advance!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---