diConfig = {
loadListener = "LoadListener",
exclude : [ '/com/' ]
},
routes = [
// ...
{ "$GET/:category/:subcategory/:slug" = "/product/show/category/:category/subcategory/:subcategory/slug/:slug" }
// ....
]
component { public function onLoad( beanfactory ){
beanfactory
// Underscore.cfc - https://russplaysguitar.github.io/UnderscoreCF/ .declare( "_" ).aliasFor( "underscoreUtil" ).done()
.declare( 'postmark' ).instanceOf( 'com.postmark.postmark' ).asSingleton().withOverrides( { accountToken = 'xxxx', serverToken = 'yyyy', baseURL = 'https://api.postmarkapp.com/' } ).done()
// qb - https://qb.ortusbooks.com/ .declare("BaseGrammar").instanceOf("qb.models.Grammars.BaseGrammar").done() .declare("MySQLGrammar").instanceOf("qb.models.Grammars.MySQLGrammar").done() .declare("QueryUtils").instanceOf("qb.models.Query.QueryUtils").done() .declare("query").instanceOf("qb.models.Query.QueryBuilder") .withOverrides({ grammar: beanfactory.getBean("MySQLGrammar"), utils: beanfactory.getBean("QueryUtils"), returnFormat: "query" }).done() .declare("SchemaBuilder").instanceOf("qb.models.Schema.SchemaBuilder") .asTransient() .withOverrides({ grammar: beanfactory.getBean("MySQLGrammar") })
;
beanFactory.load();
}}
component name="product" output="false" accessors="true"{
property beanFactory;
property productService;
property categoryService;
property securityUtil;
property _;
public any function init( fw ) {
variables.fw = arguments.fw;
return this;
}
public function default( struct rc ){
}
public function show( struct rc ){
variables.productService.sendEmailTest( to = "fr...@email.it", text = "test" );
}
}
component output="false" accessors="true" {
property SchemaBuilder;
property query;
property securityUtil;
property postmark;
public any function getProductBySlug(required string slug){
//
}
public function getProductByID(required string productId){
//
}
public function sendEmailTest( required string to, required string text){
test = variables.postmark.sendEmail(
From = "m...@email.it",
To = arguments.to,
subject = "subjecttest",
TextBody = arguments.text,
HtmlBody = arguments.text
);
}
}
variables.fw.redirect( "product.default" );
component accessors="true" {
property postmark;
function init() {
variables.when = now();
}
public function sendEmailTest( required string to, required string text, required string subject){
test = variables.postmark.sendEmail(
From = "m...@mail.it",
To = arguments.to,
subject = arguments.subject,
TextBody = arguments.text,
HtmlBody = arguments.text
);
}
}
public function show( struct rc ){
var mailSend = variables.beanFactory.getBean( "mail" );
mailSend.sendEmailTest( to = "info@website", subject ="subject test3", text = "test3" );
}
mailSend.sendEmailTest( to = "info@website", subject ="subject test3", text = "test3" );
public function show( struct rc ){
var mailSend = variables.beanFactory.getBean( "mail" );
mailSend.sendEmailTest( to = "info@website", subject ="subject test3", text = "test3" );
// once you've sent the email, redirect to a success page
variables.fw.redirect( "product.default" );
}
public function registerVisitator(required string slug){
query.from( "stats" ) .insert( { "stats_date" = Now(), "stats_slug" = arguments.slug } );
}
public function show( struct rc ){
On 2 Apr 2020, at 08:38, Ivan <ivan....@gmail.com> wrote:
--
FW/1 documentation: http://framework-one.github.io
FW/1 source code: http://github.com/framework-one/fw1
FW/1 chat / support: https://gitter.im/framework-one/fw1
FW/1 mailing list: http://groups.google.com/group/framework-one
---
You received this message because you are subscribed to the Google Groups "framework-one" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-on...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/framework-one/ba2a0f66-024c-428e-aed1-4fd8d5e348cf%40googlegroups.com.
public function show( struct rc ){
variables.productService.registerVisitator( rc.slug );
rc.head.title = "page title";
rc.head.description = "lorem ipsum";
}
routes = [
// ...
{ "$GET/:category/:subcategory/:slug" = "/product/show/category/:category/subcategory/:subcategory/slug/:slug" }
// ....
]
To unsubscribe from this group and stop receiving emails from it, send an email to framew...@googlegroups.com.
On 2 Apr 2020, at 12:18, Ivan <ivan....@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to framework-on...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/framework-one/d300da62-5d28-43c0-ae28-f6d8c36218cc%40googlegroups.com.
public function show( struct rc ){
dump( rc ); abort;
}
I don’t see where the value of rc.slug is being set in your code to result in product, images, items, items, items, items being output in tracking record
To view this discussion on the web visit https://groups.google.com/d/msgid/framework-one/d300da62-5d28-43c0-ae28-f6d8c36218cc%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-on...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/framework-one/9a3a6663-e0ed-438f-b5b0-3fc1c1838275%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/framework-one/9a3a6663-e0ed-438f-b5b0-3fc1c1838275%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-on...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/framework-one/003ea49a-8d8c-4848-8ada-ad9d4a136c6b%40googlegroups.com.
--
FW/1 documentation: http://framework-one.github.io
FW/1 source code: http://github.com/framework-one/fw1
FW/1 chat / support: https://gitter.im/framework-one/fw1
FW/1 mailing list: http://groups.google.com/group/framework-one
---
You received this message because you are subscribed to the Google Groups "framework-one" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-on...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/framework-one/ba2a0f66-024c-428e-aed1-4fd8d5e348cf%40googlegroups.com.
public function registerVisitator(required string slug){query.from( "stats" ).insert( {"stats_date" = Now(),"stats_slug" = arguments.slug} );}
To view this discussion on the web visit https://groups.google.com/d/msgid/framework-one/CAD4thx9g-%2B_SkVgZTS6RD666bYavE%3DwkBhdKzdif6iEVoi9xGw%40mail.gmail.com.
writeLog(text=timeFormat(now(),"hh:mm:ss:l") & " arguments.rc: " & serializejson(arguments.rc), type="information", file="fw1");
And I'd suggest using WriteLog() in your product controller show function instead of the registerVisitator() function to make sure the log data is accurate. Something likeWriteLog( Now() & ' : ' & rc.slug );If you need help finding the log file this write to, let us know.
public function registerVisitator(required string slug){query.from( "stats" ).insert( {"stats_date" = Now(),"stats_slug" = arguments.slug} );}
CarbonZero Sagl+41 (0)76 303 4477 cell
skype: ariamedia
On Thu, Apr 2, 2020 at 11:06 PM Sean Corfield <se...@corfield.org> wrote:
I think the problem might be in your views. Can you show us the contents of your views and layouts files?That table above suggests that your request for a product page is followed by a request for images and then for four items URLs...
To unsubscribe from this group and stop receiving emails from it, send an email to framew...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/framework-one/ba2a0f66-024c-428e-aed1-4fd8d5e348cf%40googlegroups.com.
----Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles Networks, LLC. -- https://worldsinglesnetworks.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)
FW/1 documentation: http://framework-one.github.io
FW/1 source code: http://github.com/framework-one/fw1
FW/1 chat / support: https://gitter.im/framework-one/fw1
FW/1 mailing list: http://groups.google.com/group/framework-one
---
You received this message because you are subscribed to the Google Groups "framework-one" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framew...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-on...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/framework-one/4d1f7f91-2c82-416a-a80b-e6ddd80a1344%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-on...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/framework-one/4d1f7f91-2c82-416a-a80b-e6ddd80a1344%40googlegroups.com.