viewaction

Yii 2 static pages

孤街醉人 提交于 2019-12-07 19:44:36
问题 I can't show static pages. Try do it as described in doc here - http://stuff.cebe.cc/yii2-guide.pdf (on page 100) but when I enable prettyurl, it doesn't work. Added in urlManager rules: 'urlManager' => array( 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => array( '' => 'site/index', 'login' => 'site/login', 'contacts' => 'site/contact', '<view:(break)>'=>'/site/page?&view=<view>', ), ), then in SiteController added: public function actions() { return [ ... 'page' => [ 'class

Yii 2 static pages

♀尐吖头ヾ 提交于 2019-12-06 10:50:50
I can't show static pages. Try do it as described in doc here - http://stuff.cebe.cc/yii2-guide.pdf (on page 100) but when I enable prettyurl, it doesn't work. Added in urlManager rules: 'urlManager' => array( 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => array( '' => 'site/index', 'login' => 'site/login', 'contacts' => 'site/contact', '<view:(break)>'=>'/site/page?&view=<view>', ), ), then in SiteController added: public function actions() { return [ ... 'page' => [ 'class'=>'yii\web\ViewAction', ], ]; } And then created views/site/pages/break.php <h1>View static page Break

Android install apk with Intent.VIEW_ACTION not working with File provider

强颜欢笑 提交于 2019-11-26 07:19:36
问题 My app has an auto-update feature that download an APK and when the download is finished that a Intent.VIEW_ACTION to open the app and let the user install the downloaded apk Uri uri = Uri.parse(\"file://\" + destination); Intent install = new Intent(Intent.ACTION_VIEW); install.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); install.setDataAndType(uri, manager.getMimeTypeForDownloadedFile(downloadId)); activity.startActivity(install); This works great for all the device < 24 Now with Android 24

When to use f:viewAction / preRenderView versus PostConstruct?

谁说胖子不能爱 提交于 2019-11-26 01:29:15
问题 When should one use the f:viewAction or preRenderView event to initialize data for a page versus using the @PostConstruct annotation? Is the rationale to use one or the other based on the type of scope of the backing bean e.g. If the backing bean is @RequestScoped , then would the choice of using f:viewAction or preRenderView over @PostConstruct to initialize your backing bean prior to rendering the view be irrelevant as the two would result in the same effect? f:viewAction or preRenderView

What can <f:metadata>, <f:viewParam> and <f:viewAction> be used for?

僤鯓⒐⒋嵵緔 提交于 2019-11-25 22:15:19
问题 Can anyone clarify how we can use in general, or a in real world example, this snippet? <f:metadata> <f:viewParam id=\"id\" value=\"#{bean.id}\" /> <f:viewAction action=\"#{bean.init}\" /> </f:metadata> 回答1: Process GET parameters The <f:viewParam> manages the setting, conversion and validation of GET parameters. It's like the <h:inputText> , but then for GET parameters. The following example <f:metadata> <f:viewParam name="id" value="#{bean.id}" /> </f:metadata> does basically the following: