Ho @mohamed-valith-j
It is not possible to achieve what you need in the way you want. There is still an open request for this, but me personally I don't think it will be implemented:
https://github.com/adobe/htl-spec/issues/86
The way to do it is how @lukasz-m suggested. That is the tipical approach.
The best approach would be to keep view sepatate from the controller, and not have hard-coded values in HTL. I advice to move the logic only in the model and have control over it via component properties. This means to have dialog fields to configure the component with stuff that will instruct your model to execute its logic for a given path, a given CF type and a given config.