Re: Access cake data from external php script

2007-12-14 Thread Paolo

Thank you very much for all your answer. Just a note, I'm using 1.1,
the stable version. Is 1.2 ready for a develepment environment? I see
it is still beta or per-beta... I will try to work itout!
Thanks

On 14 Dic, 02:18, zonium <[EMAIL PROTECTED]> wrote:
> Paolo,
> This has been discussed 
> here:http://groups.google.com/group/cake-php/browse_thread/thread/8e5f487a...
>
> A note :
> - if you use $Dispatcher->dispatch($action) you need to use output
> buffering
>
> On Dec 13, 8:29 am, Paolo <[EMAIL PROTECTED]> wrote:
>
> > Hi all!
>
> > I created a website for a real estate agency using cake. I used cake
> > to create the management part of the website, now I'm creating the
> > remaining part, that one that will be available to the user. I
> > wouldn't like to use cake for this, but would it be possible to query
> > some page or something in order to get the answer from cake pages? For
> > example, if I want to get all the items in a table, how can I do it?
> > Or if I would like to search for something?
>
> > Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Access cake data from external php script

2007-12-13 Thread zonium

Paolo,
This has been discussed here:
http://groups.google.com/group/cake-php/browse_thread/thread/8e5f487a944abeaf/e284ffdecdab0c69?lnk=gst&q=+cakephp+structure#e284ffdecdab0c69

A note :
- if you use $Dispatcher->dispatch($action) you need to use output
buffering



On Dec 13, 8:29 am, Paolo <[EMAIL PROTECTED]> wrote:
> Hi all!
>
> I created a website for a real estate agency using cake. I used cake
> to create the management part of the website, now I'm creating the
> remaining part, that one that will be available to the user. I
> wouldn't like to use cake for this, but would it be possible to query
> some page or something in order to get the answer from cake pages? For
> example, if I want to get all the items in a table, how can I do it?
> Or if I would like to search for something?
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Access cake data from external php script

2007-12-13 Thread francky06l

Paolo,

If you use cake 1.2, you can set Router::parseExtension('xml') in
core.php.
If you call your action from external application, using "http://
myhost. com/app/controller/action.xml", cake will look for a ctp in
this form view/xml/action.ctp (note the subfolder "xml"). In this view
you can just return xml. You also have an xml helper in the core that
can help you to "format" your xml.

hth

On Dec 13, 5:47 pm, Martin Wood-Mitrovski
<[EMAIL PROTECTED]> wrote:
> What I have done when faced with a similar situation (existing php site /
> scripts needs stuff from my cake app) is to generate the required page 
> fragments
> in cake and pull them in using file_get_contents($url_to_piece_of_cake)
>
> works fine.
>
> You'll probably want to create and use a layout just for those pieces, mine is
> just this :
>
> 
>
> then make sure you render that layout in the controller :
>
> $this->render("viewName","layoutName");
>
> then just put whatever you need into the view.
>
> Paolo wrote:
> > Hi all!
>
> > I created a website for a real estate agency using cake. I used cake
> > to create the management part of the website, now I'm creating the
> > remaining part, that one that will be available to the user. I
> > wouldn't like to use cake for this, but would it be possible to query
> > some page or something in order to get the answer from cake pages? For
> > example, if I want to get all the items in a table, how can I do it?
> > Or if I would like to search for something?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Access cake data from external php script

2007-12-13 Thread Martin Wood-Mitrovski

What I have done when faced with a similar situation (existing php site / 
scripts needs stuff from my cake app) is to generate the required page 
fragments 
in cake and pull them in using file_get_contents($url_to_piece_of_cake)

works fine.

You'll probably want to create and use a layout just for those pieces, mine is 
just this :



then make sure you render that layout in the controller :

$this->render("viewName","layoutName");

then just put whatever you need into the view.

Paolo wrote:
> Hi all!
> 
> I created a website for a real estate agency using cake. I used cake
> to create the management part of the website, now I'm creating the
> remaining part, that one that will be available to the user. I
> wouldn't like to use cake for this, but would it be possible to query
> some page or something in order to get the answer from cake pages? For
> example, if I want to get all the items in a table, how can I do it?
> Or if I would like to search for something?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Access cake data from external php script

2007-12-13 Thread francky06l

if you want only to retrieve data you could use your cake application
as web service returning xml for example.
Now if you want to return a view or part of a view, I guess you should
make an $ajax request from your external application..(take care if
you have links in the returned views)..

hth

On Dec 13, 5:29 pm, Paolo <[EMAIL PROTECTED]> wrote:
> Hi all!
>
> I created a website for a real estate agency using cake. I used cake
> to create the management part of the website, now I'm creating the
> remaining part, that one that will be available to the user. I
> wouldn't like to use cake for this, but would it be possible to query
> some page or something in order to get the answer from cake pages? For
> example, if I want to get all the items in a table, how can I do it?
> Or if I would like to search for something?
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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: Access cake data from external php script

2007-12-13 Thread Paolo

No I just want to return data, I think the xml solution could be
great! How can I tell cake not to render the page? Is there a method
to create xml or should I create it by myself?

Thanks

On 13 Dic, 18:14, francky06l <[EMAIL PROTECTED]> wrote:
> if you want only to retrieve data you could use your cake application
> as web service returning xml for example.
> Now if you want to return a view or part of a view, I guess you should
> make an $ajax request from your external application..(take care if
> you have links in the returned views)..
>
> hth
>
> On Dec 13, 5:29 pm, Paolo <[EMAIL PROTECTED]> wrote:
>
> > Hi all!
>
> > I created a website for a real estate agency using cake. I used cake
> > to create the management part of the website, now I'm creating the
> > remaining part, that one that will be available to the user. I
> > wouldn't like to use cake for this, but would it be possible to query
> > some page or something in order to get the answer from cake pages? For
> > example, if I want to get all the items in a table, how can I do it?
> > Or if I would like to search for something?
>
> > Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---