You would not break rules at all.

One example:


class fooActions.... {
        function exampleBar(){
                // removed action code here
                // the common actions are done in the component, which is 
included  
in the template
        }
}


your template barSuccess.php:

---
<?php include_component('foo','blah'); ?>
---


Your component


class fooComponent..{
        function exampleBlah(){
                // do your common actions here!
                
        }

}


The template _blah.php:

----
Hello World
----


Now you can call /foo/bar per web request (or ajax call) or include  
the foo/blah component into your action to retrieve the same output  
and to go through the same php code.




Am 19.04.2007 um 16:50 schrieb Haris Zukanović:

> How can I call it?
> include_component?
>
> That is a helper function.. I would be braking rules right?
>
>
> Frank Stelzer wrote:
>> You can call the component in your action. So you would have the
>> common operations only in the component.
>>
>>
>>
>> Am 19.04.2007 um 15:14 schrieb Haris Zukanović:
>>
>>
>>> Hi,
>>>
>>> I have a component and an action that do exactly the same...
>>>
>>> I need the component to include it in my layout.php and I need the
>>> action to be able to make ajax calls later to produce the same  
>>> results
>>>
>>> It is not easy to maintain since I have code and templates in two
>>> different places.
>>> Is this the right way of doing it in symfony ?
>>>
>>> TIA
>>>
>>>
>>> -- 
>>> Haris Zukanovi?
>>> CEO
>>> Software development and research
>>> International Business Development, SOFTING ltd.
>>>
>>>
>>> office  +387 36 318 339
>>> GSM     +387 61 839 069
>>>
>>> http://www.eu-softing.com
>>>
>>>
>>>
>>>
>>>
>>> CONFIDENTIALITY NOTICE
>>> -------------------------------------------------------------------- 
>>> --
>>> --------------------------------------------------
>>> This e-mail and any attached files, sent by a company e - mail
>>> system, contains company confidential and/or privileged information
>>> and is intended only for the person or entity to which it is
>>> addressed and only for the purposes therein set forth. If you are
>>> not the intended recipient (or have received this e-mail in error)
>>> please notify the sender immediately and destroy this e-mail. Any
>>> unauthorized copying, disclosure, distribution or other use of, or
>>> taking of any action in reliance upon, the material in this e-mail
>>> by persons or entities other than the intended recipient is
>>> strictly forbidden.
>>> -------------------------------------------------------------------- 
>>> --
>>> ---------------
>>>
>>>
>>>
>>> begin:vcard
>>> fn;quoted-printable:Haris Zukanovi=C4=87
>>> n;quoted-printable:Zukanovi=C4=87;Haris
>>> org:Softing d.o.o Mostar;Software development and research
>>> adr:;;K.M.V.H 12;Mostar;HNK;88000;Bosnia and Herzegovina
>>> email;internet:[EMAIL PROTECTED]
>>> title:CEO
>>> tel;work:+387 36 318 339
>>> tel;fax:+387 36 318 339
>>> tel;pager:N/A
>>> tel;home:N/A
>>> tel;cell:+387 61 839 069
>>> url:http://www.eu-softing.com
>>> version:2.1
>>> end:vcard
>>>
>>>
>>
>>
>
>
> -- 
> Haris Zukanovi?
> CEO
> Software development and research
> International Business Development, SOFTING ltd.
>
>
> office  +387 36 318 339
> GSM     +387 61 839 069
>
> http://www.eu-softing.com
>
>
>
>
>
> CONFIDENTIALITY NOTICE
> ---------------------------------------------------------------------- 
> --------------------------------------------------
> This e-mail and any attached files, sent by a company e - mail  
> system, contains company confidential and/or privileged information  
> and is intended only for the person or entity to which it is  
> addressed and only for the purposes therein set forth. If you are  
> not the intended recipient (or have received this e-mail in error)  
> please notify the sender immediately and destroy this e-mail. Any  
> unauthorized copying, disclosure, distribution or other use of, or  
> taking of any action in reliance upon, the material in this e-mail  
> by persons or entities other than the intended recipient is  
> strictly forbidden.
> ---------------------------------------------------------------------- 
> ---------------
>
> >
> begin:vcard
> fn;quoted-printable:Haris Zukanovi=C4=87
> n;quoted-printable:Zukanovi=C4=87;Haris
> org:Softing d.o.o Mostar;Software development and research
> adr:;;K.M.V.H 12;Mostar;HNK;88000;Bosnia and Herzegovina
> email;internet:[EMAIL PROTECTED]
> title:CEO
> tel;work:+387 36 318 339
> tel;fax:+387 36 318 339
> tel;pager:N/A
> tel;home:N/A
> tel;cell:+387 61 839 069
> url:http://www.eu-softing.com
> version:2.1
> end:vcard
>


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

Reply via email to