Re: Flash site With Cake Php

2009-06-19 Thread paulos nikolo
I am using this block of code as i use httpSocket to get some data in xml
from a site.The $results variable contains my returned data in Xml and with
the code i gave you i cant make them appear in a simple way to check if my
request is working.

2009/6/19 taufiq ridha 

>
> Hi guys thanks for all the answer, and that's worked :D
>
> my next questions, how i can get this xml with output costum, let's
> say i dont wanna fetch all the variable, like i just wanna fetch user
> with some attribute not all,
> because for now, it still fetch all data and all relations with user
> table, see :
>
> /* i just wanna fetch username and email*/
> 
>  taufiqridha
>  tau...@gmail.com
> 
>
> anyway paulos, where i can put this code :D, remembering i'm very new
> on this, can u give me more details :D
>
> thanks for all guys, it's very helped me out
>
> cheers
>
> On Jun 19, 1:16 pm, Adam Royle  wrote:
> > Put this in app/views/users/xml/index.ctp
> >
> >  > echo '';
> > echo $xml->serialize($users, array('format' => 'tags'));
> > echo '';
> > ?>
> >
> > and put this in app/views/layouts/xml/default.ctp
> >
> >  > echo $xml->header();
> > echo $content_for_layout;
> > ?>
> >
> > XML it doesn't show as XML in your browser if debug is set to 2,
> > because RequestHandler won't output the necessary headers. If that's
> > the case, add this in your AppController's beforeFilter() to override
> > this behaviour:
> >
> > if (!empty($this->params['url']['ext']) && $this->params['url']['ext']
> > == 'xml' && Configure::read('debug') > 0) {
> > Configure::write('debug', 1);
> >
> > }
> >
> > And then it should all work!
> >
> > Cheers,
> > Adam
> >
> > On Jun 19, 4:43 am, taufiq ridha  wrote:
> >
> >
> >
> > > Hello, nice to meet u all!!
> > > sorry for this stupid question, but i'm really new on this framework.
> > > i was try to search for this subject, but not find yet, so i decided
> > > to ask for all guru's here :)
> >
> > > i want to build flash site, which cake php will provide xml for my
> > > flash,
> >
> > > here's what i was done to get xml :
> >
> > > Routes by adding :
> > > Router::parseExtensions();
> >
> > > on the controller :
> >
> > >  > > class UsersController extends AppController {
> >
> > > var $name = 'Users';
> > > var $helpers = array('Html', 'Form');
> > > var $components = array('RequestHandler');
> >
> > > function index() {
> > > $this->User->recursive = 0;
> > > $this->set('users', $this->paginate());
> > > }}
> >
> > > ?>
> >
> > > finnaly here's code for my views on views/users/xml/index.ctp
> >
> > >  > > echo $xml->serialize($users);
> > > ?>
> >
> > > Now, when i pointing tohttp://localhost/example/users/index.xmligot
> > > very messy xml
> >
> > >  > > username="taufiqridha" password="taufiq123"
> > > email="taufiq.ri...@gmail.com" name="Taufiq Ridha" birth="2009-06-17"
> > > sex="1" city="Jakarta" phone="2147483647" avatar_face_id="1"
> > > avatar_hair_id="1" avatar_top_id="1" avatar_bottom_id="1"
> > > avatar_shoe_id="1" avatar_acc1_id="1" avatar_acc2_id="1" shout="ini
> > > shout out 2" point="0" created="2009-06-17 01:05:50"
> > > modified="2009-06-17 01:32:07"> > > sex="1" path_image="http://taufiq-ridha.co.cc"; created="2009-06-14
> > > 20:14:27" modified="2009-06-14 20:14:27" /> > > name="Belah Tengah" sex="1" path_image="http://taufiq-ridha.co.cc";
> > > created="2009-06-14 20:15:31" modified="2009-06-14 20:15:31"
> /> > > path_image="http://taufiq-ridha.co.cc"; created="2009-06-14 20:16:35"
> > > modified="2009-06-14 20:16:35" />http://taufiq-ridha.co.cc";
> > > created="2009-06-14 20:17:38" modified="2009-06-14 20:17:38"
> /> > > path_image="http://taufiq-ridha.co.cc"; created="2009-06-14 20:17:16"
> > > modified="2009-06-14 20:17:16" /> > > created="" modified="" /> > > user_id="1" created="2009-06-14 23:51:53" modified="2009-06-18
> > > 14:00:35" />
> >
> > > did anyone know how to make this xml more friendly(costum) also with
> > > list view, just like :
> >
> > > 
> > >
> > >taufiq ridha
> > >   1
> > >   2
> > >   /* and so on */
> > >
> > > 
> >
> > > thanks for advice guys, and sorry for this basic questions
> >
> > > regards
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Flash site With Cake Php

2009-06-19 Thread taufiq ridha

Hi guys thanks for all the answer, and that's worked :D

my next questions, how i can get this xml with output costum, let's
say i dont wanna fetch all the variable, like i just wanna fetch user
with some attribute not all,
because for now, it still fetch all data and all relations with user
table, see :

/* i just wanna fetch username and email*/

 taufiqridha
 tau...@gmail.com


anyway paulos, where i can put this code :D, remembering i'm very new
on this, can u give me more details :D

thanks for all guys, it's very helped me out

cheers

On Jun 19, 1:16 pm, Adam Royle  wrote:
> Put this in app/views/users/xml/index.ctp
>
>  echo '';
> echo $xml->serialize($users, array('format' => 'tags'));
> echo '';
> ?>
>
> and put this in app/views/layouts/xml/default.ctp
>
>  echo $xml->header();
> echo $content_for_layout;
> ?>
>
> XML it doesn't show as XML in your browser if debug is set to 2,
> because RequestHandler won't output the necessary headers. If that's
> the case, add this in your AppController's beforeFilter() to override
> this behaviour:
>
> if (!empty($this->params['url']['ext']) && $this->params['url']['ext']
> == 'xml' && Configure::read('debug') > 0) {
>     Configure::write('debug', 1);
>
> }
>
> And then it should all work!
>
> Cheers,
> Adam
>
> On Jun 19, 4:43 am, taufiq ridha  wrote:
>
>
>
> > Hello, nice to meet u all!!
> > sorry for this stupid question, but i'm really new on this framework.
> > i was try to search for this subject, but not find yet, so i decided
> > to ask for all guru's here :)
>
> > i want to build flash site, which cake php will provide xml for my
> > flash,
>
> > here's what i was done to get xml :
>
> > Routes by adding :
> > Router::parseExtensions();
>
> > on the controller :
>
> >  > class UsersController extends AppController {
>
> >         var $name = 'Users';
> >         var $helpers = array('Html', 'Form');
> >         var $components = array('RequestHandler');
>
> >         function index() {
> >                 $this->User->recursive = 0;
> >                 $this->set('users', $this->paginate());
> >         }}
>
> > ?>
>
> > finnaly here's code for my views on views/users/xml/index.ctp
>
> >  > echo $xml->serialize($users);
> > ?>
>
> > Now, when i pointing tohttp://localhost/example/users/index.xmligot
> > very messy xml
>
> >  > username="taufiqridha" password="taufiq123"
> > email="taufiq.ri...@gmail.com" name="Taufiq Ridha" birth="2009-06-17"
> > sex="1" city="Jakarta" phone="2147483647" avatar_face_id="1"
> > avatar_hair_id="1" avatar_top_id="1" avatar_bottom_id="1"
> > avatar_shoe_id="1" avatar_acc1_id="1" avatar_acc2_id="1" shout="ini
> > shout out 2" point="0" created="2009-06-17 01:05:50"
> > modified="2009-06-17 01:32:07"> > sex="1" path_image="http://taufiq-ridha.co.cc"; created="2009-06-14
> > 20:14:27" modified="2009-06-14 20:14:27" /> > name="Belah Tengah" sex="1" path_image="http://taufiq-ridha.co.cc";
> > created="2009-06-14 20:15:31" modified="2009-06-14 20:15:31" /> > id="1" name="Atasan Kurus" sex="1" path_image="http://
>
> > taufiq-ridha.co.cc" created="2009-06-14 20:16:09" modified="2009-06-14
> > 20:16:09" /> > path_image="http://taufiq-ridha.co.cc"; created="2009-06-14 20:16:35"
> > modified="2009-06-14 20:16:35" />http://taufiq-ridha.co.cc";
> > created="2009-06-14 20:17:38" modified="2009-06-14 20:17:38" /> > id="1" name="Gelang Punk" sex="1" path_image="http://
>
> > taufiq-ridha.co.cc" created="2009-06-14 20:16:59" modified="2009-06-14
> > 20:16:59" /> > path_image="http://taufiq-ridha.co.cc"; created="2009-06-14 20:17:16"
> > modified="2009-06-14 20:17:16" /> > created="" modified="" /> > user_id="1" created="2009-06-14 23:51:53" modified="2009-06-18
> > 14:00:35" />
>
> > did anyone know how to make this xml more friendly(costum) also with
> > list view, just like :
>
> > 
> >    
> >        taufiq ridha
> >       1
> >       2
> >       /* and so on */
> >    
> > 
>
> > thanks for advice guys, and sorry for this basic questions
>
> > regards
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Flash site With Cake Php

2009-06-18 Thread Adam Royle

Put this in app/views/users/xml/index.ctp

';
echo $xml->serialize($users, array('format' => 'tags'));
echo '';
?>

and put this in app/views/layouts/xml/default.ctp

header();
echo $content_for_layout;
?>

XML it doesn't show as XML in your browser if debug is set to 2,
because RequestHandler won't output the necessary headers. If that's
the case, add this in your AppController's beforeFilter() to override
this behaviour:

if (!empty($this->params['url']['ext']) && $this->params['url']['ext']
== 'xml' && Configure::read('debug') > 0) {
Configure::write('debug', 1);
}

And then it should all work!

Cheers,
Adam

On Jun 19, 4:43 am, taufiq ridha  wrote:
> Hello, nice to meet u all!!
> sorry for this stupid question, but i'm really new on this framework.
> i was try to search for this subject, but not find yet, so i decided
> to ask for all guru's here :)
>
> i want to build flash site, which cake php will provide xml for my
> flash,
>
> here's what i was done to get xml :
>
> Routes by adding :
> Router::parseExtensions();
>
> on the controller :
>
>  class UsersController extends AppController {
>
>         var $name = 'Users';
>         var $helpers = array('Html', 'Form');
>         var $components = array('RequestHandler');
>
>         function index() {
>                 $this->User->recursive = 0;
>                 $this->set('users', $this->paginate());
>         }}
>
> ?>
>
> finnaly here's code for my views on views/users/xml/index.ctp
>
>  echo $xml->serialize($users);
> ?>
>
> Now, when i pointing tohttp://localhost/example/users/index.xmli got
> very messy xml
>
>  username="taufiqridha" password="taufiq123"
> email="taufiq.ri...@gmail.com" name="Taufiq Ridha" birth="2009-06-17"
> sex="1" city="Jakarta" phone="2147483647" avatar_face_id="1"
> avatar_hair_id="1" avatar_top_id="1" avatar_bottom_id="1"
> avatar_shoe_id="1" avatar_acc1_id="1" avatar_acc2_id="1" shout="ini
> shout out 2" point="0" created="2009-06-17 01:05:50"
> modified="2009-06-17 01:32:07"> sex="1" path_image="http://taufiq-ridha.co.cc"; created="2009-06-14
> 20:14:27" modified="2009-06-14 20:14:27" /> name="Belah Tengah" sex="1" path_image="http://taufiq-ridha.co.cc";
> created="2009-06-14 20:15:31" modified="2009-06-14 20:15:31" /> id="1" name="Atasan Kurus" sex="1" path_image="http://
>
> taufiq-ridha.co.cc" created="2009-06-14 20:16:09" modified="2009-06-14
> 20:16:09" /> path_image="http://taufiq-ridha.co.cc"; created="2009-06-14 20:16:35"
> modified="2009-06-14 20:16:35" />http://taufiq-ridha.co.cc";
> created="2009-06-14 20:17:38" modified="2009-06-14 20:17:38" /> id="1" name="Gelang Punk" sex="1" path_image="http://
>
> taufiq-ridha.co.cc" created="2009-06-14 20:16:59" modified="2009-06-14
> 20:16:59" /> path_image="http://taufiq-ridha.co.cc"; created="2009-06-14 20:17:16"
> modified="2009-06-14 20:17:16" /> created="" modified="" /> user_id="1" created="2009-06-14 23:51:53" modified="2009-06-18
> 14:00:35" />
>
> did anyone know how to make this xml more friendly(costum) also with
> list view, just like :
>
> 
>    
>        taufiq ridha
>       1
>       2
>       /* and so on */
>    
> 
>
> thanks for advice guys, and sorry for this basic questions
>
> regards
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Flash site With Cake Php

2009-06-18 Thread paulos nikolo
Hi taufiq,
I am using xml in my site on a way that you are and at the moment i use this
kind of code to show results:

$parsed_xml =& new XML($results);
$parsed_xml = Set::reverse($parsed_xml);

debug($results); or var_dump($results);

This is very simple.But in future i ll use a more significant way to appear
my results in my own needs.
I hope i helped even in a small way!

regards,
Paulos

2009/6/18 taufiq ridha 

>
> Hello, nice to meet u all!!
> sorry for this stupid question, but i'm really new on this framework.
> i was try to search for this subject, but not find yet, so i decided
> to ask for all guru's here :)
>
> i want to build flash site, which cake php will provide xml for my
> flash,
>
> here's what i was done to get xml :
>
> Routes by adding :
> Router::parseExtensions();
>
> on the controller :
>
>  class UsersController extends AppController {
>
>var $name = 'Users';
>var $helpers = array('Html', 'Form');
>var $components = array('RequestHandler');
>
>function index() {
>$this->User->recursive = 0;
>$this->set('users', $this->paginate());
>}
> }
> ?>
>
> finnaly here's code for my views on views/users/xml/index.ctp
>
>  echo $xml->serialize($users);
> ?>
>
> Now, when i pointing to http://localhost/example/users/index.xml i got
> very messy xml
>
>  username="taufiqridha" password="taufiq123"
> email="taufiq.ri...@gmail.com" name="Taufiq Ridha" birth="2009-06-17"
> sex="1" city="Jakarta" phone="2147483647" avatar_face_id="1"
> avatar_hair_id="1" avatar_top_id="1" avatar_bottom_id="1"
> avatar_shoe_id="1" avatar_acc1_id="1" avatar_acc2_id="1" shout="ini
> shout out 2" point="0" created="2009-06-17 01:05:50"
> modified="2009-06-17 01:32:07"> sex="1" path_image="http://taufiq-ridha.co.cc"; created="2009-06-14
> 20:14:27" modified="2009-06-14 20:14:27" /> name="Belah Tengah" sex="1" path_image="http://taufiq-ridha.co.cc";
> created="2009-06-14 20:15:31" modified="2009-06-14 20:15:31" /
> > path_image="http://taufiq-ridha.co.cc"; created="2009-06-14 20:16:35"
> modified="2009-06-14 20:16:35" />http://taufiq-ridha.co.cc";
> created="2009-06-14 20:17:38" modified="2009-06-14 20:17:38" /
> > path_image="http://taufiq-ridha.co.cc"; created="2009-06-14 20:17:16"
> modified="2009-06-14 20:17:16" /> created="" modified="" /> user_id="1" created="2009-06-14 23:51:53" modified="2009-06-18
> 14:00:35" />
>
> did anyone know how to make this xml more friendly(costum) also with
> list view, just like :
>
> 
>   
>   taufiq ridha
>  1
>  2
>  /* and so on */
>   
> 
>
> thanks for advice guys, and sorry for this basic questions
>
> regards
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Flash site With Cake Php

2009-06-18 Thread taufiq ridha

Hello, nice to meet u all!!
sorry for this stupid question, but i'm really new on this framework.
i was try to search for this subject, but not find yet, so i decided
to ask for all guru's here :)

i want to build flash site, which cake php will provide xml for my
flash,

here's what i was done to get xml :

Routes by adding :
Router::parseExtensions();

on the controller :

User->recursive = 0;
$this->set('users', $this->paginate());
}
}
?>

finnaly here's code for my views on views/users/xml/index.ctp

serialize($users);
?>

Now, when i pointing to http://localhost/example/users/index.xml i got
very messy xml

http://taufiq-ridha.co.cc"; created="2009-06-14
20:14:27" modified="2009-06-14 20:14:27" />http://taufiq-ridha.co.cc";
created="2009-06-14 20:15:31" modified="2009-06-14 20:15:31" /
>http://taufiq-ridha.co.cc"; created="2009-06-14 20:16:35"
modified="2009-06-14 20:16:35" />http://taufiq-ridha.co.cc";
created="2009-06-14 20:17:38" modified="2009-06-14 20:17:38" /
>http://taufiq-ridha.co.cc"; created="2009-06-14 20:17:16"
modified="2009-06-14 20:17:16" />

did anyone know how to make this xml more friendly(costum) also with
list view, just like :


   
   taufiq ridha
  1
  2
  /* and so on */
   


thanks for advice guys, and sorry for this basic questions

regards

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---